Solved

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

Posted on 2008-09-29
2
1,693 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
[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 Comments
 
LVL 35

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

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

Suggested Solutions

Title # Comments Views Activity
Create table from select - oracle 6 65
clob to char in oracle 3 89
Oracle DBLINKS From 11g to 8i 3 63
Oracle Errors 11 45
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 post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
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.

735 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