DB2 regexp in select clause
How to use regular expressions in a DB2 select query?The simple answer is you can't. But if you are very insistent you can acheive that.
A lot of RDBSes have built in support for regular expressions, why doesn't DB2 has one? I have no idea.
In MySQL you do REGEXP, NOT REGEXP or RLIKE. here is another link.
In Microsoft SQL Server 2000 you call xp_pcre. In Microsoft SQL Server 2005 you call integrated .NET Regex classes from .
In PostgreSQL you call the regexp functions, here is another link.
For Oracle here we have a bunch of resources: First, second and also on regular-expressions.info
If you'll do a search on DB2 regexp you will stumbled upon this IBM article:
http://www.ibm.com/developerworks/data/library/techarticle/0301stolze/0301stolze.html
Which I found very interesting.
Sursa
2009-03-19 20:10:12