Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Best way to do this?

Best way to do this?

From: Will Hartung <will.hartung_at_havasint.com>
Date: 2000/05/05
Message-ID: <8evei5012rs@news2.newsguy.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US