I am trying to build a query that checks an account name field for any values other than 'a-z' and '0-9'
I am not sure how to do this, i tried the transform but got back really wierd results.
Colezpapa,
Not quite sure here what you wish to see returned back from the query. Do you want it to return just the unusual characters or do you just want to know if characters other than a-z 0-9 exist? If they don't exist, what do you want the query to return?
select tabname from syscat.tables where NOT(
locate(' ',tabname )=0 and
length(strip(translate(tabname,'','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')))=0 ) "
This list all tables that hav non-alphanumeric in their names .. "_" as an example.
The locate is used to ensure there are no blank spaces in the string.
Hope this gives an idea of how to tackle your requirement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.