Tuesday, October 19, 2021

OIC - Unable to convert a string in the xml to a java.sql.date - while inserting into database

Scenario: We have received an input date as YYYY/MM/DD format and when we are trying to insert it into a database, got below error:

Unable to convert a string in the xml to a java.sql.date.


Solution: Convert the YYYY/MM/ DD format to  YYYY-MM-DD format. You can use translate() function and convert the "/" to "-".

translate(datefield, "/","-")


No comments:

Post a Comment

Featured Post

OIC - How to Retrieve Email Attachments Using Microsoft Graph API: Automating Payment File Processing

Retrieving Email Attachments Using Microsoft Graph API: Automating Payment File Storage in Object Storage Use Case: A finance team needs t...