Forum OpenACS Development: Re: Weird problems with db_exec_plsql
In the second case the multiple statements are wrapped in a dummy function.
You should either write a wrapper function for your query or do something like "select 1 from (select ...your query...)" to trick db_exec_plsql into executing this.
We supply this kludge so the calling code doesn't have to switch to calling db_0or1row or db_string or the like in the PostgreSQL while calling db_exec_plsql in the Oracle case. Our PG db_exec_plsql allows us to bury the difference in the query file - where it should be.