Mark Wright wrote:
>
> |SELECT * FROM test_attendees
> |WHERE print_status = 'R'
> |AND id_number = (select min(id_number) from test_attendees )
^^^
Ops - add "AND print_status = 'R'" here!
> |FOR UPDATE OF test_attendees
> |
> |and run it in loop.
>
> That would only work the first time, since after updating print_status to
> 'C', the record where id_number = (select min(id_number) from
> test_attendees) would no longer have print_status = 'R', so no records would
> match the query.
And this is why I said "run select in loop": if no one row will
be returned (i.e. row returned by subselect is already updated
by concurrent xaction) then re-run select!
Vadim