If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > skip header option in db2 load command?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-11, 01:55
samsince85 samsince85 is offline
Registered User
 
Join Date: Apr 2011
Posts: 5
skip header option in db2 load command?

I am loading data from csv file on unix directory to a load table in db2 through LOAD command as below (part of the script):

my csv file has header too. With this command below, all the data is getting loaded skipping the header due to datatype mismatch and shows the job status as Failed. I want to deal it in a different way, by skipping the header not by datatype error but by some option of LOAD so that job status wouldnt be as Failed though the data is loaded. Is there anything like skip header option in Load command???

************************script******************** ******
FLIST=`find $LOAD_FILE -print`
for ACTFILE in $FLIST
do
# Load the file
#
db2 +p +o -x CONNECT TO $DSS_DATABASE
db2 +p -x LOAD CLIENT FROM $ACTFILE OF DEL SKIPCOUNT 1 \
MODIFIED BY COLDEL\, \
METHOD P \(\
1 \
, 2 \
, 3 \
, 4 \
\) \
INSERT INTO $DSS_SCHEMA.load_my_table\( \
abc \
, def \
, ghi \
, jkl \
\) \
NONRECOVERABLE > /home/redbatch/EDW13/wsl/working/wsl1276.log 2>&1
RETCODE=$?
db2 +p +o -x TERMINATE
Reply With Quote
  #2 (permalink)  
Old 05-18-11, 06:46
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
RESTARTCOUNT should work in your example but note that this option is deprecated and can be removed any time so it's not recommended to use it. Don't use it with load RESTART (after it failed).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On