[Zope] ZSQL optional variables?

Ulrich Wisser u.wisser@luna-park.de
Fri, 10 Dec 1999 17:33:22 +0100


Hello,

in ZSQL I would like to make some test optional. Here a
small example:

SELECT * DEMO
<dtml-sqlgroup where>
  <dtml-if var1>
    <dtml-sqltest var1 type=int>
  </dtml-if>
  <dtml-and>
  <dtml-if var2>
    <dtml-sqltest var2 type=string optional>
  </dtml-if>
</dtml-sqlgroup>

No I want it to take var1 and var2 from the REQUEST or
from arguments specified at dtml-call or no argument at all.

1. my.url?var1=5

2. <dtml-in "zsql_method(var1=5)">

3. <dtml-in zsql_method>

I tried to define arguments in the ZSQL form, but then I need
to gibe var1/var2 as arguments (but I want them to be optional).
When I tried to give default values like (var1:int=0) the
<dtm-if var1> always eval to true so that the SQL statement
tests for var1.

How can I make arguments to ZSQL fully optional?

Thanks

Ulli

-- 
----------------- Die Website Effizienzer ------------------
luna-park                Bravo Sanchez, Vollmert, Wisser GbR
Ulrich Wisser                   mailto:u.wisser@luna-park.de
Alter Schlachthof, Immenburgstr. 20      Tel +49-228-9654055
D-53121 Bonn                             Fax +49-228-9654057
------------------http://www.luna-park.de ------------------