Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-11-01
2
Medium Priority
?
596 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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

916 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