Home > Database > Mysql Tutorial > oracle中如何判断本表有多少张表对其有外键关联

oracle中如何判断本表有多少张表对其有外键关联

WBOY
Release: 2016-06-07 14:53:18
Original
1046 people have browsed it

在oracle中如何判断本表有多少张表对其有外键关联?我们主要分为两步: 第一步: //查询表的主键约束名 select * from user_constraints e where e.table_name= -----此处输入表名 第二步: //查询所有引用到该主键的记录 select b.table_name,b.column_na

  在oracle中如何判断本表有多少张表对其有外键关联?我们主要分为两步:

  第一步:

//查询表的主键约束名

  select * from user_constraints e where e.table_name=‘’

  -----此处输入表名

  第二步:

//查询所有引用到该主键的记录

  select b.table_name,b.column_name from user_constraints a

  inner join user_cons_columns b

  on a.constraint_name = b.constraint_name

  where a.r_constraint_name=‘’

  -----此处输入刚才查询出来的表主键的约束名

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template