Solved

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

Posted on 2008-11-01
2
586 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 31

Accepted Solution

by:
awking00 earned 250 total points
Comment Utility
See attached.

format-dates.txt
0
 
LVL 31

Expert Comment

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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now