Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle Finace 3 67
How to count the number of rows in multiple Oracle Tables 10 64
ORA-12560: TNS:protocol adapter error 8 91
exp/imp 25 45
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…
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…
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 Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

863 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