Solved

Oracle sql loader from comma delimited file need to convert date from julian

Posted on 2008-09-29
2
1,679 Views
Last Modified: 2013-12-18
I need to load the data into a date field where the file has the date in julian format of YDDD
I do not know how I need to code this in the sql loader file.  

Example that does not work:
DATENMC               "TO_CHAR(TO_DATE(:DATENMC, 'MM-DD-YYYY'), 'J')"

The data in DATENMC is a julian date of format YDDD.  I want to load this into an Oracle table where the column is of data type DATE.

Thank you!
0
Comment
Question by:pattisp1
2 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 125 total points
ID: 22599456
The Oracle date format of J is defined as the number of days since January 1, 4712 BC.  That is not how your julian day is specified.

DATENMC is a Julian date, so how are you deriving that?  What does the column look like in the file being loaded?
0
 

Author Comment

by:pattisp1
ID: 22599786
Thank you!!   Yes, that is exactly it.   I was "thinking" it was julian...  The date looks like this in the file 8030 which would be for example January 30, 2008.    Thank you for tellling me about the J.    You are correct in that is not what I really have here.  

I got the data to load by specifying the following in the control file:
DATENMC               "TO_DATE(:DATENMC, 'YDDD')",

The column in the table called DATENMC was defined as a datatype of DATE.

Thank you,
Patti Spycher
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.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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.

762 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

22 Experts available now in Live!

Get 1:1 Help Now