Monday, 22 February 2016

PACKAGE EXAMPLE 1

PACKAGE SPECIFICATION:
Example:
Create or Replace Package MyPack
IS
Procedure P1;
Procedure P2;
End; 

PACKAGE BODY:
Example:
Create or Replace Package Body MyPack
IS
Procedure P1
IS
Begin
Dbms_Output.Put_Line('FIRST PROCEDURE');
End  P1;

Procedure P2
IS
Begin
Dbms_Output.Put_Line('Second Procedure');
End P2;
End; 

EXECUTION IN SQL*PLUS:
exec mypack.p1()
OUTPUT:FIRST PROCEDURE
exec mypack.p2()
OUTPUT:SECOND PROCEDURE

No comments:

Post a Comment

If you Like my blog Spread it and help friends for whom this blog is useful for their career.