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 > Question on LOAD

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-25-04, 14:44
ansonee ansonee is offline
Registered User
 
Join Date: Feb 2002
Location: Minneapolis, MN
Posts: 253
Question on LOAD

I'm trying to load a text file into a DB2 table. There are four columns: two character columns and two DATE columns. I'm encountering issues with the date columns asnd data.

The inout file's date format is mmddyy. When I try to import the column I get the following error:

"C:\Documents and Settings\amrobi2\Desktop\A180206D.txt" OF ASC MODIFIED BY CODEPAGE=1252 DATEFORMAT="MM.DD.YYYY" NULLINDCHAR=Y METHOD L (7 16,17 26, 1 6,45 51) NULL INDICATORS (0, 0, 0, 0) MESSAGES "lllll" REPLACE INTO AMROBI2.CROSSREFERENCE (ELECDATE, ELECSEQ, PAPERDATE, PAPERSEQ) COPY NO INDEXING MODE DEFERRED

SQL3405N The beginning-ending location pair for inserting into column "3" is
not valid for a date.

What options would I / could I utilize in order to get this stuff in there?
T
Thanks!
__________________
Anthony Robinson

"If I'm curt with you, it's because time is a factor here. I think fast, I talk fast, and I need you guys to act fast if you want to get out of this. So, pretty please - with sugar on top..."
Reply With Quote
  #2 (permalink)  
Old 06-26-04, 19:15
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I think MODIFIED BY DATEFORMAT should help

Refer LOAD command documentation

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 06-28-04, 01:06
ansonee ansonee is offline
Registered User
 
Join Date: Feb 2002
Location: Minneapolis, MN
Posts: 253
I've consulted the LOAD reference and still having issues loading the date data. Here's the script portion:

LOAD FROM "C:\Documents and Settings\amrobi2\Desktop\A180206P.txt" OF ASC MODIFIED BY CODEPAGE=1252 DATEFORMAT="MM.DD.YYYY" NULLINDCHAR=Y METHOD L (1 6, 7 16, 17 26, 27 32) NULL INDICATORS (0, 0, 0, 0) MESSAGES "gggg" REPLACE INTO AMROBI2.CROSSREFERENCE (ELECDATE, ELECSEQ, PAPERSEQ, PAPERDATE) COPY NO INDEXING MODE AUTOSELECT;
CONNECT RESET;


The input format is MMDDYY. If I try to modify the script to say DATEFORMAT="mmddyy", the LOAD throws an error saying the date format is incorrect.

Anyone have an idea...
__________________
Anthony Robinson

"If I'm curt with you, it's because time is a factor here. I think fast, I talk fast, and I need you guys to act fast if you want to get out of this. So, pretty please - with sugar on top..."

Last edited by ansonee; 06-28-04 at 01:13.
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