我正在处理一项要求.
I am working on a requirement.
有一个表.我想从该表中删除一行,但是我不能删除它,因为
There is one table.I want to delete a row from this table but i cannot delete it because
1.该表由79表通过外键关系引用 2.这79个表中的每个表都由其他100个表
1.This table is referred by 79 table through foreign key relationship 2.Each of those 79 tables are referred by other 100's of table
所以您可以想象它的树状结构.因此,我需要从底部开始并到达TOP.我需要通过SQL来完成
so you can imagine its kind of tree structure.So i need to start from bottom and reach to TOP.I need to do it through SQL
所以我应该从哪里开始???我需要创建一个临时表或任何我可以做的有用的方法吗?
So from where I should start ???Do i need to create a temp table or anything which i can do any approach which can be useful???
注意:不允许删除CASCADE
Note:CASCADE DELETE NOT ALLOWED
我可能无权访问任何sys表.任何方便的方法???我正在使用oracle 10g
I might not have access to any sys tables.. any approach that can be handy??? I am using oracle 10g
推荐答案请参阅: http: //www.techonthenet/oracle/foreign_keys/disable.php
ALTER TABLE table_name disable CONSTRAINT constraint_name;只需确保了解执行此过程的后果以及它将对其他数据/应用程序功能产生的影响.
Just be sure to understand the consequences of doing such a procedure and the effects it will have on other data / application functions.
此外,如果不太明显,请确保随后启用约束
Also, if it wasn't obvious be sure to enable the constraint afterwards
ALTER TABLE table_name enable CONSTRAINT constraint_name;更多推荐
删除具有外键约束的行
发布评论