Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) E25519-09 |
|
|
PDF · Mobi · ePub |
A record variable is a composite variable whose internal components, called fields, can have different data types. The value of a record variable and the values of its fields can change.
You reference an entire record variable by its name. You reference a record field with the syntax record.field
.
You can create a record variable in any of these ways:
Define a record type and then declare a variable of that type.
Use %ROWTYPE
to declare a record variable that represents either a full or partial row of a database table or view.
Use %TYPE
to declare a record variable of the same type as a previously declared record variable.
See:
record_variable_declaration ::=
Name of the record type that you are defining.
Name of the field that you are defining.
Data type of the field that you are defining.
Imposes the NOT
NULL
constraint on the field that you are defining. For information about this constraint, see "NOT NULL Constraint".
Expression whose data type is compatible with datatype
. When record_variable_declaration
is elaborated, the value of expression
is assigned to record
.field
. This value is the initial value of the field.
Name of the record variable that you are declaring.
Name of a previously defined record type. record_type
is the data type of record_1
.
See "%ROWTYPE Attribute".
Name of a previously declared record variable.
See "%TYPE Attribute".