날짜 유효성 검사(xquery 사용)

 
WITH T AS
    (  SELECT '2009o209' DT FROM DUAL 
       UNION ALL SELECT '20000229' FROM DUAL
       UNION ALL SELECT '20010229' FROM DUAL
       UNION ALL SELECT '20100229' FROM DUAL
       UNION ALL SELECT '21000229' FROM DUAL
       UNION ALL SELECT '28000229' FROM DUAL
       UNION ALL SELECT '40000229' FROM DUAL
     )

SELECT T.*, A.*
  FROM T, 
       XMLTABLE('if (. castable as xs:date) then xs:string(.) else ()'
                  PASSING REGEXP_REPLACE(T.DT,'[^0-9]','')
                ) A
;

You may also like...

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다