//主键 select owner,constraint_name,table_name from user_constraints where owner='用户名' and constraint_type='P' and table_name='表名';//外键 select owner,constraint_name,table_name from user_constraints where owner='用户名' and constraint_type='R' and table_name='表名';
http://community.csdn.net/Expert/topic/3337/3337947.xml?temp=.13435从那个表中可以取出某表的主键字段,外键及相关联的表名等之类的信息?
http://community.csdn.net/Expert/topic/3594/3594991.xml?temp=.9193994
select owner,constraint_name,table_name from user_constraints where owner='用户名' and constraint_type='P' and table_name='表名';//外键
select owner,constraint_name,table_name from user_constraints where owner='用户名' and constraint_type='R' and table_name='表名';