Re: Incrementing sequence number
Posted in 2000
From: "Obnoxio The Clown" <obnoxio@hotmail.com>
>
>From: Richard Spitz <Richard.Spitz@ana.med.uni-muenchen.de>
>>
>>Paul Watson wrote:
>>
>> > A lock on the row perhaps?
>>
>>Obnoxio wrote:
>>
>> > Lock the "max" record?
>>
>>Could the two of you maybe elaborate a little on how to put a lock
>>on a specific row?
>
>With a FOR UPDATE cursor. :0)
More specifically, in pseudo code:
DECLARE lock_rec CURSOR FOR
SELECT *
FROM table
WHERE key = p_rec.key
FOR UPDATE
WHILE searchval IS NOT NULL
SELECT key, max(intval)
INTO p_rec.*
FROM table
WHERE name = searchval
GROUP BY 1
OPEN lock_rec
FETCH lock_rec INTO whatever
-- now strut your stuff...
END WHILE
Something like that, anyway. I can't remember the original problem too well.
What day is it, anyway?
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com