14.59 %ROWTYPE Attribute
The %ROWTYPE
attribute lets you declare a record that represents either a full or partial row of a database table or view.
For every visible column of the full or partial row, the record has a field with the same name and data type. If the structure of the row changes, then the structure of the record changes accordingly. Making an invisible column visible changes the structure of some records declared with the %ROWTYPE
attribute.
The record fields do not inherit the constraints or initial values of the corresponding columns.
The %ROWTYPE
attribute cannot be used if the referenced character column has a collation other than USING_NLS_COMP
.
Topics
Syntax
rowtype_attribute ::=
Semantics
rowtype_attribute
explicit_cursor_name
Name of an explicit cursor. For every column selected by the query associated with explicit_cursor_name
, the record has a field with the same name and data type.
cursor_variable_name
Name of a strong cursor variable. For every column selected by the query associated with cursor_variable_name
, the record has a field with the same name and data type.
db_table_or_view_name
Name of a database table or view that is accessible when the declaration is elaborated. For every column of db_table_or_view_name
, the record has a field with the same name and data type.
Examples
-
Example 6-45, "%ROWTYPE Variable Represents Full Database Table Row"
-
Example 6-46, "%ROWTYPE Variable Does Not Inherit Initial Values or Constraints"
-
Example 6-47, "%ROWTYPE Variable Represents Partial Database Table Row"
-
Example 6-48, "%ROWTYPE Variable Represents Join Row"
-
Example 6-51, "%ROWTYPE Affected by Making Invisible Column Visible"
-
Example 6-54, "Assigning %ROWTYPE Record to RECORD Type Record"
Related Topics
In this chapter:
In other chapters: