This won't run very fast (!!), but for a one-time shot it should get what
you need.

SELECT cnmacc
FROM arstageeo/arcnm
WHERE posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,1,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,2,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,3,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,4,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,5,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,6,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,7,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,8,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,9,1))=0
OR posstr(' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',substr(cnmacc,10,1))=0

That should get every record where cnmacc contains something other than a
space, numeric digit, or upper-case alphabetic character.

Have fun!

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Francis Lapeyre
Sent: Tuesday, March 25, 2008 12:52 PM
To: Midrange Discussion
Subject: Finding non-alphanumeric characters using SQL


I'm scratching my head here. I'm trying to find all intances where a
particular field does not have a space, a number, or an uppercase letter in

Using STRSQL, this does not work:

SELECT cnmacc FROM arstageeo/arcnm WHERE cnmacc not like('%

Niether does this:

SELECT cnmacc FROM arstageeo/arcnm WHERE trim(cnmacc) not in('%1%') and
trim(cnmacc) not in('%2%') and trim(cnmacc) not in('%3%') and trim(cnmacc)
not in('%4%') and trim(cnmacc) not in('%5%') and trim(cnmacc) not in('%6%')
and trim(cnmacc) not in('%7%') and trim(cnmacc) not in('%8%') and
trim(cnmacc) not in('%9%') and trim(cnmacc) not in('%0%') and trim(cnmacc)
not in('%A%') and trim(cnmacc) not in('%B%') and trim(cnmacc) not in('%C%')

(continuing the alpahbet) ...

trim(cnmacc) not in('%Z%')

This is a one-shot deal. We want to identify accounts in CNMACC (a 10-byte
fixed-length character field) which were entered with "funny" characters.

What am I doing wrong?

Thanks in advance.

Francis Lapeyre

Da mihi sis crustum Etruscum cum omnibus in eo.

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008
10:26 AM

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].