Skip to main content

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.

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

david_r

Yup, that worked.

Tx.

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

Tx, again.


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

 

 


Reply