Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
594 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: 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 post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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 …

721 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