Background documentationCREATE DOMAIN Statement (create_domain_statement) Locate this document in the navigation structure

 

The CREATE DOMAIN statement (create_domain_statement) defines a value range.

Structure

Syntax Syntax

  1. <create_domain_statement> ::=
      CREATE DOMAIN <domain_name> <data_type>
        [<default_spec>] [<constraint_definition>]
End of the code.
Examples

SQL Tutorial, Domains

Explanation

The CONSTRAINT definition (constraint_definition) must not contain a constraint name.

The CREATE DOMAIN statement can be executed by all database administrators.

If the domain name is specified without the schema name, the schema with the name of the current database user is assigned to the range. If you specify the domain name with a schema, the schema name must be the same as the name of the current database user. In this case, the current database user becomes the owner of the range.

The name of the domain must be different from all other domain names of the current database user.

If a domain is generated with a CONSTRAINT definition, the domain name is included in the search condition as a column name.