SQLLoader date formatting help [message #417262] |
Thu, 06 August 2009 16:53 |
jimiki
Messages: 4 Registered: August 2009
|
Junior Member |
|
|
I am trying to sqlload a file from sybase.
The bcped file looks like this (pipe delimited).
Test data:
BROKER |A00520 | |0|000000000912 | | |0|Jan 1 1753 12:00:00:000AM|ASSOCIATION COMPANY|1|Sep 11 2006 11:49:33:246AM|Jan 1 1753 12:00:00:000AM
My control file looks as shown below.
LOAD DATA
INFILE 'ER_EXTE.dat'
BADFILE 'EXTE.err'
APPEND
INTO TABLE ER_EXTE
FIELDS TERMINATED BY "|"
( EXTU_CONSTITUENT,
EXTE_ID,
GRGR_ID,
MEME_SFX INTEGER,
EXTU_ID ,
MEME_REL ,
MEME_ID_NAME ,
MEME_CK INTEGER ,
MEME_BIRTH_DT DATE "Month DD YYYY",
EXTE_NAME ,
EXTE_STS ,
EXTE_CREATE_DTM DATE "Month DD YYYY" ,
EXTE_PROCESS_DTM DATE "Month DD YYYY"
)
When I run sqlloader it says invalid month.
sqlldr userid=test/test control=TEST.ctl log=TEST.log
Being new to oracle, can anyone help how the control file should look like to load the file. Thank you
|
|
|
|
Re: SQLLoader date formatting help [message #417264 is a reply to message #417262] |
Thu, 06 August 2009 18:44 |
jimiki
Messages: 4 Registered: August 2009
|
Junior Member |
|
|
I know the date mask is not right.
I tried several and it didn't work.
Wondering whats the correct format for this.
Some examples I tried are
MEME_BIRTH_DT "to_timestamp(:MEME_BIRTH_DT,'MON dd yyyy HH:MI:SS.ff3AM')"
MEME_BIRTH_DT "to_timestamp(:MEME_BIRTH_DT,'Mon dd yyyy hh:mi:ss.ff3AM')"
|
|
|
|
Re: SQLLoader date formatting help [message #417266 is a reply to message #417262] |
Thu, 06 August 2009 18:46 |
jimiki
Messages: 4 Registered: August 2009
|
Junior Member |
|
|
CNTL file tried is as follows:
LOAD DATA
INFILE 'ER_EXTE.dat'
BADFILE 'EXTE.err'
APPEND
INTO TABLE ER_TB_SYST_EXTE_EUSER3
FIELDS TERMINATED BY "|"
( EXTU_CONSTITUENT,
EXTE_ID,
GRGR_ID,
MEME_SFX INTEGER,
EXTU_ID ,
MEME_REL ,
MEME_ID_NAME ,
MEME_CK INTEGER ,
MEME_BIRTH_DT "to_timestamp(:MEME_BIRTH_DT,'MON dd yyyy HH:MI:SS.ff3AM')",
EXTE_NAME ,
EXTE_STS ,
EXTE_CREATE_DTM "to_timestamp(:EXTE_CREATE_DTM,'MON dd yyyy HH:MI:SS.ff3AM')" ,
EXTE_PROCESS_DTM "to_timestamp(:EXTE_PROCESS_DTM,'MON dd yyyy HH:MI:SS.ff3AM')"
)
|
|
|
|
|
Re: SQLLoader date formatting help [message #417393 is a reply to message #417262] |
Fri, 07 August 2009 15:58 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
jimiki wrote on Thu, 06 August 2009 17:53 |
Test data:
BROKER |A00520 | |0|000000000912 | | |0|Jan 1 1753 12:00:00:000AM|ASSOCIATION COMPANY|1|Sep 11 2006 11:49:33:246AM|Jan 1 1753 12:00:00:000AM
|
Your data and your format mask for milliseconds is out of whack. Either use a colon in the format mask or a period in the data.
|
|
|