Implicit Cursor in PL/SQL

CL SCR : TO CLEAR THE SCREEN

***********************************************
SQL>  DECLARE
  2  VENO EMP.EMPNO%TYPE;
  3  BEGIN
  4  VENO:=&EMPNO;
  5  DELETE FROM EMP WHERE EMPNO=VENO;
  6  END;
  7  /
Enter value for empno: 7900
old   4: VENO:=&EMPNO;
new   4: VENO:=7900;

PL/SQL procedure successfully completed.

**********************************************
 DECLARE
 VENO EMP.EMPNO%TYPE;
 BEGIN
 VENO:=&EMPNO;
 DELETE FROM EMP WHERE EMPNO=VENO;
 if SQL%found THEN
     dbms_output.put_line('Record Deleted');
 else
     dbms_output.put_line('No such Employee');
END if;
COMMIT;
END;
**********************************************
Previous
Next Post »