WRITE A PL/SQL PROGRAM TO PRINT RECORD OF 4TH,6TH AND 8TH USING CURSOR

TO PRINT RECORD OF 4TH,6TH AND 8TH
DECLARE
CURSOR C1 IS SELECT * FROM EMP;
I INT:=0;
BEGIN
  FOR R IN C1
  LOOP
    I:=I+1;
    IF I IN (4,6,8) THEN
     DBMS_OUTPUT.PUT_LINE(R.ENAME||' '||R.SAL);
    END IF;
  END LOOP;
END; 

Previous
Next Post »