Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to find the values other than a-z in an account name.

Status
Not open for further replies.

colezpapa

Programmer
Feb 26, 2007
86
US
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?
 
Hi

If there are unusual characters, I would want the unusual characters.

For example...

Account Character
First Natio&nal Express.... &

Something like that....
 
I'd say this is something for a stored procedure..

Ties Blom

 
I agree with Ties on this. I'm not sure if it could be done, but it would be much better suited to a stored procedure/programming language.

Marc
 
Yep....I am doing it in VBA....
I was hoping I could do it in SQL...

thx anyway
 
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.

Cheers
Sathyaram

For db2 resoruces visit More DB2 questions answered at &
 
Cool, remember now seeing something similar before..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top