Saving Date and Time with SQL LOADER

I am trying to write a control file for sql loader. The source file to which the fixed-length format refers. I have a date and time in the source file, for example, say, from position 17 to position 24 for a date in format CCYYMMDDand from position 25 to 34 in format HH:MM:SS24. I like to store this source file of a date and time form in a date column in some table in the format "YYYYMMDD HH24: MI: SS".

Can someone help on how to do this in sql loader control file?

Does the next piece of code execute? I doubt that there is no space between the date and time in the source file?

APPEND INTO TABLE target_table
TRAILING NULLCOLS
(
date_column POSITION(17:34) "TO_DATE(:DATE_TIME,'YYYYMMDD HH24:MI:SS')"
)

Any guidance would be highly appreciated.

+4
source share
1

Oracle BOUNDFILLER:

...
(date_column BOUNDFILLER POSITION(17:24), 
 time_column BOUNDFILLER POSITION(25:34), 
 date_n_time POSITION(1:1) 
             TO_DATE(:date_column || ' ' || :time_column, 'CCYYMMDD HH24:MI:SS'),
 ...
)

, .

0

All Articles