Validate dates before conversion, aka. ISDATE() equivalent

前端 未结 1 1478
抹茶落季
抹茶落季 2021-01-14 01:30

DB2 version is 9.7.0.7

I have a flat file, and need to validate fully prior to insert into a production table. For analysis, I\'ve parsed it into a table where all

相关标签:
1条回答
  • 2021-01-14 01:56

    You can do it with the PureXML extension as follows:

    SELECT
     XMLCAST(XMLQUERY('string($D) castable as xs:date' PASSING mycolumn as D ) AS INT)
    FROM 
     mytable
    

    which will return 1 or 0.

    0 讨论(0)
提交回复
热议问题