|Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)
Part Number E17126-03
%TYPE attribute lets you declare a constant, variable, collection element, record field, or subprogram parameter to be of the same data type as a previously declared variable or column (without knowing what that type is). The item declared with
%TYPE is the referencing item, and the previously declared item is the referenced item.
The referencing item inherits the following from the referenced item:
Data type and size
Constraints (unless the referenced item is a column)
The referencing item does not inherit the initial value of the referenced item.
If the declaration of the referenced item changes, then the declaration of the referencing item changes accordingly.
The name of a collection variable.
Restriction on collection_variable_name In a constant declaration, it cannot be the name of an associative array variable.
The name of a cursor variable. Only the value of another cursor variable can be assigned to a cursor variable.
The name of a database table or view that is accessible when the declaration is elaborated.
The name of a column of the specified database table or view.
The name of an instance of an ADT.
The name of a record variable.
The name of a field of the specified record variable.
The name of a scalar variable.
In this chapter:
In other chapters: