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