Subject Re: [Firebird-Architect] RFC: Proposal for the implementation of Temporary Tables.
Author Martijn Tonies
> >According to what I understood, is that there are the
> >following types of temp tables:
> >
> >GLOBAL
> >Permanent tables, but with temporary data (ON COMMIT PRESERVE/DELETE).
> >
> >LOCAL
> >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.

Again, it might be me :-) ...

But doesn't this say there's a difference between GLOBAL and
LOCAL?

Here:
>A global temporary table can be accessed from any associated
>SQL-client module.

"SQL-client module": session/connection.

Local:
> A local temporary table can be accessed only from the module to
>which it is local.

"module"


Therefore, permanent temp tables are "global".

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com