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
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.