Skip Headers
Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)

Part Number E17126-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Record Variable Declaration

A record variable is a composite variable whose internal components, called fields, can be of different data types. The value of a record variable and the values of its fields can change.

You reference an entire record by its name. You reference a record field with the syntax record_name.field_name.

You can create a record variable in any of these ways:

Topics:

Syntax

record_type_definition ::=

record_type_definition
Description of the illustration record_type_definition.gif

field_definition ::=

record_field_declaration
Description of the illustration field_definition.gif

See:

record_variable_declaration ::=

record_type_declaration
Description of the illustration record_variable_declaration.gif

See "rowtype_attribute ::=".

Semantics

record_type_definition

record_type_name

The name of the record type that you are defining.

field_declaration

field_name

The name of the field that you are declaring.

datatype

The data type of the field that you are declaring.

NOT NULL

Imposes the NOT NULL constraint on the field. For information about this constraint, see "NOT NULL Constraint".

expression

An expression whose value has a data type compatible with datatype. When record_variable_declaration is elaborated, the value of expression is assigned to record_name.field_name. This value is the initial value of the field.

record_variable_declaration

record_name_1

The name of the record variable that you are declaring.

record_type_name

The type of the record variable that you are declaring—a previously defined record type.

rowtype_attribute

See "%ROWTYPE Attribute".

record_name_2

The name of a previously declared record variable.

%TYPE

See "%TYPE Attribute".

Examples

Related Topics

In this chapter:

In other chapters: