Domains

Previous Next

See Also

A domain characterizes the set of data that is valid in a particular column. When you assign a database column to a domain, you determine:

· Which data is valid in this column, and which data will be rejected because it does not match the domain's attributes.

 

· With which other columns this column can (sensibly) be compared - only columns that are defined on the same domain can be compared.

 

· Which joins are possible between this table and other tables - you can only define a join between two tables if the columns involved are defined on the same domain.

Defining domains enables you to make data meaningful to the end-user. It also allows you to standardize input checks on columns.

When developing your system, you will define a number of domain hierarchies, at least one for each RDBMS data type that your application needs. Each domain can have its own default value and its own help text. Even if you do specify them, however, you may overrule them at the column level.

When you define a domain, you can indicate that the domain has a superdomain. The inheritance of domain properties, and which properties a (sub)domain inherits from its superdomain is described in Help topic: "Inheritance of Domain Properties".

If you want the default value to be the current date, or the current date and time, you must specify one of the values:

$$CURRENTDATE$$

or

$$CURRENTDATETIME$$

A new date and time value is fetched from the server each time you refer to one of these functions. A different possibility is to use

$$TRANSACTIONDATE$$

or

$$TRANSACTIONDATETIME$$

In this case, the current date and time are fetched from the server only once within a transaction. If you refer to one of these functions again within the same transaction, an identical date and time value is returned.

If you want the default value to be the user name of the current user, specify:

$$USER$$

You may overrule a domain default value at the column level. That is, when you specify a default value at column level, it overrules the default values of the domain on which it is based.

Related Topics

Display Types

IO Formats

Default Date Format

Inheritance of Domain Properties

Guidelines for Presenting Allowed Values

Generating Unique Values