Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateDDL statements → DOMAIN
Firebird Home Firebird Home Prev: DATABASEFirebird Documentation IndexUp: DDL statementsNext: EXCEPTION

DOMAIN

Table of Contents

CREATE DOMAIN
ALTER DOMAIN

CREATE DOMAIN

Table of Contents

Context variables as defaults

Available in: DSQL, ESQL

Context variables as defaults

Changed in: IB

Description: Any context variable that is assignment-compatible to the new domain's data type can be used as a default. This was already the case in InterBase 6, but the Language Reference only mentioned USER.

Example: 

create domain DDate as
  date
  default current_date
  not null

ALTER DOMAIN

Available in: DSQL, ESQL

Warning

If a domain's definition is changed, existing PSQL code using that domain may become invalid. For information on how to detect this, please read the note The RDB$VALID_BLR field, near the end of this document.

Rename domain

Added in: IB

Description: Renaming of a domain is possible with the TO clause. This feature was introduced in InterBase 6, but left out of the Language Reference.

Example: 

alter domain posint to plusint
  • The TO clause can be combined with other clauses and need not come first in that case.

SET DEFAULT to any context variable

Changed in: IB

Description: Any context variable that is assignment-compatible to the domain's data type can be used as a default. This was already the case in InterBase 6, but the Language Reference only mentioned USER.

Example: 

alter domain DDate
  set default current_date
Prev: DATABASEFirebird Documentation IndexUp: DDL statementsNext: EXCEPTION
Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateDDL statements → DOMAIN