This is the declartion:
------------------------
TYPE CTyp IS REF CURSOR;
cur CTyp;
This the Error LINE:
-----------------------
v_open:= 'BEGIN OPEN Cur '||' FOR '||''''||v_final_str||''''||' USING '|| p1_id ||','|| p2_id||','|| p3_id||'; END;';
EXECUTE IMMEDIATE v_open;
This is the ERROR:
----------------------
PLS-00201: identifier 'CUR' must be declared
PS: I also tried using
'BEGIN OPEN '|| Cur || ....
but, Cur type cannot be concatenated to string.
Also everything works OK if Dynamic is not used, but since i dont know the id's ahead of time, I have to use dynamic.
------------------------
TYPE CTyp IS REF CURSOR;
cur CTyp;
This the Error LINE:
-----------------------
v_open:= 'BEGIN OPEN Cur '||' FOR '||''''||v_final_str||''''||' USING '|| p1_id ||','|| p2_id||','|| p3_id||'; END;';
EXECUTE IMMEDIATE v_open;
This is the ERROR:
----------------------
PLS-00201: identifier 'CUR' must be declared
PS: I also tried using
'BEGIN OPEN '|| Cur || ....
but, Cur type cannot be concatenated to string.
Also everything works OK if Dynamic is not used, but since i dont know the id's ahead of time, I have to use dynamic.