Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E17126-08 |
|
|
PDF · Mobi · ePub |
The assignment statement sets the value of a data item to a valid value.
See "expression ::=".
assignment_statement_target ::=
Data item to which the value of expression
is to be assigned.
Name of a collection variable.
Index of an element of collection_variable
. Without index
, the entire collection variable is the assignment statement target.
index
must be a numeric expression whose data type either is PLS_INTEGER
or can be implicitly converted to PLS_INTEGER
(for information about the latter, see "Predefined PLS_INTEGER Subtypes").
Name of a cursor variable.
Name of a cursor variable declared in a PL/SQL host environment and passed to PL/SQL as a bind argument. Do not put space between the colon (:) and host_cursor_variable
.
The data type of a host cursor variable is compatible with the return type of any PL/SQL cursor variable.
Name of an instance of an abstract data type (ADT).
Name of an attribute of object
. Without attribute
, the entire ADT is the assignment statement target.
Name of a formal OUT
or IN
OUT
parameter of the subprogram in which the assignment statement appears.
Name of a record variable.
Name of a field of record_variable
. Without field
, the entire record variable is the assignment statement target.
Name of a PL/SQL scalar variable.
Name of a variable declared in a PL/SQL host environment and passed to PL/SQL as a bind argument. Do not put space between the colon (:) and host_variable
.
Name of an indicator variable declared in a PL/SQL host environment and passed to PL/SQL as a bind argument. (An indicator variable indicates the value or condition of its associated host variable. For example, in the Oracle Precompiler environment, an indicator variable can a detect null or truncated value in an output host variable.) Do not put space between host_variable
and the colon (:) or between the colon and indicator_variable
. This is correct:
:host_variable:indicator_variable
Expression whose value is to be assigned to assignment_statement_target
.
expression
and assignment_statement_target
must have compatible data types.
Note:
Collections with elements of the same type might not have the same data type. For the syntax of collection type definitions, see "Collection Variable Declaration".