oracle - How to use decode in sql-loader? -
i use sqlldr import csv files , have problem date multiple formats.
dates inside csv file dd/mm/yyyy , if there no date single dot
csv file
date_column;other_column 01/01/2013;other column content 1 .;other column content 2 my .ctl file sqlldr
load data infile '/path/to/my/file.csv' replace table table_to_fill fields terminated ';' ( columndate "decode(:columndate ,null,'.', to_date(:columndate ,'dd/mm/yyyy'))", other_column ) the import working when use :
decode(:columndate ,null,'.')) or
to_date(:columndate ,'dd/mm/yyyy') but not when try combine both...
here error log :
record 1: rejected - error on table table_to_fill, column columndate. ora-01858: non-numeric character found numeric expected how can combine these, please ?
i thought last parameter of "decode" function default value of column, wrong ?
sql loader's "regular" syntax should enough here. try this:
load data infile '/path/to/my/file.csv' replace table table_to_fill fields terminated ';' ( columndate date(7) "dd/mm/yyyy" nullif columndate = "." other_column )
Comments
Post a Comment