Forum OpenACS Development: Re: Weird problems with db_exec_plsql

Collapse
Posted by Jade Rubick on
Jarkko, you're going to need to write some plsql code that loops like the original does. The __delete function does not take a CURSOR as an argument, it takes one id.
Collapse
Posted by Jarkko Laine on
Jade,

I don't quite get what you mean. The query I wrote works very well in psql, so I guess that either the __delete function gets always the id in my query (it should, at least), or it works even with cursor.

Either way, the problem is rather that it returns a value for every row that matches so it breaks 0or1row, like Don says.

I solved this by moving all this code to the package api of users-selection, where it imho should have been in the first place. That way, us_selection__delete takes care of cleaning up stuff that is related to it, and every developer calling for that proc doesn't have to delete the comments explicitly.

I thought about something like Don's wrapper trick, but came to a conclusion that moving the code is actually not that big a task and it should make the overall code cleaner.

Thanks for the feedback!