Creating Packages |
01. What Are PL/SQL Packages?
A package is a schema object that groups logically related PL/SQL types, variables, and subprograms.
Packages usually have two parts:
a. A specification (spec).
b. A body.
02. Write down the Advantages of Using Packages.
Advantages:
a. Modularity.
b. Easier maintenance.
c. Easier application design.
d. Hiding information.
e. Added functionality.
f. Better performance.
g. Overloading.
03. What are the Components of a PL/SQL Package?
Components:
a. Public components are declared in the package specification.
b. Private components are placed in the package body and can be referenced only by other constructs within the same package body.
04. Write down the Guidelines for Writing Packages.
Guidelines:
a. Develop packages for general use.
b. Define the package specification before the body.
c. The package specification should contain only those constructs that you want to be public.
d. Place items in the declaration part of the package body when you must maintain them throughout a session or across transactions.
e. The fine-grain dependency management reduces the need to recompile referencing subprograms when a package specification changes.
f. The package specification should contain as few constructs as possible.
0 Comments