Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Getting the identity of the row just inserted
Mark Wagoner wrote:
> "Einar Magnus Råberg" <einarmr_at_tihlde.org> wrote in message
> news:3AB0C680.14D00D6D_at_tihlde.org...
> >
> > If I insert a row into a table
> > INSERT INTO foobar VALUES(foocounter.nextval, 'Hi', 'You');
> >
> > How do I get the primary key of the row I just inserted?
>
> In 8i you can use the RETURNING clause to get back the sequence value just
> inserted.
>
> Pre-8i, you will have to select the sequence value into a variable, then do
> your inserts with that.
OK, I'm using Oracle 7.
Could you give me som examples?
In advance, thank you.
-Einar Received on Thu Mar 15 2001 - 07:49:54 CST
![]() |
![]() |