sqlldr loading more than expected rows [message #71279] |
Tue, 08 October 2002 22:00  |
Ashok Mishra
Messages: 4 Registered: September 2002
|
Junior Member |
|
|
We are trying to load a child table that has the referential integrity constraint with its parent and some triggers on it that is used to change the case of data. We are using the bcp to create a text file that is having the 5 records. The text file generated from BCP is a kind of CSV (~ is used for ,) file. When we are trying to load the reords using sqlldr it is loading 10 records in th edatabase. It happens when 2 last rows are violating the integrity constraint thus the first 3 records are being duplicated and violated records are also lodaed. Strange thing is that the same record that was loaded is being pushed in the bad file also. When we disable the trigger everything works fine. For your help following is the snap of trigger and ctl files along with sample data:
CREATE OR REPLACE TRIGGER "CMD".RWC_SPCL_HANDLING_INSTRCTNS
before insert or update on RWC_SPCL_HANDLING_INSTRCTNS
REFERENCES NEW AS NEW
for each row
BEGIN
:new.ORG_ROADMARK:=upper(:new.ORG_ROADMARK);
:new.RWC_CD:=upper(:new.RWC_CD);
:new.SPCL_HANDLING_CD:=upper(:new.SPCL_HANDLING_CD);
EXCEPTION
WHEN OTHERS THEN RETURN;
END;
---------CTL FILE-------------
load data
infile 'datarwc_spcl_handling_instrctns.txt'
into table rwc_spcl_handling_instrctns truncate
fields terminated by '~'
trailing nullcols
(ORG_ROADMARK ,
RWC_CD ,
SPCL_HANDLING_CD,
RWC_SPCL_HNDLNG_INSTRCTN_ID "rwc_sqn.nextval"
)
-SAMPLE DATA--------
GSWR~CARCHTADO1~SLC
GSWR~CARCHTBUO1~SLC
GSWR~CARCHTCOO1~SLC
GSWR~CARSTRCANO~SHL
GSWR~CARSTRCANO~SLC
Thanks,
Ashok
|
|
|
|
|