Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get back the inserted row?
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
![]() |
![]() |