oracle通过约束名查看表名的方法

oracle通过约束名查看表名的方法 

现在,想知道这个约束名为“PK_ID”的约束,是属于那张表的,后台sql语句可以写为:
select TABLE_NAME from all_constraints where CONSTRAINT_NAME='PK_ID';

select constraint_name,constraint_type,table_name from all_constraints where CONSTRAINT_NAME='PK_ID';
注意:
1.表应为:all_constraints
2.主键约束“PK_ID”必须大写

转自:http://hi.baidu.com/11haiou/item/a30a430952eaa1cfdde5b017

猜你喜欢

转载自lizihong.iteye.com/blog/2204912