Create Package

Description: A sample of the two necessary components of an Oracle package.

CREATE OR REPLACE PACKAGE test_pkg AS
  PROCEDURE add_test (col1_in NUMBER, col2_in CHAR);
  PROCEDURE del_test (col1_in NUMBER);
END test_pkg;
/
 
CREATE OR REPLACE PACKAGE BODY test_pkg AS
 
  PROCEDURE add_test(col1_in IN NUMBER,col2_in IN CHAR) AS
  BEGIN
    INSERT INTO test VALUES (col1_in,col2_in);
  END add_test;
 
  PROCEDURE del_test(col1_in IN NUMBER) AS
  BEGIN
    DELETE FROM test WHERE col1_in = col1;
  END del_test;
 
END test_pkg;
/

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.