%ROWTYPE Attribute

The %ROWTYPE attribute lets you declare a record that represents a row in a table or view. For each column in the referenced table or view, the record has a field with the same name and data type. To reference a field in the record, use record_name.field_name. The record fields do not inherit the constraints or default values of the corresponding columns.

If the referenced item table or view changes, your declaration is automatically updated. You need not change your code when, for example, columns are added or dropped from the table or view.

Syntax

%rowtype_attribute ::=

rowtype_attribute
Description of the illustration rowtype_attribute.gif

Keyword and Parameter Descriptions

cursor_name

An explicit cursor previously declared within the current scope.

cursor_variable_name

A PL/SQL strongly typed cursor variable, previously declared within the current scope.

table_name

A database table or view that must be accessible when the declaration is elaborated.

Examples

Related Topics