Packages: Initialization

Description: Package specifications can be used to initialize variables and define constants.

CREATE OR REPLACE PACKAGE init IS
g_var VARCHAR2(50);
FUNCTION dummy RETURN VARCHAR2;
END init_sect;
/
 
CREATE OR REPLACE PACKAGE BODY init IS
FUNCTION f_test1 RETURN VARCHAR2 IS
BEGIN
  RETURN g_var;
END f_test1;
BEGIN
  SELECT 'Harod Stassen'
  INTO g_var
  FROM dual;
END init;
/

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.