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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to get back the inserted row?

Re: How to get back the inserted row?

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Wed, 05 Jan 2000 14:26:59 -0500
Message-ID: <ih677ss31sr6ld0eet9sju8ecindb8phhg@4ax.com>


On Wed, 05 Jan 2000 18:44:15 GMT, sriniv79_at_hotmail.com wrote:

>What is the best way to get the newly created row immediately after an
>insert? I am interested in getting the values of some columns filled in
>by an Insert Trigger.

In Oracle 8.0.5 and up try using the returning clause...

eg.

insert into foo ( col2, col3, col4 )
values ( 2, 3, 4 )
returning col1, col5
into l_col1, l_col5;

hope this helps.

chris.

>
>TIA.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Jan 05 2000 - 13:26:59 CST

Original text of this message

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