ORA-02292 integrity constraint violated

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ragu
Participant
Posts: 19
Joined: Fri Jul 08, 2005 8:42 pm

ORA-02292 integrity constraint violated

Post by ragu »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

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.
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
Post Reply