Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateDDL statements → CREATE VIEW
Firebird Home Firebird Home Prev: CREATE TRIGGERFirebird Documentation IndexUp: DDL statementsNext: CREATE OR ALTER EXCEPTION

CREATE VIEW

Full SELECT syntax supported
PLAN subclause disallowed in 1.5
Triggers on updatable views block auto-writethrough

Available in: DSQL, ESQL

Full SELECT syntax supported

Changed in: 2.0

Description: From Firebird 2.0 onward view definitions are considered full-fledged SELECT statements. Consequently, the following elements are (re)allowed in view definitions: FIRST, SKIP, ROWS, ORDER BY, PLAN and UNION.

PLAN subclause disallowed in 1.5

Changed in: 1.5, 2.0

Description: Firebird versions 1.5.x forbid the use of a PLAN subclause in a view definition. From 2.0 onward a PLAN is allowed again.

Triggers on updatable views block auto-writethrough

Changed in: 2.0

Description: In versions prior to 2.0, Firebird often did not block the automatic writethrough to the underlying table if one or more triggers were defined on a naturally updatable view. This could cause mutations to be performed twice unintentionally, sometimes leading to data corruption and other mishaps. Starting at Firebird 2.0, this misbehaviour has been corrected: now if you define a trigger on a naturally updatable view, no mutations to the view will be automatically passed on to the table; either the trigger takes care of that, or nothing will. This is in accordance with the description in the InterBase 6 Data Definition Guide under Updating views with triggers.

Warning

Some people have developed code that takes advantage of the previous behaviour. Such code should be corrected for Firebird 2.0 and higher, or mutations may not reach the table at all.

Prev: CREATE TRIGGERFirebird Documentation IndexUp: DDL statementsNext: CREATE OR ALTER EXCEPTION
Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateDDL statements → CREATE VIEW