HELP: Disable fk constraints not working...
Date: 26 Sep 2002 10:16:10 -0700
Message-ID: <13c18c78.0209260916.53333d8f_at_posting.google.com>
I'm trying to load data from comma-delimited files into tables already
created in Oracle 8.1.7. There are numerous foreign, unique, and
primary key constraints on these tables as well as triggers. However,
despite having run scripts to disable constraints and triggers, I'm
still getting errors when running SQL*Loader to load the data. Can
someone help me figure this out?
The error message I find in sqlldr.log after running the sqlldr
command is:
Record 1: Rejected - Error on table BOOK. ORA-02291: integrity constraint (BLAH.FK_BOOK_VALGRADELEVEL) violated - parent key not found
Detailed info below.
Here are the scripts I'm running prior to the sqlldr command:
/*turn off foreign key constraints*/
select 'alter table ' || table_name || ' disable constraint ' ||
constraint_name || ';'
from user_constraints
where table_name = upper('&table')
and constraint_type not in ('U','P')
and status = 'ENABLED';
commit;
/*turn off unique, primary key constraints*/
select 'alter table ' || table_name || ' disable constraint ' ||
constraint_name || ';'
from user_constraints
where table_name = upper('&table')
and constraint_type in ('U','P')
and status = 'ENABLED';
commit;
/*turn off triggers*/
I won't bore you with the details of this one. It works fine.
The SQL*Loader command I'm running is as follows:
sqlldr userid=blah_at_db01/blah control=control.ctl log=sqlldr.log bad=sqlldr.bad discard=discard.log Received on Thu Sep 26 2002 - 19:16:10 CEST