Skip to content
Advertisement

How to find ASCII of every character in string using DB2 Function?

I have written a function in DB2 – that is calculating ASCII of records in a particular column. I want to some help as I want to check the ASCII of every single character in string return yes if the ASCII of that record is greater than 127.

Advertisement

Answer

Why to calculate ascii of every character in that column, if the goal is just to get such rows?

The fn:matches function uses regular expressions.
The [^x00-x7F] regular expression means “a character with hex value not in the 0x00 - 0x7F interval”. If a value of passed t.str contains such a character, the function returns 1 and 0 otherwise.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement