Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Problem with returning clause in insert stmt
Hi! i am trying to execute the following pl/sql block
where t is a table with a number column.
t( n number)
variable r varchar2(20);
declare
r rowid;
cid integer;
n integer;
begin
cid := dbms_sql.open_cursor;
dbms_sql.parse (cid, 'insert into t values(1) returning rowid into
:g ',dbms_sql.native);
dbms_sql.bind_variable_rowid(cid,'g',r);
n:= dbms_sql.execute(cid);
dbms_sql.variable_value_rowid(cid,'g',r);
dbms_sql.close_cursor(cid);
:r := r;
end;
/
print r
This is the error message i get :
declare
*
ERROR at line 1:
ORA-06512: at "SYS.DBMS_SYS_SQL", line 787 ORA-06512: at "SYS.DBMS_SQL", line 328 ORA-06512: at line 9 ORA-01427: single-row subquery returns more than one row
if i get rid of the bind_variable call i get the error message not all variables bound...
am i doing something wrong?.. pl help me out... thanks in advance
jairam kuppuswamy
PS : The Oracle version is 8.0.4
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Mon Aug 09 1999 - 13:45:22 CDT