SQL Loader function and nullif issue [message #364682] |
Tue, 09 December 2008 10:06 |
clmurphy
Messages: 4 Registered: December 2008
|
Junior Member |
|
|
I am trying to load a date field that is mm/dd/yyyy 0:00:00, I need to truncate the time element and also account for the field being blank.
this is the function in the control file but it is not working
"trunc(to_date(:for_dt,'MM/DD/YYYY HH24:MI:SS')) NULLIF for_dt=BLANKS",
Can NULLIF not be used with a function?
Thanks
|
|
|
|
Re: SQL Loader function and nullif issue [message #364685 is a reply to message #364684] |
Tue, 09 December 2008 10:31 |
clmurphy
Messages: 4 Registered: December 2008
|
Junior Member |
|
|
we could not get the date to load with the time element and we did not need it anyway so I was trying to remove it from the file. Is there a specific data type that sqlloader will recognize, I tried timestamp but I received a loader error.
|
|
|
|
Re: SQL Loader function and nullif issue [message #364688 is a reply to message #364686] |
Tue, 09 December 2008 10:47 |
clmurphy
Messages: 4 Registered: December 2008
|
Junior Member |
|
|
LOAD DATA
APPEND
INTO TABLE xxxxx.xxx_xxxxxx_data
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
(fileNo,
file_pos_orig,
file_owner,
file_type,
file_type_orig,
file_dt "trunc(to_date(:file_dt,'MM/DD/YYYY HH24:MI:SS')) NULLIF :file_dt=BLANKS",
file_line_amt)
Data:
9999999999,1,2,2,2,2,8/28/1995 0:00:00,,
some of the date fields are empty so they will just show as ,, like the last field in the data.
|
|
|
|
|
|