date format in control file (sql loader) [message #609765] |
Wed, 12 March 2014 01:58 |
|
vivek_veri
Messages: 8 Registered: September 2013 Location: INDIA
|
Junior Member |
|
|
Hi all,
I am trying to load my data from a text file to an oracle table using sql loader. What should be the syntax of date MASK for the below kind of data.
621228487|3/9/2014 6:20:26 PM
I am using the following control file
LOAD DATA
INFILE 'SQL_LDR_DT_EXP.txt'
INTO TABLE SQLLDR_EXP
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
( TX_ID,
DT DATE "DD-MON-YYYY HH24:MI:SS" NULLIF (DT=BLANKS)
)
Please help me with this.
when i use above format i am getting error in log file as
Record 1: Rejected - Error on table SQLLDR_EXP, column DT.
ORA-01858: a non-numeric character was found where a numeric was expected
Record 2: Rejected - Error on table SQLLDR_EXP, column DT.
ORA-01843: not a valid month
|
|
|
|
|
Re: date format in control file (sql loader) [message #609770 is a reply to message #609769] |
Wed, 12 March 2014 03:05 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
This format mask still doesn't match input data. You don't use 24 hours but AM/PM. Try with control fileLOAD DATA
INFILE *
INTO TABLE SQLLDR_EXP
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
( TX_ID,
DT DATE "mm/dd/yyyy hh:mi:ss pm"
)
begindata
621228487|3/9/2014 6:20:26 PM
Loading sessionM:\a1_maknuto>sqlldr scott/tiger@ora10 control=test12.ctl log=test12.log
SQL*Loader: Release 11.2.0.1.0 - Production on Sri O×u 12 09:02:32 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 1
M:\a1_maknuto>
What's been done:M:\a1_maknuto>sqlplus scott/tiger@ora10
SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 12 09:02:51 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from sqlldr_exp;
TX_ID DT
---------- -------------------
621228487 09.03.2014 18:20:26
SQL>
[Updated on: Wed, 12 March 2014 03:05] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: date format in control file (sql loader) [message #609788 is a reply to message #609787] |
Wed, 12 March 2014 05:10 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Of course not; that's why you use INFILE which points to a file.
I don't know what is wrong with that file. Did you copy it from another system? If so, how? (should be in ASCII mode, I presume). Maybe it contains certain control characters which prevent data to be loaded correctly. Or, maybe not all rows in that file comply to the format you applied.
|
|
|