Forum OpenACS Development: Response to What is the problem with this insert statement?

Collapse
Posted by Don Baccus on
Parameter 1 ("$1") has been aliased with the same name as one of the columns in your table.  PL/pgSQL doesn't know about context, and is substituting "$1" for that parameter alias reasoanbly enough, resulting in something like

"insert into cr_wp_presentations($1, ...)"

instead of the column name.

You can avoid problems like this by consistently prefixing your parameter aliases with "p_" just as you've used "v_" as a prefix for your variable names.