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
  •  | 
  •  

문제

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.

도움이 되었습니까?

해결책 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)

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top