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: is LIKE statement limited?

Re: is LIKE statement limited?

From: Andre Whittick Nasser <awnasser_at_openlink.com.br>
Date: Sun, 16 Jan 2000 11:34:31 -0200
Message-ID: <85srtg06v2@enews3.newsguy.com>


Hi,

Going through the Oracle SQL reference, I was not able to find any limitations to the use of LIKE.I may not have understood it, but why do you use '%%' ? As far as I know, it means ANY STRING + ANY STRING, which is the same as ANY STRING. Why don't you simply use LIKE '%' ? Is there a space between the two %'s ? Anyway, this is the best I can do...

Take a look yourself at the LIKE function as described in the SQL reference. It SHOULD be fully documented there.

Hope this helps

dbrah_at_my-deja.com escreveu na mensagem <85rc1q$m3b$1_at_nnrp1.deja.com>...
>I have a big SELECT statement with many LIKE commands and it works fine
>if I only use 5 LIKE statements). Any more than 5 and it doesn't return
>anything. The SELECT is built dynamically from a web form using Perl and
>DBI/DBD::Oracle. I'm using Oracle 8i.
>
>SELECT * FROM filearchive WHERE (company LIKE '%%') AND (source LIKE
>'%%') AND (region LIKE '%%') AND (solution LIKE '%%') AND (technology
>LIKE '%%') AND (subject LIKE '%%') AND (summary LIKE '%%') AND (author
>LIKE '%%') AND (filetype LIKE '%%')
>
>All these fields (except author & filetype) can contain multiple terms
>separated by spaces so this was the only way I can figure out to create
>one SELECT to work for all cases. The web form I have allows users to
>select keywords from lists of categories and return a list of matching
>files. If a category is not chosen, LIKE '%%' is used because it acts
>as a simple placeholder or "don't care" which works great.
>
>This statement works fine (it has just 5 LIKE calls):
>
>SELECT * FROM filearchive WHERE (region LIKE '%%') AND (solution LIKE
>'%%') AND (summary LIKE '%%') AND (author LIKE '%%') AND (filetype LIKE
>'%Excel%')
>
>Is this a limitation of Oracle 8i? Is there a better way to do what I
>need to do?
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Sun Jan 16 2000 - 07:34:31 CST

Original text of this message

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