Regular Expressions in DB2 SQL

后端 未结 5 2268
天命终不由人
天命终不由人 2020-11-27 22:13

(Other than using a UDF) Any REGEXP-In-SQL support for DB2 9.7 ?

5条回答
  •  半阙折子戏
    2020-11-27 22:45

    That works fine except for DB2 z/OS - in DB2 v10 z/OS you must use PASSING as follows

       with val as (
         select t.text
         from texts t
         where xmlcast(xmlquery('fn:matches($v,"^[A-Za-z 0-9]*$")'
                        PASSING t.text as "v" ) as integer) = 0
        )
        select * from val
    

提交回复
热议问题