ERROR : PLS-00455: cursor 'CUR' cannot be used in dynamic SQL OPEN statement [message #228115] |
Sat, 31 March 2007 17:49 |
m_arafa
Messages: 36 Registered: June 2006
|
Member |
|
|
hi,
declare
type rec is record (id number, name varchar2(20));
type cur_typ is ref cursor return rec;
cur cur_typ ;
cond1 varchar2(30) := 'sal > 2000';
begin
open cur for 'select empno, ename from emp where '|| cond1;
end;
/
i must *and must* use ref cursor type "cur" and return record type "rec"
this code work properly without adding to cursor declaration "return rec"
i get that error :-
what the solution ,but with use "return rec" option ???
ERROR at line 7:
ORA-06550: line 7, column 9:
PLS-00455: cursor 'CUR' cannot be used in dynamic SQL OPEN statement
ORA-06550: line 7, column 4:
PL/SQL: Statement ignored
thanks,
|
|
|
|
|