查询一个表的主键名称
select *
from dba_constraints t
where t.table_name =upper('dl_cjhb')
and t.constraint_type='P'
查询表的主键对应的字段列表
select tt.column_name
from dba_constraints t, dba_ind_columns tt
where t.table_name =upper('dl_cjhb')
and tt.table_name=t.table_name
and t.constraint_type='P'
and t.index_name = tt.index_name
dba_cons_columns
OWNER CONSTRAINT_NAME CONSTRAINT_TYPE TABLE_NAME SEARCH_CONDITION R_OWNER R_CONSTRAINT_NAME DELETE_RULE STATUS DEFERRABLE DEFERRED VALIDATED GENERATED BAD RELY LAST_CHANGE INDEX_OWNER INDEX_NAME INVALID VIEW_RELATED
------------------------------ ------------------------------ --------------- ------------------------------ -------------------------------------------------------------------------------- ------------------------------ ------------------------------ ----------- -------- -------------- --------- ------------- -------------- --- ---- ----------- ------------------------------ ------------------------------ ------- --------------