成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

CREATE DOMAIN 中文man頁面

系統(tǒng)
CREATE DOMAIN 創(chuàng)建一個新的數(shù)據(jù)域。 定義域的用戶成為其所有者。

NAME

CREATE DOMAIN - 定義一個新域  

SYNOPSIS

CREATE DOMAIN name [AS] data_type
    [ DEFAULT expression ]
    [ constraint [ ... ] ]

where constraint is:

[ CONSTRAINT constraint_name ]
{ NOT NULL | NULL | CHECK (expression) }

DESCRIPTION 描述

CREATE DOMAIN 創(chuàng)建一個新的數(shù)據(jù)域。 定義域的用戶成為其所有者。


 如果給出一個模式名稱(比如,CREATE DOMAIN myschema.mydomain ...), 那么該域是在指定的模式中創(chuàng)建的。否則它會在當前模式中創(chuàng)建。 域名字必需在其所在模式中的現(xiàn)有類型和域中***。


 域可以便于我們把不同表之間的公共域抽取到一個位置進行維護。 比如,一個電子郵件地址字段可能在多個表中使用,所有的都是同樣的屬性。 我們可以定義并使用一個域,而不是分別設置每個表的約束。  

PARAMETERS 參數(shù)

name

 要創(chuàng)建的域名字(可以有模式修飾)。
data_type

 域的下層數(shù)據(jù)類型。它可以包含數(shù)組聲明字。
DEFAULT expression
DEFAULT 子句為域數(shù)據(jù)類型的字段聲明一個缺省值。 該值是任何不含變量的表達式(但不允許子查詢)。 缺省表達式的數(shù)據(jù)類型必需匹配域的數(shù)據(jù)類型。如果沒有聲明缺省值, 那么缺省值就是空值。


 缺省表達式將用在任何不為該字段聲明數(shù)值的插入操作。 如果為特定的字段聲明了缺省值,那么它覆蓋任何和該域相關聯(lián)的缺省值。 然后,域的缺省覆蓋任何與下層數(shù)據(jù)類型相關的缺省。

CONSTRAINT constraint_name

 一個約束的可選名稱。如果沒有聲明,系統(tǒng)生成一個名字。
NOT NULL

 這個域的數(shù)值不允許為 NULL。
NULL

 這個域的數(shù)值允許為空。它是缺省。
 
 這個子句只是用于和非標準的 SQL 數(shù)據(jù)庫兼容用。 我們不建議在新的應用中使用它。
CHECK (expression)

 CHECK 子句聲明完整性約束或者是測試,域地數(shù)值必須滿足這些要求。 每個約束必須是一個生成一個布爾結(jié)果的表達式。它應該使用名字 VALUE  來引用被測試的數(shù)值。


 目前,CHECK 表達式不能包含子查詢,也不能引用除 VALUE 之外的變量。

EXAMPLES 例子


 這個例子創(chuàng)建了 country_code 數(shù)據(jù)類型并且在一個表定義中使用了該類型:

CREATE DOMAIN country_code char(2) NOT NULL;
CREATE TABLE countrylist (id integer, country country_code);

COMPATIBILITY 兼容性

CREATE DOMAIN 命令符合 SQL 標準。  

SEE ALSO 參見

DROP DOMAIN [drop_domain(7)]  

#p#

NAME

CREATE DOMAIN - define a new domain

SYNOPSIS

CREATE DOMAIN name [AS] data_type
    [ DEFAULT expression ]
    [ constraint [ ... ] ]

where constraint is:

[ CONSTRAINT constraint_name ]
{ NOT NULL | NULL | CHECK (expression) }

DESCRIPTION

CREATE DOMAIN creates a new data domain. The user who defines a domain becomes its owner.

If a schema name is given (for example, CREATE DOMAIN myschema.mydomain ...) then the domain is created in the specified schema. Otherwise it is created in the current schema. The domain name must be unique among the types and domains existing in its schema.

Domains are useful for abstracting common fields between tables into a single location for maintenance. For example, an email address column may be used in several tables, all with the same properties. Define a domain and use that rather than setting up each table's constraints individually.  

PARAMETERS

name
The name (optionally schema-qualified) of a domain to be created.
data_type
The underlying data type of the domain. This may include array specifiers.
DEFAULT expression
The DEFAULT clause specifies a default value for columns of the domain data type. The value is any variable-free expression (but subqueries are not allowed). The data type of the default expression must match the data type of the domain. If no default value is specified, then the default value is the null value.

The default expression will be used in any insert operation that does not specify a value for the column. If a default value is defined for a particular column, it overrides any default associated with the domain. In turn, the domain default overrides any default value associated with the underlying data type.

CONSTRAINT constraint_name
An optional name for a constraint. If not specified, the system generates a name.
NOT NULL
Values of this domain are not allowed to be null.
NULL
Values of this domain are allowed to be null. This is the default.

This clause is only intended for compatibility with nonstandard SQL databases. Its use is discouraged in new applications.

CHECK (expression)
CHECK clauses specify integrity constraints or tests which values of the domain must satisfy. Each constraint must be an expression producing a Boolean result. It should use the name VALUE to refer to the value being tested.

Currently, CHECK expressions cannot contain subqueries nor refer to variables other than VALUE.

EXAMPLES

This example creates the country_code data type and then uses the type in a table definition:

CREATE DOMAIN country_code char(2) NOT NULL;
CREATE TABLE countrylist (id integer, country country_code);

COMPATIBILITY

The command CREATE DOMAIN conforms to the SQL standard.  

SEE ALSO

DROP DOMAIN [drop_domain(7)]

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-24 14:19:14

DROP DOMAIN中文man

2011-08-24 09:22:30

alter_domai中文man

2011-08-24 10:46:36

CREATE AGGR中文man

2011-08-24 10:56:32

CREATE CONV中文man

2011-08-24 11:15:24

CREATE INDE中文man

2011-08-24 13:29:20

CREATE TABL中文man

2011-08-24 13:36:25

CREATE TRIG中文man

2011-08-24 13:43:09

CREATE USER中文man

2011-08-24 13:46:39

CREATE VIEW中文man

2011-08-24 13:32:56

CREATE TABL中文man

2011-08-24 10:59:19

CREATE DATA中文man

2011-08-24 11:05:36

CREATE FUNC中文man

2011-08-24 11:10:17

CREATE GROU中文man

2011-08-24 11:18:53

CREATE LANG中文man

2011-08-24 11:23:20

CREATE OPER中文man

2011-08-24 11:31:47

CREATE RULE中文man

2011-08-24 13:23:10

CREATE SCHE中文man

2011-08-24 13:26:19

CREATE SEQU中文man

2011-08-24 13:39:44

CREATE TYPE中文man

2011-08-24 10:53:20

CREATE CONS中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 亚洲在线| 黄色在线播放视频 | 高清色视频 | 免费毛片网站 | 午夜在线影院 | 午夜欧美一区二区三区在线播放 | 国产成人精品一区二区三区在线 | av激情在线 | 欧美午夜精品久久久久久浪潮 | 一二三区av | 久久99精品久久久久久青青日本 | 成人毛片视频免费 | 日韩视频免费看 | 综合二区 | 偷派自拍 | 国内精品成人 | 日韩在线观看中文字幕 | 久久久久久国产精品免费免费狐狸 | 国产99免费视频 | 精品国产一区二区三区久久狼黑人 | www.日韩| 99亚洲精品 | 欧美日韩福利 | 老外黄色一级片 | 国产免国产免费 | 在线观看中文字幕dvd播放 | 嫩草国产 | www.日韩在线 | 成人精品一区 | 中文字幕在线观看一区二区 | 免费亚洲视频 | 久久久久久久91 | 国产高清一区二区三区 | 国产成人午夜高潮毛片 | 人人干视频在线 | 91视视频在线观看入口直接观看 | 亚洲欧美一区在线 | 一区二区久久 | 亚欧精品 | 九九国产在线观看 | 999热在线视频 |