Package is a collection of sub-programs that means function or procedure. Package contains two sections, which are given below;
- Package specification
- Package body or definition
create package package_name AS procedure procedure_name(parameter); end package_name;
- Package specification and package body should starts with create statements and ends with end statements.
- Package specification name and package body name both are same.
- Without package specification you can not write package body.
Advance of package inPL/SQL
- You can create package to store all related functions and procedures are grouped together into single unit called packages.
- Package are reliable to granting a privileges.
- All function and procedure within a package can share variable among them.
- Package are support overloading to overload functions and procedures.
- Package are improve the performance to loading the multiple object into memory at once, therefore, subsequent calls to related program doesn't required to calling physically I/O.
- Package are reduce the traffic because all block execute all at once.
Package specification and package body should starts with create statements and ends with end statement
Package specification name and package body name both are same, without package specification you can not write package body.
drop package package_name;