SET ECHO ON SET SERVEROUTPUT ON -- -- plsql13.txt -- -- Simple PL/SQL demo -- This file shows how to create a PL/SQL object called a package -- and then use that package. -- A package typically is broken up into several sections. -- The first section is called the package specification. -- The next section is called the package body. -- Inside the package body resides a series of procedures. -- So, a procedure may reside inside a package or it may be standalone. CREATE OR REPLACE PACKAGE plsql13 AS -- This is the package specification PROCEDURE plsql13A (aNumber IN INTEGER, aName IN VARCHAR2); PROCEDURE plsql13B (aNumber IN INTEGER, aName IN VARCHAR2); END plsql13; / -- End of package specification -- Look for any errors which may have ocurred SHOW ERRORS CREATE OR REPLACE PACKAGE BODY plsql13 AS -- This is the package body PROCEDURE plsql13A (aNumber IN INTEGER, aName IN VARCHAR2) IS myNumber INTEGER; BEGIN myNumber := aNumber; dbms_output.put_line('aNumber is ... '||myNumber); END plsql13A; PROCEDURE plsql13B (aNumber IN INTEGER, aName IN VARCHAR2) IS myName VARCHAR2(11); BEGIN myName := aName; dbms_output.put_line('aName is ... '||myName); END plsql13B; END plsql13; / -- Look for any errors which may have ocurred SHOW ERRORS -- Exercise procedures in the package EXEC plsql13.plsql13A(11,'hello') EXEC plsql13.plsql13B(12,'Fred') -- End of demo