Delete employee with stored procedure : Delete Data « PL SQL « Oracle PL / SQL






Delete employee with stored procedure

   
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.

   
    
    
  








Related examples in the same category

1.DELETE statement can be used within PL/SQL programs to delete a row or a set of rows
2.DELETE statement in PL/SQL block
3.Delete data statement with WHERE clauses.
4.Delete statement with variable
5.Delete a row and output referenced value
6.Create dynamic delete from command
7.Use procedure to delete departments