chitra, February 08, 2006 - 11:48 am UTC
Can we use returning clause when doing a insert as select?
I am trying to do something like below, and I am hitting a
ORA-06550 error.
t is the table with two number columns x and y.
declare
l_x number;
begin
insert into t (x,y) ( select 42,32 from dual) returning x into l_x;
end;
February 09, 2006 - 4:09 am UTC
you cannot use the returning clause on an insert as select, only on an insert values statement.
it does not realize (it cannot realize, it might not be true) that you are only inserting a single record.