DECLARE LOCAL TEMPORARY TABLE
statement
Function
Syntax
Permissions
Side effects
See also
Description
Standards and
compatibility
Examples
Use this statement to declare a local temporary table.
DECLARE LOCAL TEMPORARY TABLE table-name
... ( { column-definition [ column-constraint ... ] | table-constraint }, ... )
... [ ON COMMIT { DELETE | PRESERVE } ROWS ]
None.
None.
"CREATE TABLE statement" on page 466
"Using compound statements" on page 460 of the book ASA User's Guide
The DECLARE LOCAL TEMPORARY TABLE statement declares a
temporary table. For definitions of column-definition, column-constraint, and
table-constraint, see "CREATE TABLE statement" on page 466.
Declared local temporary tables within compound statements exist within the
compound statement. (See "Using compound statements" on page 460 of the
book ASA User's Guide). Otherwise, the declared local temporary table
exists until the end of the connection.
By default, the rows of a temporary table are deleted on COMMIT.
♦
Conforms to the SQL/92 standard.
SQL/92
♦
Adaptive Server Enterprise does not support DECLARE
Sybase
TEMPORARY TABLE.
♦
The following example illustrates how to declare a temporary table in
Embedded SQL:
EXEC SQL DECLARE LOCAL TEMPORARY TABLE MyTable (
number INT
);
♦
The following example illustrates how to declare a temporary table in a
stored procedure:
BEGIN
DECLARE LOCAL TEMPORARY TABLE TempTab (
number INT
);
...
END
Chapter 9 SQL Statements
495
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers