Hello Everybody,
I have a parent table and a child table
I need to truncate and load these two tables
I have to process the parent table first
But this violates the integrity constraint because of the parent/ child relation
how do i implement delete cascade in this?
Suggest me any other method to implement this
Thank you
Regards,
Ragu
ORA-02292 integrity constraint violated
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You must comply with the rules. Change your load rule for the parent table so that rows are updated (rather than replaced), or allow automatic cascade on delete (ALTER TABLE), or drop/disable constraints before loading. Each of these is dangerous.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
How about totally create the parents and children first and write to flat files, using hash files as a means to stage your foreign keys.
Then, when ready to load, issue a command like call to sqlplus to execute a couple lines of TRUNCATE TABLE commands in the right order, then bulk load your rows. Sure would be much faster than OCI's since you're during TRUNC-N-LOAD.
Then, when ready to load, issue a command like call to sqlplus to execute a couple lines of TRUNCATE TABLE commands in the right order, then bulk load your rows. Sure would be much faster than OCI's since you're during TRUNC-N-LOAD.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle