本站中文解释
ALL_CONS_COLUMNS视图提供了表约束/索引的信息,该视图仅描述当前用户有权限的表的约束/索引的列组成。
该视图的字段包括: owner: 表的拥有者;table_name: 表的名称;constraint_name: 约束名;column_name: 列的名称;position: 列的顺序号;status: 状态;delete_rule: 当更新或删除表中约束列上的值时,执行的操作。
使用方法:
要查询某表的约束/索引,可以使用以下语句:
SELECT * FROM all_cons_columns
WHERE owner = ‘user_name’
AND table_name = ‘table_name’
AND constraint_name = ‘constraint_name’;
其中,user_name替换为指定表的拥有者,table_name替换为需查询表名,constraint_name替换为查询索引/约束的名称。
官方英文解释
ALL_CONS_COLUMNS
describes columns that are accessible to the current user and that are specified in constraints.
Related Views
-
DBA_CONS_COLUMNS
describes all columns in the database that are specified in constraints. -
USER_CONS_COLUMNS
describes columns that are owned by the current user and that are specified in constraints.
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
|
Owner of the constraint definition |
|
|
|
Name of the constraint definition |
|
|
|
Name of the table with the constraint definition |
|
|
Name of the column or attribute of the object type column specified in the constraint definition Note: If you create a constraint on a user-defined "REF_name"."attribute" |
|
|
|
Original position of the column or attribute in the definition of the object |
See Also:
-
“DBA_CONS_COLUMNS”
-
“USER_CONS_COLUMNS”