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: IDEDWARDS <idedwards_at_aol.com>
Date: 06 Jan 2000 21:35:17 GMT
Message-ID: <20000106163517.01136.00000100@ng-fj1.aol.com>


It depends on the version of the database you are using.

If its before oracle 8 then I guess the only solution is to simply select the row from the table after it was inserted into.

If you are using Oracle 8 then there is the RETURNING clause you can use. eg.

insert into table1 values (1, 2, 3, 4)
returning col1, col2, col3, col4 into
var1, var2, var3, var4;

This also works with expressions so you could use

returning col1+col2 into var1;

Ed Received on Thu Jan 06 2000 - 15:35:17 CST

Original text of this message

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