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: Reverse Wildcard Searches Impossible?

Re: Reverse Wildcard Searches Impossible?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Sat, 01 May 2004 04:03:14 GMT
Message-ID: <6kFkc.1749$Ia6.204238@attbi_s03>

"Erland Sommarskog" <sommar_at_algonet.se> wrote in message news:Xns94DC31A1B00CYazorman_at_127.0.0.1...
> David Best (davebest_at_usa.net) writes:
> > Works fine for me on Oracle:
> >
> > C:\>sqlplus
> > Connected to Oracle9i Enterprise Edition Release 9.2.0.1.0
> >
> > SQL> create table blacklist (pattern varchar2(255));
> >
> > Table created
> >
> > SQL> insert into blacklist (pattern) values ('%foobar.com');
> >
> > 1 row inserted
> >
> > SQL> select * from blacklist where 'mars2.foobar.com' like pattern;
>
> And the same example (save the funny varchar2) works on MS SQL Server too.
>
> And should work on about any DBMS, as this is core SQL.
>
> --
> Erland Sommarskog, SQL Server MVP, sommar_at_algonet.se
>
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

It should work, but the query is going to be very inefficient. Jim Received on Fri Apr 30 2004 - 23:03:14 CDT

Original text of this message

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