[SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread EXT-Rothermel, Peter M
I have a client application that needs: SELECT a set of records from a table and lock them for potential updates. for each record make some updates to this record and some other records in other tables call some call a function that does some application logic that does not access the

Re: [SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread Scott Marlowe
On Fri, Aug 1, 2008 at 11:02 AM, EXT-Rothermel, Peter M [EMAIL PROTECTED] wrote: I was thinking of something like this: connect to DB BEGIN SELECT * FROM table_foo where foo_state = 'queued' FOR UPDATE; for each row do [ SAVEPOINT s; UPDATE foo_resource SET in_use = 1 WHERE