WRITE A PL/SQL PROGRAM USING CURSOR TO PRINT NAME JOB IF EMPLOYEE HAVING DESIGNATION AS MANAGER OR ANALYST

 PROGRAM USING CURSOR TO PRINT NAME JOB IF EMPLOYEE HAVING DESIGNATION AS MANAGER OR ANALYST

DECLARE
CURSOR C1 IS SELECT ENAME,JOB FROM EMP;
E EMP.ENAME%TYPE;
J EMP.JOB%TYPE;
BEGIN
    OPEN C1;
 
    LOOP
      FETCH C1 INTO E,J;
      EXIT WHEN C1%NOTFOUND;
   
      IF J='MANAGER' OR J='ANALYST' THEN
          DBMS_OUTPUT.PUT_LINE(E||' '||j);
      END IF;
    END LOOP;
    CLOSE C1;
END;
Previous
Next Post »

1 Comments:

Click here for Comments
Unknown
admin
May 22, 2022 at 4:44 PM ×

Please give output of code

Thank You Unknown For Comment.
Reply
avatar