Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Please help if you can! I need to insert rows in spite of FK constraints.

Please help if you can! I need to insert rows in spite of FK constraints.

From: Roy Collings <roy_46mbd_at_yahoo.com>
Date: 6 Dec 2001 04:32:56 -0800
Message-ID: <f932359d.0112060432.4544adfc@posting.google.com>


Long background story, but basically when I'm inserting into a table I need to get my script to ignore any FK violations.

  1. I can't modify the insert script (because it's dynamically built and executed and will take many different forms for the hundreds of different tables in this database).
  2. I know you can put a begin...end around an insert and catch the violation with "exception", but this isn't feasable without an enourmous redesign of the way this piece of code was originally written (before my time). Putting the begin...end loop around the DBMS_SQL.EXECUTE catches the violation, but the insert stops there.
  3. I can't disable the constraints on this database (again, long story!).

I basically need some sql or DBMS_SQL command that will continue inserting the next row, even if this row hits a foreign key error.

Does anyone know of such a handy thing (I'll be your best friend and tell every that you're a genius if you do!)? Received on Thu Dec 06 2001 - 06:32:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US