21.10.2013 Views

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Better alternative: DROP SEQUENCE<br />

DDL statements<br />

Description: Removes a generator or sequence from the database. Its (very small) storage space will be freed<br />

for re-use after a backup-restore cycle.<br />

Syntax:<br />

DROP GENERATOR generator-name<br />

From <strong>Firebird</strong> 2.0 onward, the SQL-compliant DROP SEQUENCE syntax is preferred.<br />

CREATE TABLE<br />

Available in: DSQL, ESQL<br />

Global Temporary Tables (GTTs)<br />

Added in: <strong>2.1</strong><br />

TABLE<br />

Description: Global temporary tables have persistent metadata, but their contents are transaction-bound (the<br />

default) or connection-bound. Every transaction or connection has its own private instance of a GTT, isolated<br />

from all the others. Instances are only created if and when the GTT is referenced, and destroyed upon transaction<br />

end or disconnection. To modify or remove a GTT's metadata, ALTER TABLE and DROP TABLE can be used.<br />

Syntax:<br />

CREATE GLOBAL TEMPORARY TABLE name<br />

(column_def [, column_def | table_constraint ...])<br />

[ON COMMIT {DELETE | PRESERVE} ROWS]<br />

• ON COMMIT DELETE ROWS creates a transaction-level GTT (the default), ON COMMIT PRE-<br />

SERVE ROWS a connection-level GTT.<br />

• An EXTERNAL [FILE] clause is not allowed on a global temporary table.<br />

Restrictions: GTTs can be “dressed up” with all the features and paraphernalia of ordinary tables (keys, references,<br />

indices, triggers...) but there are a few restrictions:<br />

• GTTs and regular tables cannot reference one another.<br />

• A connection-bound (“PRESERVE ROWS”) GTT cannot reference a transaction-bound (“DELETE ROWS”)<br />

GTT.<br />

• Domain constraints cannot reference any GTT.<br />

• The destruction of a GTT instance at the end of its life cycle does not cause any before/after delete triggers<br />

to fire.<br />

37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!