EasyManua.ls Logo

Sybase Adaptive Server Anywhere - CREATE VARIABLE Statement

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9 SQL Statements
481
CREATE VARIABLE statement
Use this statement to create a SQL variable.
CREATE VARIABLE
identifier
data-type
None.
None.
"BEGIN statement" on page 404
"SQL Data Types" on page 263
"DROP VARIABLE statement" on page 513
"SET statement" on page 605
The CREATE VARIABLE statement creates a new variable of the specified
data type. The variable contains the NULL value until it is assigned a
different value by the SET VARIABLE statement.
A variable can be used in a SQL expression anywhere a column name is
allowed. If a column name exists with the same name as the variable, the
variable value is used.
Variables belong to the current connection, and disappear when you
disconnect from the database or when you use the DROP VARIABLE
statement. Variables are not visible to other connections. Variables are not
affected by COMMIT or ROLLBACK statements.
Variables are useful for creating large text or binary objects for INSERT or
UPDATE statements from embedded SQL programs.
Local variables in procedures and triggers are declared within a compound
statement (see "Using compound statements" on page 460 of the book ASA
User’s Guide).
SQL/92 Vendor extension.
Sybase Not supported by Adaptive Server Enterprise.
For an example, see "SET statement" on page 605
Function
Syntax
Permissions
Side effects
See also
Description
Standards and
compatibility
Example

Table of Contents

Related product manuals