1、找到以”FKXXX“为外键的表A的子表,直接运行
select a.constraint_name, a.table_name, b.constraint_name from user_constraints a, user_constraints bwhere a.constraint_type = 'R' and b.constraint_type = 'P' and a.r_constraint_name = b.constraint_nameand a.constraint_name = 'FKXXX'注意:FKXXX 是外键
2、删除相应的子表记录
3、删除主表记录