[Zope] ZSQL Method: Update using a list as an argument

Dilley, Hara hara@sunesis.com
Fri, 27 Sep 2002 15:27:15 -0700


This is a multi-part message in MIME format.

------_=_NextPart_001_01C26675.08160872
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I have a zsql method that takes 3 arguments (value1, value2, value3)  I =
would like value3 to be a list for an "in" where clause.  value3 is =
taken from a textarea form element.
the sql method looks like this:
update sometable=20
set field1 =3D <dtml-sqlvar value1 type=3D"int">,
field2 =3D <dtml-sqlvar value2 type=3D"int">,
where <dtml-sqltest value3 op=3Deq type=3Dnb multiple optional>=20

of course the above is not working.  My question is what type of =
argument do I have to pass in order to have a where clause look like=20
where field3 in ('text1', 'text2', text3',,,)

Thanks

Hara



------_=_NextPart_001_01C26675.08160872
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.5762.3">
<TITLE>ZSQL Method: Update using a list as an argument</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">I have a zsql method that takes 3 =
arguments (value1, value2, value3)&nbsp; I would like value3 to be a =
list for an &quot;in&quot; where clause.&nbsp; value3 is taken from a =
textarea form element.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">the sql method looks like this:</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">update sometable </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">set field1 =3D &lt;dtml-sqlvar value1 =
type=3D&quot;int&quot;&gt;,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">field2 =3D &lt;dtml-sqlvar value2 =
type=3D&quot;int&quot;&gt;,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">where &lt;dtml-sqltest value3 op=3Deq =
type=3Dnb multiple optional&gt; </FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">of course the above is not =
working.&nbsp; My question is what type of argument do I have to pass in =
order to have a where clause look like </FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">where field3 in ('text1', 'text2', =
text3',,,)</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hara</FONT>
</P>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C26675.08160872--