[Zope-dev] How to use dtml-sqltest tag in zsql method?

Anitha George anithageorge27@hotmail.com
Wed, 23 Jul 2003 10:03:23 +0000


Hi

   Someone please help me out with this:

I am passing a string in this format (215,216) from the python script to
the Zsql method.
The SQl query should have the following form:
   select * from employees where id in (215,216)
but is as follows:
   select * from employees where id in '(215,216)' which does not give the 
required result.The id is of data type string/nb. It doesnt accept integer 
values.


A sample usage is given in the Zope documentation
****************************************
select * from employees
<dtml-sqlgroup where>
<dtml-sqltest salary op="gt" type="float" optional>
<dtml-and>
<dtml-sqltest first type="nb" multiple optional>
<dtml-and>
<dtml-sqltest last type="nb" multiple optional>
</dtml-sqlgroup>

If first=Bob and last=Smith, McDonald it renders:

select * from employees
where
(first='Bob'
and
last in ('Smith', 'McDonald')
)

*****************************************8
But it is not working when I tried it. I get the following result

select * from employees
where
(first='Bob'
and
last = 'Smith,McDonald'
)

Please help me out!!Is there any other type for declaring the database 
fields other than int,float,string and nb.I am using Zope version 2.5.1 . 
The documentation covers Zope 2.5.

Thanks
Anitha

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail