Delete employee with stored procedure : Delete « PL SQL Programming « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL>
SQL>
SQL> CREATE TABLE emp
  2     (id         VARCHAR2(10) NOT NULL,
  3      course     VARCHAR2(10),
  4      year       VARCHAR2(4),
  5      PRIMARY KEY (id));

Table created.

SQL>
SQL> CREATE OR REPLACE PROCEDURE Delete_emp(delete_id emp.id%TYPE) AS
  2
  3  BEGIN
  4     DELETE FROM emp
  5     WHERE id = delete_id;
  6  END Delete_emp;
  7  /

Procedure created.

SQL> drop table emp;

Table dropped.








24.9.Delete
24.9.1.Delete table data in PL/SQL
24.9.2.How DELETEs work with PL/SQL
24.9.3.DELETE statement with variable
24.9.4.Delete rows using PL/SQL literals and variables
24.9.5.Delete employee with stored procedure