Search code examples
globalfirebirdtemp-tablesglobal-temp-tables

Firebird global temporary table (GTT), touch other tables?


I have a Firebird database (v. 2.5), I'm not allowed to create procedures, views or tables into the database, because of losing support.

My view is too long:

Too many Contexts of Relation/Procedure/Views. Maximum allowed is 255

I think I can solve this Problem by creating GTT, right?

My question is, this GTT will be stored in the Database? When is the GTT deleted? I tried in a copy of my database and created a GTT, after that I closed my connection and reconnected and the GTT was there already. Does my GTT belong to the main tables in the database?


Solution

  • The definition of a global temporary table is persistent (that is why it is called global and not, for example, local). The data in a global temporary table is only visible to the transaction that populated it (on commit delete rows), or to the connection that populated it (on commit preserve rows). When the transaction ends or the connection is closed, the data is deleted

    So once created the definition of the global temporary table will exist in the database until it is dropped.

    Whether or not that violates your agreement with your software vendor, I can't say. You'll need to ask them.