Convert date from one format to another using SQL*Loader control file

30,744

When you specify the columns in the INFILE declare just identify the format the data is held in. Like this

load data
infile 'whatever.csv'
into table t23
fields terminated by ','
trailing nullcols
(
       col_1    integer 
     , col_2    char 
     , col_3    date "MM/DD/YYYY"
     , col_4    date "MM/DD/YYYY"
     , col_5    char 
)

Don't worry about the "to" date format. That is only for display purposes. Oracle stores dates in its own internal representation.

Share:
30,744
Alex Larzelere
Author by

Alex Larzelere

Updated on July 23, 2020

Comments

  • Alex Larzelere
    Alex Larzelere almost 4 years

    The data from the infile is in the format MM/DD/YYYY how do I tell the control file to load it into the database as YYYYMM?