Solved

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

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

789 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