Subject Re: [firebird-support] Firebird Temporary Table
Author Mark Rotteveel
On 31-10-2015 01:43, Aris Mardi arismrd2005@... [firebird-support]
wrote:
> Thank you for your response.
> Concerning temporary table. Is it possible to put both ddl temporary
> table creation and temporary table selection on a single stored
> procedure ? Regarding the ddl creation need to be committed first and it
> doesnt allow commit command on stored procedure (correct me if im wrong).

No, you can't do DDL in stored procedures (unhandy workarounds with
execute statement aside). Global temporary tables are not local
temporary tables (like in SQL Server T-SQL). The idea is that you create
the global temporary table once, and then its structure can used
repeatedly by different connections/transactions (eg in the stored
procedure, etc). The structure of the GTT is persistent, but data is
only visible to the transaction or connection that created that data.

Rethink your solution so that you create the GGT once, and reuse it.

Mark
--
Mark Rotteveel