Forum OpenACS Development: Re: Tcl Help...ASAP Please!!!!!!

Collapse
Posted by Mark Aufflick on

also, make sure debug is set to true in your nsd config.tcl file - that way your error log will include the sql query exactly as it is passed to the database.

Also, although this isn't your problem, you probably should use bind variables in your queries - ie:

where address_book_id = :address_id

that way you are automagically protected against 'sql in variable' hacks etc.

Collapse
Posted by Divya R on

Hi, Firstly thanks for your responses....

Well haven't been that successful yet...in-spite of trying

where commercial_details_id=:$commercial_details_id

Can you see any other fault.....The error log is also not responding...Nothing seems to be going my way!!

Thanks in advance DR

Collapse
Posted by Divya R on

Hi, This is the error log from the statement:-

"set selection [ns_db select $db "select address_book_id,first_names ||','|| line1 ||','|| ....." up to the end of that very  statement !!

Note below: -


[10/Jun/2003:09:30:44][11041.286725][-conn273-] Error: ora8.c:1500:ora_exec: 

error in `OCIStmtExec
ute ()': ORA-01745: invalid host/bind variable name

SQL: select first_names ||','||line1 ||','||city as address from address_book where 

address_book_i
d= !>>>!
[10/Jun/2003:09:30:44][11041.286725][-conn273-] Error: dbinit: 

error(,ora8.c:1500:ora_exec: error
in `OCIStmtExecute ()': ORA-01745: invalid host/bind variable name

SQL: select first_names ||','||line1 ||','||city as address from address_book where 

address_book_i
d= !>>>!): 'select first_names ||','||line1 ||','||city as address from address_book where 

address
_book_id=:'
[10/Jun/2003:09:30:44][11041.286725][-conn273-] Error: Database operation 

"select" failed (exception NSDB, "Query was not a statement returning rows.")

    while executing
"ns_db select $db "select first_names ||','||line1 ||','||city as address from 

address_book where
address_book_id=:$address_id""
    invoked from within
"set selection [ns_db select $db "select first_names ||','||line1 ||','||city as address 

from address_book where address_book_id=:$address_id"]"
    (file "/web/nspapp/www/nspapp/delivery/delivery-add.tcl" line 88)
    invoked from within
"source [ad_conn file]"
    (procedure "rp_handle_tcl_request" line 2)
    invoked from within
"rp_handle_tcl_request"
    invoked from within
"catch $handler error"
    invoked from within
"rp_abstract_url_server"

Thanks in advance, divya