Forum OpenACS Q&A: Response to Co-branding / Partner problem

Collapse
Posted by Jerry Adlersfluegel on
Ok, so I figured out that the file partner-ae-2.tcl is missing the set db [ns_db gethandle] and I added that. Now when I try to Edit header procedure (/admin/partner/partner-proc-ae-2.tcl), I get another Server Error, and the following is logged:

[02/Aug/2000:11:16:55][3611.1563653][-conn9-] Error: Ns_PgExec: result status: 7 message: ERROR:  Function 'decode(int4, int4, int4, int4)' does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts

[02/Aug/2000:11:16:55][3611.1563653][-conn9-] Error: nsd.tcl: Database operation "1row" failed (exception NSDB, "Query was not a statement returning rows.")
Database operation "1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_db 1row $db [db_sql_prep $sql"
    (procedure "database_to_tcl_string" line 6)
    invoked from within
"database_to_tcl_string $db "select decode(count(*),0,0,1) 
                                          from ad_partner_procs 
                          ..."
    invoked from within
"set exists_p [database_to_tcl_string $db "select decode(count(*),0,0,1) 
                                          from ad_partner_procs 
            ..."
    (file "/web/bender/www/admin/partner/partner-proc-ae-2.tcl" line 17)
    invoked from within
"source $script"
    (procedure "ns_sourceproc" line 6)
    invoked from within
"ns_sourceproc cns65 {}"

Is the decode() function a built-in, or is that something that should have been defined in one of the www/doc/sql/*.sql files? A grep throught the files didn't turn up a create function decode anywhere.