Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Best way to do this?
I'm looking for pointers on how to do something fairly basic.
Here's the table:
create table thing (
thingid number(10),
x number(10),
thing_stat char(1))
Here's what I want to do:
select min(thingid) into l_thingid from thing where thing_stat = 'X'; select x into l_x from thing where thingid = l_thingid; update thing set thing_stat = 'Y' where thingid = l_thingid;
Essentially, I want the top number out of the table that hasn't been "used". Of course, I want this to be atomic.
So, anyone have any hints on how to pull this off?
Any thoughts appreciated.
Thanx!
Will Hartung
(will.hartung_at_havasint.com)
Received on Fri May 05 2000 - 00:00:00 CDT