Contents Index Indexes in the system tables Copying database objects in Sybase Central

ASA SQL User's Guide
  Working with Database Objects

Working with temporary tables


Temporary tables, whether local or global, serve the same purpose: temporary storage of data. The difference between the two, and the advantages of each, however, lies in the duration each table exists.

A local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.

For more information, see DECLARE LOCAL TEMPORARY TABLE statement.

The definition of the global temporary table remains in the database permanently, but the rows exist only within a given connection. When you close the database connection, the data in the global temporary table disappears. However, the table definition remains with the database for you to access when you open your database next time.

Temporary tables are stored in the temporary file. Like any other dbspace, pages from the temporary file can be cached. Operations on temporary tables are never written to the transaction log.

For more information, see CREATE TABLE statement.


Contents Index Indexes in the system tables Copying database objects in Sybase Central