Oracle 视图 ALL_CONS_OBJ_COLUMNS 官方解释,作用,如何使用详细说明

本站中文解释

ALL_CONS_OBJ_COLUMNS是Oracle中用于查询用户定义的所有约束的对象,包括字段的视图。它提供有关连接字段和对象信息,其中在一个约束中涉及的表和列。 可以使用这一视图来获取用户定义表中列的约束类型,例如UNIQUE,PRIMARY KEY,FOREIGN KEY等。

使用方法:

SELECT OWNER,TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME
FROM ALL_CONS_OBJ_COLUMNS
WHERE OWNER= :owner_name
AND TABLE_NAME= :table_name;

上述查询可以用来检索指定Schema的指定表的所有列的约束和列名。

官方英文解释

ALL_CONS_OBJ_COLUMNS displays information about the types that object columns (or attributes) or collection elements have been constrained to, in the tables accessible to the current user.

Related Views

  • DBA_CONS_OBJ_COLUMNS displays information about the types that object columns (or attributes) or collection elements have been constrained to, in all tables in the database.

  • USER_CONS_OBJ_COLUMNS displays information about the types that object columns (or attributes) or collection elements have been constrained to, in the tables owned by the current user. This view does not display the OWNER column.

Column Datatype NULL Description

OWNER

VARCHAR2(128)

Owner of the table

TABLE_NAME

VARCHAR2(128)

Name of the table containing the object column or attribute

COLUMN_NAME

VARCHAR2(4000)

Fully qualified name of the object column or attribute

CONS_TYPE_OWNER

VARCHAR2(128)

Owner of the type that the column (or element) is constrained to

CONS_TYPE_NAME

VARCHAR2(128)

Name of the type that the column (or element) is constrained to

CONS_TYPE_ONLY

VARCHAR2(15)

Indicates whether the column (or element) is constrained to ONLY type (Y) or not (N)

See Also:

  • “DBA_CONS_OBJ_COLUMNS”

  • “USER_CONS_OBJ_COLUMNS”


数据运维技术 » Oracle 视图 ALL_CONS_OBJ_COLUMNS 官方解释,作用,如何使用详细说明