Prev | Current Page 81 | Next

Richard Niemiec

"Oracle Database 10g Performance Tuning Tips & Techniques"

A procedure, on the other hand, does not
return a value, only a status code. However, procedures may have one or many variables that
can be set and returned as part of the argument list to the procedure.
Chapter 1: Getting Started with the Oracle Architecture 23
Procedures and functions have many advantages in a database environment. Procedures are
compiled and stored in the data dictionary once; when more than one user needs to call the
procedure, it is already compiled, and only one copy of the stored procedure exists in the shared
pool. In addition, network traffic is reduced, even if the procedural features of PL/SQL are not
used. One PL/SQL call uses up much less network bandwidth than several SQL select and insert
statements sent separately over the network, not to mention the reparsing that occurs for each
statement sent over the network.
Packages
PL/SQL packages group together related functions and procedures, along with common variables
and cursors. Packages consist of two parts: a package specification and a package body. In the
package specification, the methods and attributes of the package are exposed; the implementation
of the methods along with any private methods and attributes are hidden in the package body.
Using a package instead of a standalone procedure or function allows the embedded procedure
or function to be changed without invalidating any objects that refer to elements of the package
specification, thus avoiding recompilation of the objects that reference the package.


Pages:
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
wyciągarki wróżby miłosne cukiernia-stykowscy.pl salon kosmetyczny kraków pompy ciepła