[Zope-dev] usage of dtml-sqltest tag in Zsql method
Anitha George
anithageorge27@hotmail.com
Wed, 23 Jul 2003 07:08:36 +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
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail