Code :
- CREATE PACKAGE emp_data AS
- TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
- PROCEDURE open_emp_cv (emp_cv IN OUT EmpCurTyp,
- choice IN NUMBER);
- END emp_data;
- CREATE PACKAGE BODY emp_data AS
- PROCEDURE open_emp_cv (emp_cv OUT EmpCurTyp,
- choice IN NUMBER) IS
- BEGIN
- IF choice = 1 THEN
- OPEN emp_cv FOR SELECT * FROM emp WHERE comm IS NOT NULL;
- ELSIF choice = 2 THEN
- OPEN emp_cv FOR SELECT * FROM emp WHERE sal > 2500;
- ELSIF choice = 3 THEN
- OPEN emp_cv FOR SELECT * FROM emp WHERE deptno = 20;
- END IF;
- END open_emp_cv;
- END emp_data;
|
Je voudrais appeller cette procédure dans une autre via un
Code :
- emp_cv EmpCurTyp;
- Begin
- emp_cv = open_emp_cv(emp_cv, 1);
|
Comment faire ensuite un loop sur ce curseur emp_cv???