WRITE A PL/SQL PROGRAM USING FOR LOOP IN CURSOR TO PRINT NAME JOB IF EMPLOYEE HAVING DESIGNATION AS MANAGER OR ANAYST


-- USING FOR LOOP
DECLARE
CURSOR C1 IS SELECT ENAME,JOB FROM EMP;
BEGIN
    FOR R IN C1 
    LOOP   
      IF R.JOB='MANAGER' OR R.JOB='ANALYST' THEN
          DBMS_OUTPUT.PUT_LINE(R.ENAME||' '||R.JOB);
      END IF;
    END LOOP;
END;

Previous
Next Post »