Mule/Apache Derby - convert date retrieved in SELECT query from MM/DD/YYYY to DD.MM.YYYY

StackOverflow https://stackoverflow.com/questions/22668050

  •  21-06-2023
  •  | 
  •  

Frage

I have a Mule application that is retrieving information from an Apache Derby database. One field being pulled is a date in the format MM/DD/YYYY - this field is stored as a VARCHAR(30).

How can I query this table and retrieve the date field in the format DD.MM.YYYY? - note the need to transform the dividers to '.' to '/'. Alternatively, is there is a way I can perform this action using Mule Expression Language? Thanks in advance.

War es hilfreich?

Lösung 2

The solution I found to this was to do the transformation in SQL with a series of concatenated substrings:

SUBSTR(MyDate,4,2) || '.' || SUBSTR(MyDate,1,2) || '.' || SUBSTR(MyDate,7,4)

Andere Tipps

If you want to reformat the date in Mule Configuration and if your date is a Varchar in DB ... you can use Mule set Payload

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top