Rus*_*mIS 2 oracle check-constraints
当我创建包含非空列的表时,Oracle自动创建检查约束为非null:像这样(从user_constraints视图查询)
NAME TYPE SEARCH_CONDITION
------------------------------ ---- ---------------------------------------
SYS_C0036357 C "SUPPLIER_ID" IS NOT NULL
SYS_C0036358 C "SUPPLIER_NAME" IS NOT NULL
Run Code Online (Sandbox Code Playgroud)
那么,有没有办法知道Oracle(Auto)创建的约束或者用户创建的约束.
谢谢.
您可以查看表(或)中的GENERATED字段.user_constraintsall_constraints
create table t (a number not null, constraint t_pk primary key(a));
select table_name, constraint_name, generated
from user_constraints
where table_name = 'T';
Run Code Online (Sandbox Code Playgroud)
得到:
T | CONSTRAINT. | GENERATED
----------------------------
T | SYS_C008425 | GENERATED NAME
T | T_PK | USER NAME
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1230 次 |
| 最近记录: |