Oracle 获取表的主键、外键以及唯一约束条件
时间:2021-07-01 10:21:17
帮助过:8人阅读
a.Owner 主键拥有者,
a.table_name 主键表,
b.Column_Name 主键列,
b.Constraint_Name 主键名
From user_Constraints a,
user_Cons_Columns b
Where
a.Constraint_Type = ‘P‘ --P-主键;R-外键;U-唯一约束
and a.Constraint_Name
= b.Constraint_Name
And a.Owner
= b.Owner
And a.table_name
= b.table_name
and a.owner
=upper(
‘ETL‘)
And a.table_name
=upper(
‘TFUNDINFO‘);
Oracle 获取表的主键、外键以及唯一约束条件
标签:from 获取 nts sele constrain type ble table ext