|
|
|
A record is much
like a row in a relational database table, composed of one or more individual
fields, or columns. The structure of
the record’s type can be explicitly defined by the programmer, or implicitly
defined by the %ROWTYPE attribute.
%ROWTYPE abstracts the details of the underlying object. As columns are added, deleted and
modified, your code doesn’t have to change as often. Records allow you to assign, access, refer
to and pass entire rows and tables as a single unit, as opposed to scores of
individual variables or parameters.
|
|
We choose PL/SQL
when we need to 1) batch up multiple SQL operations, or 2) improve speed by
performing logic within the database, rather than moving the data over the
network. Since both goals involve
operations on rows of data that is/will be stored in relational tables, you
should be using records most of the time!
This is a common best practice in PL/SQL circles. Leaning heavily on records leaves your
code simpler, cleaner, easier to read and maintain, and more robust.
|
|
Open first code
link. Cover it. Point out definitions and declarations.
|
|
|
|
|