What is a package?
What is a package?
Rating:
A package provides a method of encapsulating and storing related procedures, functions, and other package constructs together as a unit in the database. While packages provide the database administrator or application developer organizational benefits, they also offer increased functionality and database performance.
A package usually has two parts, a specification and a body stored separately in the database. The specification is the interface to other applications. It declares the types, variables, constants, exceptions, cursors, and subprograms available for use. The package specification may also include PRAGMAs, which are directives to the compiler. The body fully defines cursors and subprograms, and so implements the specification.
A package itself cannot be called, parameterized, or nested. Still, the format of a package is similar to that of a subprogram. Once written and compiled, the contents can be shared by many applications. When a packaged PL/SQL construct is called for the first time, the whole package is loaded into the memory. Consequently, further calls to the constructs in the same package require no disk input/output (I/O).
Rating:
Other articles
- What are data files?
- THE FLASH RECOVERY AREA.
- What is AUDIT_TRAIL ?
- What is DBMS_FGA?
- What is a PFILE?