Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Function Procedure Packages
 

Creating a Package Specification

You create a package specification using the CREATE PACKAGE statement. The simplified syntax for the CREATE PACKAGE statement is as follows: CREATE [OR REPLACE] PACKAGE package_name {IS | AS}   package_specification END package_name; package_specification specifies the list of procedures and functions (along with any variables, type definitions, and cursors) that are available to your package's users. SQL> SQL> CREATE OR REPLACE PACKAGE employee_package AS   2    TYPE t_ref_cursor IS REF CURSOR;   3    FUNCTION get_employee_ref_cursor RETURN t_ref_cursor;   4    PROCEDURE update_salary (   5      p_id IN VARCHAR2,   6      p_factor IN NUMBER   7    );   8  END employee_package;   9  / Package created. SQL>