Re: Select Statement size errors

From: Georg Horn (horn@koblenz-net.de)
Date: Mon Oct 25 1999 - 15:45:12 EST


Hi,

> I'm running a search using a Perl CGI script on a BSD machine (intel
> processor). It's running queries against a msql 2.0.3 database (yes I
> know they should upgrade but it just isn't going to happen).

Yes, they really should upgrade...

> However, the database is grown to the point that I now get an error
> stating that my where clause is too large (too many conditions). I am
> getting around 65 to 70 items in the where clause.
>
> An example,
>
> SELECT x, y, z
> FROM table_a
> WHERE
> some conditions AND
> ( x = 1 or x = 2 or x = 4 ... or x = 159 )

Can't you write this as (x > 1 and x < 4 and ...) ?
Yes i know, this will only work if you have more than 2 continous values...
Otherwise you'll have to split your query into two or more queries.

Bye,
Georg

-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/



This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:03:52 EST