[Zope-DB] zsql method w/ more than one field failing?

Dieter Maurer dieter@handshake.de
Wed, 28 May 2003 23:48:49 +0200


Christopher Heschong wrote at 2003-5-27 18:08 -0400:
 > OK, I have a very simple sql method.  It has 2 arguments (inet, client_hostname).  Here's the text of the 
 > method:
 > 
 > select * from lease
 >   <dtml-sqlgroup where>
 >     <dtml-sqltest inet type=nb op=eq optional>
 >   <dtml-and>
 >     <dtml-sqltest client_hostname type=nb op=eq optional>
 >   </dtml-sqlgroup>
 > 
 > When I click on "test" and put in the value 'a' for inet and the value 'b' for client_hostname, it returns this 
 > sql query:
 > 
 > select * from lease
 >   where
 > client_hostname = 'b'

This looks like a bug...

Please verify in "var/Z2.log" (that's the ZServer log file) that
all arguments are correctly passed.


Some Zope versions has a bug causing acquired values to take
precedence before arguments passed into the ZSQL Method.
Maybe, your "inet" is acquired?

 > When I add more fields, it only uses the last field in the SQL query.  Ack!

Strange and buggy...

However, I already used it successfully. Therefore, probably some
environmental specificty.


Dieter