Yes the Data files has Duplicate Entries, but when it tries to insert it needs to discrad that records and proceed further. I need to skp these errorneous records and progress further
Main Topics
Browse All TopicsHi,
I am running the below script from unix and the sqlloader command fails, Can I request to let me know how to handle this error.
My Code:
sqlldr userid="$1" control=Control/$l_control
retcode=`echo $?`
echo $retcode
case "$retcode" in
0) echo "SQL*Loader execution successful" ;;
1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
2) echo "SQL*Loader exectuion exited with EX_WARN, see logfile" ;;
52) echo "SQL*Loader Discarding some rows, but I do not care " ;;
3) echo "SQL*Loader execution encountered a fatal error" ;;
*) echo "unknown return code";;
esac
echo "Data Load Completed successfully for " $t $p
But still I am unable to handle the below error, I need to ignore any bad records and progress further. Please suggest
Record 1872: Rejected - Error on table DWDM_SUBRACK.
ORA-00001: unique constraint (T2100.DWDM_SUBRACK_PK) violated
This question is in progress.
Our experts are working on an answer right now.
Sign up for immediate access to the solution once it becomes available.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
DISCARDMAX 50 is set to 50, also find below the ctl file structure
LOAD DATA
INFILE 'G:\Misc\wdm_trail_route.t
BADFILE 'G:\Misc\wdm_trail_route.b
DISCARDFILE 'G:\Misc\wdm_trail_route.d
DISCARDMAX 50
APPEND
INTO TABLE "DWDM_TRAIL_ROUTE"
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' AND '"'
(TRAILROUTE2TRAIL
,
NMSNAME
,
TRAILORDER
,
TRAILLEVEL
,
ROUTETYPE
,
ATTRIBUTE1
,
ATTRIBUTE2
,
ATTRIBUTE3
)
Hi,
Below is my shell script which executes the tables NE, SUBRACK, CARD, PORT, TRAIL....., After loading subrack it fails to continue further. But I could see the Table popul;ated with the data skipping the unwanted records. After that it fails to continue further.
Shell Script below
==========
for t in NE SUBRACK CARD PORT TRAIL TRAIL_ENDPOINTS TRAIL_ROUTE
do
p=$( echo "$t" | tr -s '[:upper:]' '[:lower:]' )
l_control=$t
echo $t.txt ...
echo $p.txt
#Check for .bad files specific to each domain and not in general
[ -f log/$v_log.log ] && rm log/$v_log.log
[ -f log/$v_log.bad ] && rm log/$v_log.bad
v_log=$t"_T2100"
#SQL Loader creates .bad,.log files specific to each domain.
sqlldr userid="$1" control=Control/$l_control
retcode=`echo $?`
echo $retcode
case "$retcode" in
0) echo "SQL*Loader execution successful" ;;
1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
2) echo "SQL*Loader exectuion exited with EX_WARN, see logfile" ;;
52) echo "SQL*Loader Discarding some rows, but I do not care " ;;
3) echo "SQL*Loader execution encountered a fatal error" ;;
*) echo "unknown return code";;
esac
echo "Data Load Completed successfully for " $t $p
done
============
I dont get the Data Load Completed for subrack table as I get for ne table.
Also find below the log.
Commit complete.
Loading HuaweiWDM T2100 NMSdata to t2100/t2100:
NE.txt ...
ne.txt
0
SQL*Loader execution successful
Data Load Completed successfully for NE ne
SUBRACK.txt ...
subrack.txt
T2100: /home/crasync/nwm_dumps.wo
T2100: /home/crasync/nwm_dumps.wo
ORC (dbs) - version 09.00-00
Business Accounts
Answer for Membership
by: woolmilkporcPosted on 2009-10-28 at 06:46:30ID: 25683143
Seems that you're just attempting to load a duplicate-key record (a record with the same primary key already exists in DWDM_SUBRACK).
Check your input data!
wmp