Subject Re: [Firebird-Architect] RFC: Proposal for the implementation of Temporary Tables.
Author Ann W. Harrison
At 11:39 AM 11/23/2004, Martijn Tonies wrote:
>According to what I understood, is that there are the
>following types of temp tables:
>Permanent tables, but with temporary data (ON COMMIT PRESERVE/DELETE).
>Local only to the connection - multiple connections can create the same base
>table with the same name. The table gets destroyed upon end of session
>(connection), end of transaction or end of module (eg: SP).

Those types may be interesting, valuable, etc., and we may want to
implement them under another name, but they're not what the SQL
standard describes as global and local temporary tables.

From the SQL-99 spec:

A temporary table is an SQL-session object that cannot be accessed from any
other SQL-session. A
global temporary table can be accessed from any associated SQL-client
module. A local temporary
table can be accessed only from the module to which it is local.

A temporary table is empty when an SQL-session is initiated and it is
emptied (that is, all its rows
are deleted) either when an SQL-transaction is terminated or when an
SQL-session is terminated,
depending on its descriptor.