Emulate REGEXP like behaviour in SQL

前端 未结 5 559
野趣味
野趣味 2020-12-22 05:47

I\'ve posted this question on the new dba.stackexchange.com (please, let me know if I have to delete one).

I\'m working on a DB2 database, and as far as I can see re

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 06:39

    You can use Regular Expression in DB2 via xQuery:

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

    http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.xml.doc/doc/xqrfnmat.html

提交回复
热议问题