Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> is LIKE statement limited?
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 Sat Jan 15 2000 - 20:57:03 CST
![]() |
![]() |