CREATE DOMAIN name [AS] <datatype>
[DEFAULT {<literal> | NULL | <context_var>}]
[NOT NULL] [CHECK (<dom_condition>)]
[COLLATE collation_name];
<datatype> ::=
<scalar_datatype> | <blob_datatype> | <array_datatype>
<scalar_datatype> ::= См. Синтаксис скалярных типов данных
<blob_datatype> ::= См. Синтаксис типа данных BLOB
<array_datatype> ::= См. Синтаксис массивов
<dom_condition> ::=
<val> <operator> <val>
| <val> [NOT] BETWEEN <val> AND <val>
| <val> [NOT] IN (<val> [, <val> ...] | <select_list>)
| <val> IS [NOT] NULL
| <val> IS [NOT] DISTINCT <val>
| <val> IS [NOT] {TRUE | FALSE | UNKNOWN}
| <val> [NOT] CONTAINING <val>
| <val> [NOT] STARTING [WITH] <val>
| <val> [NOT] LIKE <val> [ESCAPE <val>]
| <val> [NOT] SIMILAR TO <val> [ESCAPE <val>]
| <val> <operator> {ALL | SOME | ANY} (<select_list>)
| [NOT] EXISTS (<select_expr>)
| [NOT] SINGULAR (<select_expr>)
| (<dom_condition>)
| NOT <dom_condition>
| <dom_condition> OR <dom_condition>
| <dom_condition> AND <dom_condition>
<operator> ::=
<> | != | ^= | ~= | = | < | > | <= | >=
| !< | ^< | ~< | !> | ^> | ~>
<val> ::= {
VALUE
| <literal>
| <context_var>
| <expression>
| NULL
| NEXT VALUE FOR genname
| GEN_ID(genname, <val>)
| CAST(<val> AS <cast_type>)
| (<select_one>)
| func(<val> [, <val> ...])
}
<cast_type> ::=
<datatype>
| [TYPE OF] domain
| TYPE OF COLUMN rel.col