## Example of how to share the same "cursor" for two "like" statements.


SELECT EMP_NAME, SALARY, GRADE
FROM   EMP
WHERE  EMP_NO = 0342;

SELECT EMP_NAME, SALARY, GRADE
FROM   EMP
WHERE  EMP_NO = 0291;



DECLARE
   CURSOR C1 (E_NO  NUMBER)  IS
   SELECT EMP_NAME, SALARY, GRADE
   FROM   EMP
   WHERE  EMP_NO = E_NO;
BEGIN
   OPEN   C1 (342);
   FETCH  C1 INTO ..., ..., ...;
   .
   .
   .
   OPEN   C1 (291);
   FETCH  C1 INTO ..., ..., ...;
   CLOSE  C1;
END;


SELECT A.EMP_NAME, A.SALARY, A.GRADE,
       B.EMP_NAME, B,SALARY, B.GRADE
FROM   EMP A,
       EMP B 
WHERE  A.EMP_NO = 0342
AND    B.EMP_NO = 0291 ;
