Convert Date to be read by Oracle

#1

Hi,

I have some Date formatted in DD.MM.YYYY format, such as ‘16.06.2007’. In order to be read in Oracle, I need to be able to format it to the following format, like the example: ‘16-OCT-07’.

I could not find this type of format using String to Date component. Should I use Java Snippet for this or there is another simple way?

Thanks advance!

0 Likes

#2

Hi.

Do you need a date type field or a string type field with the mask DD-MMM-YY?

If the second scenario works for you, you can use a string to date node and then date to string node with the specified format (DD-MMM-YY).

Best regards,
Alex

2 Likes

#3

Added this option to the example

2 Likes

#4

Just convert the string to a date in KNIME with String to Date&Time node. Works fine. Just tried it.

‘16-OCT-07’ is just the format you have configured oracle to display. This can also be changed but is not needed:

ALTER SESSION SET NLS_DATE_FORMAT = ‘DD.MM.YYYY’;

2 Likes

#5

Hi alex_never,

That worked so fine! Thank you!

0 Likes

#6

Hi beginner,

Good advice, thank you!

0 Likes