Skip to main content
Solved

oracle julian dates


gio
Contributor
Forum|alt.badge.img+15
  • Contributor

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
View original
Did this help you find an answer to your question?

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
gio wrote:

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...)

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings