Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Best way to find string composed of dup character?

Re: Best way to find string composed of dup character?

From: Kim Berg Hansen <kbh_at__dont_want_spam_thansen.dk>
Date: Thu, 26 Feb 2004 12:18:50 +0100
Message-ID: <tAk%b.3386$Af3.77@news.get2net.dk>

"Dr Drudge" <drdrudge_at_hotmail.com> wrote in message news:748419a0.0402250601.18e767f_at_posting.google.com...
> I need to be able to determine whether a varchar2 column contains a
> string of dup characters. Specifically, I need to weed out (or
> alternatively find) phone numbers like: 1111111, 9999999999, etc.

If you get a chance to use Oracle 10G, then it's becoming much, much easier to do stuff like that.
In 10G you could do something like this :

where repexp_like(p1.phonenumber,'([[:digit:]])\1\1\1\1\1\1')

Isn't that much nicer ? ;-)

-- 
Kim Berg Hansen
Chef-udvikler / Senior System Developer

T. Hansen Gruppen A/S
www.thansen.dk
Received on Thu Feb 26 2004 - 05:18:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US