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

Home -> Community -> Usenet -> c.d.o.server -> Re: regular expressions in query under oracle?

Re: regular expressions in query under oracle?

From: Mladen Gogala <mgogala_at_yahoo.com>
Date: Fri, 26 Mar 1999 03:01:35 GMT
Message-ID: <7deta9$nj7$1@nnrp1.dejanews.com>


In article <7dceua$i1c$1_at_nnrp1.dejanews.com>,   JD Austin <jd_at_austin.centergate.com> wrote:
> I have a database field that is a list of integers.
> groupRead="05,27,10,810,45,15";
>
> The table associated to the groupRead field has a primary key of
> idnumber which is an integer.
>
> Im trying to return the idnumber's of any records that contain a known
> idnumber.
>
> The queries I have attempted are:
>
> select idnumber from lists where '10' in groupRead;
> This almost works, but only returns records where there is ONLY 10 listed.
>
> select idnumber from lists where instr(groupRead,'10')<>0;
>
> This query returns too much.. giving me records that contain the number 10,
> but the ones that contain 810 (and not 10) too.
>
> I assume I can probably use a regular expression in the where portion of the
> clause... Anyone know how this is done in Oracle8?
>
> JD
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

Where groupread like '%,10,%';
Of course, it's always possible to add Unix regexp functions to Oracle via external procedures interface....
Mladen Gogala

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Mar 25 1999 - 21:01:35 CST

Original text of this message

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