[Zope] Using LIMIT in a SQLMethod

Andy Dustman andy@dustman.net
Fri, 9 Feb 2001 11:15:01 -0500 (EST)


On Fri, 9 Feb 2001, Harald Stowasser wrote:

> Hello, i want to use the LIMIT funktion from MySql with a ZSQLMethode.
> But i'll get an error. Becourse ZSQL makes a second LIMIT in the
> SQL-string (options in 'Advanced')
> 
> See, i will do:
> 
> SELECT * FROM thema
> WHERE FK_forum_id=1
> LIMIT 10,50
> 
> But it raises that:
> 
> Fehler in der Syntax bei 'LIMIT 1000' in Zeile 6
> (Error in Syntax by 'LIMIT 1000' at line 6)
> 
> What can i do?

Get ZMySQLDA-2.0.4 and MySQLdb-0.3.2 and set max_rows on your Z SQL Method
to zero (check Properties tab). This will prevent ZMySQLDA from adding
it's own LIMIT clause based on max_rows.

-- 
Andy Dustman         PGP: 0xC72F3F1D
    @       .net     http://dustman.net/andy
"Normally with carbonara you use eggs, but I used lobster brains instead."
    -- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle