Isa*_*man 4 oracle referential-integrity truncate
假设我有一个parent由子表引用的父表child。该表parent已填充但未填充child。试图截断parent结果
ORA-02449: unique/primary keys in table referenced by foreign keys
Run Code Online (Sandbox Code Playgroud)
有没有办法向child空的 DBMS 提示,以便不需要禁用外键约束?
ik_*_*elf 12
不,没有这样的提示。你能做的是
alter table {child_table} disable constraint {fk_constraint_name};
truncate table {parent_table};
alter table {child_table} enable constraint {fk_constraint_name};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19961 次 |
| 最近记录: |