Re: Problem with <dtml-sqltest ... multiple> feature

"Jaroslav Lukesh" <[email protected]> Thu, 14 Feb 2008 12:07:56 +0100
Newsgroups gmane.comp.web.zope.database
Message-ID <184901c86ef9$db62b390$6164a8c0@xp>
Try to set url_name as ['HI','RF'] and use property without datatype, like

<params>
url_name
...
</params>

And of course, look at ZopeBook.

Personally I dont use sqltest nor sqlgroup because there are many caveats 
with queries to cooperate with other zope unfriendly SQL developers. I use 
dtml-in inside ZSQL method with parameters defined as above.

----- Original Message ----- 
From: "Ken Winter" <[email protected]>

select
    organization_id, name, url_name, short_name
from
    organization
<dtml-sqlgroup where>
    <dtml-and> <dtml-sqltest organization_id op="eq" type="int" multiple
optional>
    <dtml-and> <dtml-sqltest url_name op="eq" type="nb" multiple optional>
    <dtml-and> <dtml-sqltest name op="eq" type="nb" multiple optional>
</dtml-sqlgroup>

doesn't work properly when I give it "a sequence of values to test the
condition against", which is what the "multiple" tag is supposed to allow
according to http://www.plope.com/Books/2_7Edition/AppendixA.stx#1-15 .
When I enter (for example) the string "HI, RF" (without the surrounding
quotes) into the url_name field on the ZSQL method's ZMI Test tab, it
returns no records and says that the SQL it generated was:

select
    organization_id, name, url_name, short_name
from
    organization
where
url_name = 'HI, RF'

If I enter a series of integers such as "11530, 11531" (again, minus the "s)
into the organization_id field, it returns the error message:

Invalid integer value for organization_id

Entering a single value into any of these fields works fine.  I have tried
various ways of quoting, delimiting, and otherwise punctuating my
multiple-value arguments, to no avail.

Is this problem just because the "multiple" feature doesn't work when tested
in the ZMI?  If so, can you tell me the correct way to type and format the
multiple-valued arguments when calling the ZSQL method from Python or from a
Page Template?

b