Forum OpenACS Development: SQL sintax error

Collapse
Posted by Iuri Sampaio on
I got this weird sintax error when i use
db_exec_plsql isert_contact { *SQL }

but the error just disappear when i use
db_dml insert_contact { *SQL* }

is there any query sintax special changing when i switch db commands?

the error is bellow:

Database operation "dml" failed (exception ERROR, "ERROR: syntax error at or near "*"
LINE 2: *SQL
^
")
while executing
"ns_db dml $db "create function $function_name () returns varchar as '
[DoubleApos $proc_sql]
' language 'p..."
invoked from within
"db_exec_plpgsql $db $full_statement_name $sql $statement_name"
invoked from within
"if {[regexp -nocase -- {^\s*select} $test_sql match]} {
# ns_log Debug "PLPGSQL: bypassed anon function"
set selection..."
("uplevel" body line 6)

Collapse
2: Re: SQL sintax error (response to 1)
Posted by Dave Bauer on
You two examples have a typo in the query name
"db_exec_plsql isert_contact { *SQL }"
isert_contact instead of insert_contact

If the query uses the "*SQL*" text as the query text, it means you query name was not found, which makes sense if you make a typo in the name of the query.

Collapse
3: Re: SQL sintax error (response to 2)
Posted by Iuri Sampaio on
hehehe :)
I realized that later last week.

what a shame! I'm almost killing myself for this.
Thanks a lot Dave