Skip Headers
Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)

Part Number E10472-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Variable

A variable holds a value that can change.

A variable declaration specifies the name, data type, and value of the variable and allocates storage for it. The declaration can also assign an initial value and impose the NOT NULL constraint.

Topics:

Syntax

variable_declaration ::=

variable_declaration
Description of the illustration variable_declaration.gif

See:

Semantics

expression

The value to be assigned to the variable when the declaration is elaborated. The value of expression must be of a data type that is compatible with the data type of the variable (see Table 3-10, "Possible Implicit PL/SQL Data Type Conversions").

datatype

The data type of the variable that you are declaring.

Restriction on datatype If you use %ROWTYPE to declare a record variable, you cannot use the assignment operator (:=) or the keyword DEFAULT to assign its initial value. For information about %ROWTYPE, see "%ROWTYPE Attribute". For information about assigning values to records, see "Assignments to Records".

variable_name

The name of the variable that you are declaring.

Examples

Related Topics

In this chapter:

In other chapters: