Skip to main content
Solved

oracle julian dates

  • May 31, 2018
  • 3 replies
  • 56 views

gio
Contributor
Forum|alt.badge.img+15

Hi all,

This works in SQL Developer.

Why does this not work in a SQL Executor/Creator?

select to_date(736845 + to_char(to_date ('02-01-0001'),'J'),'J') t1,
to_char(to_date ('02-01-0001'),'J') t0
from dual
output:
T1 T0
31-05-18 1721425


Fme executor insists `ORA-01843: not a valid month'

which is totaly not true! 

 It appears that the 'J', julian format is not recognised. 

 Is this a error or am i missing something?

Don't suggest out of sql solutions, i wan't it to be done in the executor. Be aware i will issue demerits !! ;)  SQL answers required. 

Greets an txia for your answers.

Best answer by david_r

I suspect this is related to how the client connection locale is set. I was able to reproduce the exact same issue from Toad, so I don't think this is something that's specific to FME.

I think you'll find that to_date() is much more reliable if you explicitly specify the date format rather than relying on assumptions made by the client locale setting. Try the following:

select to_date(736845 + to_char(to_date ('02-01-0001', 'DD-MM-YYYY'),'J'),'J') t1,
to_char(to_date ('02-01-0001', 'DD-MM-YYYY'),'J') t0
from dual
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • Best Answer
  • May 31, 2018

I suspect this is related to how the client connection locale is set. I was able to reproduce the exact same issue from Toad, so I don't think this is something that's specific to FME.

I think you'll find that to_date() is much more reliable if you explicitly specify the date format rather than relying on assumptions made by the client locale setting. Try the following:

select to_date(736845 + to_char(to_date ('02-01-0001', 'DD-MM-YYYY'),'J'),'J') t1,
to_char(to_date ('02-01-0001', 'DD-MM-YYYY'),'J') t0
from dual

gio
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • May 31, 2018

david_r

Yup, that worked.

Tx.

I would like, upvoted your answer, but I seem not able to.

Tx, again.


gio
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • May 31, 2018

david_r

Yup, that worked.

Tx.

I would like, upvoted your answer, but I seem not able to.

Tx, again.

ah now I can up-thumbs up you!

 

Here you go.

 

(almost lewd...)