RE: BLANK DATE IN FILE SQLLOADER

RE: BLANK DATE IN FILE SQLLOADER

 

  

Please change your control file field2 as below. At the place of
"blanks" you can also give sysdate.

load data
infile "filename.csv"
replace
into table table_name
fields terminated by ","
trailing nullcols
(
Field1 char,
Field2 date 'MM/DD/YYYY' nullif Field2=blanks
)



With regards,
Sushil Kumar
Thomson Corporation Intl. Pvt. Ltd.

-----Original Message-----
From: Shadab Mehboob
[mailto:oracledba-ezmlmshield-x85287875.[Email address protected]
Sent: Tuesday, July 31, 2007 5:24 AM
To: LazyDBA Discussion
Subject: BLANK DATE IN FILE SQLLOADER

Dear Masters
I am trying to load data through sql loader.
My input file has blanks at some places where the data type in the table
is of type DATE How do i handle this in the sqlloader. I want to load
system date whenever the DATE filed is blank in the infile.
I have written the query as

load data
infile "filename.csv"
replace
into table table_name
fields terminated by ","
trailing nullcols
(
Field1 char,
Field2 "decode(:Field2, null,sysdate,:Field2)
)


Regards
Shadab


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



Oracle LazyDBA home page