Home » RDBMS Server » Server Utilities » sqlldr loading more than expected rows
sqlldr loading more than expected rows [message #71279] Tue, 08 October 2002 22:00 Go to next message
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
Re: sqlldr loading more than expected rows [message #71283 is a reply to message #71279] Wed, 09 October 2002 04:18 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Please followup our other posting.
It may help you...
sql*loader and constraint
Re: sqlldr loading more than expected rows [message #71292 is a reply to message #71279] Wed, 09 October 2002 20:00 Go to previous message
Ashok_Mishra@keaneIndia.c
Messages: 1
Registered: October 2002
Junior Member
I tried this solution but no luck because in our requirement we can't use direct path. It seems you have used direct path to load the data.


Thanks,
Ashok
Previous Topic: Re: Oracle problem
Next Topic: temp tablespace issue
Goto Forum:
  


Current Time: Wed May 15 21:33:38 CDT 2024