Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: check table for "special" characters.
> I want to check 12 columns in a table for any characters others than A-Z & 0-9
> (e.g. a-z,?,#,...)
> (Oracle 8)
> How to do?
> Thank you.
You can declare function for checking string for special characters and use
this function in query egz.:
select ename from emp where AZ(ename)>0;
Where AZ is function like this :
create or replace function AZ (S IN varchar2) RETURN integer IS
maxl number;
pos integer;
fail integer;
c varchar2(1);
BEGIN
maxl:=length(S);
fail:= 0;
for pos in 1..maxl
loop
c:=SUBSTR(S,pos,1); if instr('ABCDEFGHIJKLMNOPQRSTUWZXV0123456789',c) <= 0 then fail:=pos; exit; end if;