Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Some Null values in date for SQL LOADER

1013593Feb 25 2015 — edited Feb 25 2015

Hi All,

I am on 11.2.0.3 linux 5.7

I am testing loading with 20 records and I have column for Last_date with datatype date.Out of 20 records 9 records of this column are empty i have  "--" value in csv file.While loading records 11 rows are gettting inserted but 9 rows for which i have -- value in date it is not getting inserted.I am using TRAILING NULLCOLS even though 9 rows are not procesing.

Here is my table:

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

ACCOUNT_ID                                         VARCHAR2(250)

EMP_ID                                                  VARCHAR2(250)

FIRST_NAME                                         VARCHAR2(250)

LAST_NAME                                          VARCHAR2(250)

MAIL                                                      VARCHAR2(250)

STATUS                                                 VARCHAR2(250)

LAST_DATE                                            DATE

Here is my control file:

LOAD DATA

INFILE '/home/oracle/psrdata.csv'

BADFILE '/home/oracle/emp.bad'

DISCARDFILE '/home/oracle/emp.dsc'

INSERT INTO TABLE TEST

fields terminated by ","  TRAILING NULLCOLS

(ACCOUNT_ID,EMP_ID,FIRST_NAME,LAST_NAME,MAIL,STATUS,LAST_DATE  date "mm/dd/yyyy hh24:mi")

sample data

Header 1Header 2Header 3Header 4Header 5Header 6Header 7

Account ID

Employee IDAccount First NameAccount Last NameAccount MailstatusLast_Date
A01968919689.testtest1@test.comDisabled08-07-2014 06:34
A01968919689.test1test1@test.comDisabled1/30/2015 8:48
A01968919689.test2test1@test.comDisabled08-07-2014 06:34
A019689----test3Disabled--
T047760----test4Disabled--
T047760----test5enabled--
T047760T047943dwartest7test1@test.comenabled01-10-2014 02:16
EXT_APPT_C033T047943dwartest8test1@test.comenabled1/29/2015 4:17
EXT_APPT_C033T047943dwartest9test1@test.comenabled--
EXT_APPT_C033T047943dwartest10test1@test.comenabled1/29/2015 4:17

Getting error from log:

Record 1: Rejected - Error on table TEST, column LAST_DATE.

ORA-01858: a non-numeric character was found where a numeric was expected

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 25 2015
Added on Feb 25 2015
5 comments
2,165 views