Hi All,
I am inserting data to Postgresql in mule4 project.
Table structure is below:
I am getting error:
org.postgresql.util.PSQLException: Bad value for type timestamp : 2022-08-09T22:25:47Z
%dw 2.0
output application/json
import * from dw::core::Strings
---
{
object : payload.object,
id : payload.id,
created_date : substringBefore (payload.createdDate, ".") as DateTime ,
state : payload.state
}
The same is working if I am using the direct sql:
Thanks
Yatan
@Yatanveer Singh Can you try changing the DateTime to LocalDateTime, it should work.
%dw 2.0
output application/json
import * from dw::core::Strings
---
{
object : payload.object,
id : payload.id,
created_date : substringBefore (payload.createdDate, ".") as LocalDateTime ,
state : payload.state
}