--Check the foreign key table Nc56.csci there is no corresponding primary key table SELECT A.owner, a.table_name primary_table_name, a.constraint_name Primary_table_key_name, B.owner, b.table_name foreign_table_name, b.constraint_name foreign_ Table_foreign_key_name, b.status foreign_table_foreign_key_stat from dba_constraints A, DBA_ CONSTRAINTS B WHERE a.constraint_name = b.r_constraint_name and b.constraint_type = ' R ' and b.table_ NAME = ' CSCI ' and a.owner= ' NC56 ' and b.owner= ' NC56 ' ORDER by 1, 2, 3, 4;
--Check the primary key table NC56.CBH there is no corresponding foreign key table SELECT A.owner, a.table_name primary_table_name, a.constraint_name Primary_table_key_name, B.owner, b.table_name foreign_table, b.constraint_name foreign_table_ Foreign_key_name, b.status foreign_table_foreign_key_stat from dba_constraints A, dba_constraints B WHERE a.constraint_name = b.r_constraint_name and b.constraint_type = ' R ' and a.table_name = ' CBH ' and A. Owner= ' NC56 ' and b.owner= ' NC56 ' ORDER by 1, 2, 3, 4;
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
In an Oracle database, you know a table that queries a table with its primary foreign key relationship