troubleshooting Question

Error while using weak ref cursor in oracle 12c

Avatar of sam_2012
sam_2012 asked on
* Oracle12c* Oracle PL/SQLOracle Database
3 Comments1 Solution45 ViewsLast Modified:
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

type t_empdeptdata is ref cursor;
l_empdeptdata t_empdeptdata ;
open l_empdeptdata for
Select e.employee_id
from employees e
where e.department_id=30;
            exit when l_empdeptdata%NOTFOUND;
                  dbms_output.put_line ('Employee_id : '|| l_empdeptdata.employee_id );
            end loop;
      close l_empdeptdata;
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros