Subject Re: ODP: [firebird-support] Query optimization on FB3
Author Helen Borrie
Steve Naidamast wrote:

> However, could you clarify what you mean between a session or a transaction?

Session == connection
I guess you know what a transaction is.

You can define a GTT with a life that lasts as long as the transaction
in which it is instantiated, i.e.,

CREATE GLOBAL TEMPORARY TABLE name
(<column_def> [, {<column_def> | <table_constraint>} ...])
[ON COMMIT {DELETE | PRESERVE} ROWS]

So, ON COMMIT DELETE ROWS empties the GTT instance when the
trasnaction commits (the default), while ON COMMIT PRESERVE ROWS keeps
the data until the session (connection) ends.

For more info, see

https://firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-ddl-tbl.html#fblangref25-ddl-tbl-gtt

Helen


---
This email has been checked for viruses by AVG.
https://www.avg.com