Solved

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

Posted on 2008-09-29
2
1,684 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.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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 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.

810 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