Hi Team,
I have the below code in plsql for processing weak cursors , whenever i run the code i get the below error. Any help is really appreciated. Iam using oracle 12c
ERROR at line 12:
ORA-06550: line 12, column 59:
PLS-00487: Invalid reference to variable 'L_EMPDEPTDATA'
ORA-06550: line 12, column 4:
PL/SQL: Statement ignored
declare
type t_empdeptdata is ref cursor;
l_empdeptdata t_empdeptdata ;
begin
open l_empdeptdata for
Select e.employee_id
from employees e
where e.department_id=30;
begin
loop
exit when l_empdeptdata%NOTFOUND;
dbms_output.put_line ('Employee_id : '|| l_empdeptdata.employee_id );
end loop;
end;
close l_empdeptdata;
end;
/
or use a cursor for loop and dereference from the loop index