Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E25519-05 |
|
|
PDF · Mobi · ePub |
The assignment statement sets the value of a data item to a valid value.
LNPLS873Topics
LNPLS874assignment_statement ::=
See "expression ::=".
LNPLS875assignment_statement_target ::=
LNPLS876placeholder ::=
LNPLS880assignment_statement_target
Data item to which the value of expression
is to be assigned.
LNPLS890collection_variable
Name of a collection variable.
LNPLS896index
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").
LNPLS909cursor_variable
Name of a cursor variable.
LNPLS920:host_cursor_variable
Name of a cursor variable declared in a PL/SQL host environment and passed to PL/SQL as a bind variable. 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.
LNPLS922object
Name of an instance of an abstract data type (ADT).
LNPLS927attribute
Name of an attribute of object
. Without attribute
, the entire ADT is the assignment statement target.
LNPLS931out_parameter
Name of a formal OUT
or IN
OUT
parameter of the subprogram in which the assignment statement appears.
LNPLS932record_variable
Name of a record variable.
LNPLS933field
Name of a field of record_variable
. Without field
, the entire record variable is the assignment statement target.
LNPLS934scalar_variable
Name of a PL/SQL scalar variable.
LNPLS935placeholder
LNPLS936:host_variable
Name of a variable declared in a PL/SQL host environment and passed to PL/SQL as a bind variable. Do not put space between the colon (:) and host_variable
.
LNPLS937:indicator_variable
Name of an indicator variable declared in a PL/SQL host environment and passed to PL/SQL as a bind variable. (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
LNPLS938expression
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".Example 2-24, "Assigning Values to Variables with Assignment Statement"
Example 5-8, "Data Type Compatibility for Collection Assignment"
LNPLS939In this chapter:
LNPLS940In other chapters: