Solved

How do I load data with sql loader with two date formats for one field?

Posted on 2008-11-01
2
588 Views
Last Modified: 2011-10-19
I am loading bar delmited data with sql loader.  Some of the files used the date format MM/DD/YYYY and others use YYYY-MM-DD HH24:MI:SS.  The control file with MM/DD/YYYY format is listed below.  FIELD3 is the one with different formats.  Is there a way to use one control file to load files with the two different date formats?

LOAD DATA
INFILE 'sample.dat'
APPEND
INTO TABLE TMP_TABLE
FIELDS TERMINATED BY '|'
(FIELD1,
FIELD2,
FIELD3 DATE "MM/DD/YYYY",
FIELD4,
FIELD5 DATE "YYYY-MM-DD HH24:MI:SS")
0
Comment
Question by:wayneb01
  • 2
2 Comments
 
LVL 32

Accepted Solution

by:
awking00 earned 250 total points
ID: 22857540
See attached.

format-dates.txt
0
 
LVL 32

Expert Comment

by:awking00
ID: 22857545
Sorry, the control file should read date_check(...) and not check_date(...).
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question