[Zope] CheckBoxes, dynamic lists and SQL insert statements

Julian Clark Julian.Clarke@b-online.com.au
Tue, 15 Jul 2003 20:56:13 +0800


This is a multi-part message in MIME format.

------=_NextPartTM-000-8c561044-fc70-4ffb-8cb6-f700cb908f83
Content-type: multipart/alternative;
	boundary="----=_NextPart_000_002E_01C34B13.86B0EE70"

------=_NextPart_000_002E_01C34B13.86B0EE70
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,
I'm feeling rather thick, as I've been reading through some of a similar =
question from about 2 years back=20

( http://mail.zope.org/pipermail/zope/2001-August/097408.html )=20

and I'm not quite understanding it.

What I am trying to achieve is to pull some date from one table by an =
SQL query, and have the results selectable/de-selectable by the form of =
a checkbox - to then be dumped into a temporary table.

I'm guessing that it's probably something simple, and I'm just too close =
to the code.

This here is my selection via checkbox form.. this seems to pass the =
information to my next step ok...
I believe that I have a problem with how I am interpreting this data.

<!-- form 2 -->
<form action=3D"meth_step_2" name=3D"form2">
<table>
  <!--#in dealer_entity_search -->
      <tr>
    <td>
          <input type=3D'checkbox' name=3D'marketinglist:list' checked =
value=3D'<!--#var dealer_code -->'></input>
          <!--#var dealer_code --></td>
   <td><!--#var dealer_name --></td>
     </tr>
  <!--#/in --><TR><TD><button type=3D"submit">Add</button></TD></TR>
  </form>
</table>

<!-- meth_step_2 -->
<!--#with sql -->
    <!--#in marketinglist -->
      <!--#let dealer_code=3Dsequence-item -->
        <!--#call insert_holding_table -->
      <!--#/let -->
    <!--#/in -->

<!--#/with -->

<!-- insert_holding_table -->
insert into mHoldingTable
(
dealer_code
)
values
(
<dtml-sqlvar dealer_code type=3D"string" >
);

What I am wanting to appear in the holding table is a whole lot of =
separate records, each containing only a dealer_code (which is a 4 digit =
integer - text field in the DB though)=20
I'm using Zope 2.3.3 attempting to inserting into MS Access 2000.

Thanks in advance.
______________________________________________________
______________________________________________________
Julian Clark=20
julcla@b-online.com.au=20
Ph: +61 8 9463 5069=20
______________________________________________________=20

------=_NextPart_000_002E_01C34B13.86B0EE70
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm feeling rather thick, as I've been =
reading=20
through some of a similar question from about 2 years back </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>( <A=20
href=3D"http://mail.zope.org/pipermail/zope/2001-August/097408.html">http=
://mail.zope.org/pipermail/zope/2001-August/097408.html</A>&nbsp;)=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and I'm not quite understanding =
it.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What I am trying to achieve is to pull =
some date=20
from one table by an SQL query, and have the results =
selectable/de-selectable by=20
the form of a checkbox - to then be dumped into a temporary =
table.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm guessing that it's probably =
something simple,=20
and I'm just too close to the code.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This here is my selection via checkbox =
form.. this=20
seems to pass the information to my next step ok...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I believe that I have a problem with =
how I am=20
interpreting this data.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;!-- form 2 --&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;form action=3D"meth_step_2"=20
name=3D"form2"&gt;<BR>&lt;table&gt;<BR>&nbsp; &lt;!--#in =
dealer_entity_search=20
--&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;input=20
type=3D'checkbox' name=3D'marketinglist:list' checked =
value=3D'&lt;!--#var dealer_code=20
--&gt;'&gt;&lt;/input&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
&lt;!--#var dealer_code --&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; =
&lt;td&gt;&lt;!--#var=20
dealer_name --&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;/tr&gt;<BR>&nbsp;=20
&lt;!--#/in --&gt;&lt;TR&gt;&lt;TD&gt;&lt;button=20
type=3D"submit"&gt;Add&lt;/button&gt;&lt;/TD&gt;&lt;/TR&gt;<BR>&nbsp;=20
&lt;/form&gt;<BR>&lt;/table&gt;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;!-- meth_step_2 --&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;!--#with sql =
--&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;!--#in marketinglist --&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;!--#let=20
dealer_code=3Dsequence-item =
--&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;!--#call insert_holding_table =
--&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;!--#/let --&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;!--#/in =
--&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;!--#/with --&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV></FONT>
<DIV><FONT face=3DArial size=3D2>&lt;!-- insert_holding_table =
--&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>insert into=20
mHoldingTable<BR>(<BR>dealer_code<BR>)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>values<BR>(<BR>&lt;dtml-sqlvar =
dealer_code=20
type=3D"string" &gt;<BR>);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What I am wanting to appear in the =
holding table is=20
a whole lot of separate records, each containing only a dealer_code =
(which is a=20
4 digit integer - text field in the DB though) </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm using Zope 2.3.3 attempting to =
i</FONT><FONT=20
face=3DArial size=3D2>nserting into MS Access 2000.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3Dverdana><FONT color=3Dred =
size=3D1><FONT=20
face=3Dverdana>
<MARQUEE id=3DMarquee1 style=3D"WIDTH: 250px" trueSpeed scrollAmount=3D1 =

scrollDelay=3D10 direction=3Dright behavior=3Dslide loop=3D1 =
border=3D"0"><FONT=20
color=3Dblack=20
size=3D1>______________________________________________________</FONT></M=
ARQUEE><BR>
<MARQUEE id=3DMarquee2 style=3D"WIDTH: 250px" trueSpeed scrollAmount=3D1 =

scrollDelay=3D10 direction=3Dright behavior=3Dslide loop=3D1 =
border=3D"0"><FONT=20
color=3Dblack=20
size=3D1>______________________________________________________</FONT></M=
ARQUEE><BR>
<MARQUEE id=3DMarquee3 style=3D"WIDTH: 250px; HEIGHT: 29px" trueSpeed =
scrollAmount=3D1=20
scrollDelay=3D7 direction=3Dright behavior=3Dalternate loop=3D4 =
border=3D"0"><STRONG><FONT=20
color=3D#800000 size=3D4>Julian Clark </FONT></STRONG></MARQUEE><BR>
<MARQUEE id=3DMarquee8 style=3D"FONT-SIZE: 10pt; WIDTH: 235px; HEIGHT: =
17px"=20
trueSpeed scrollAmount=3D1 scrollDelay=3D30 behavior=3Dslide loop=3D1 =
border=3D"0"><A=20
href=3D"MAILTO:JULCLA@B-ONLINE.COM.AU">julcla@b-online.com.au</AHREF>=20
</A></MARQUEE><BR>
<MARQUEE id=3DMarquee7 style=3D"FONT-SIZE: 10pt; WIDTH: 235px; HEIGHT: =
17px"=20
trueSpeed scrollAmount=3D1 scrollDelay=3D40 behavior=3Dslide loop=3D1 =
border=3D"0"><FONT=20
color=3D#808000 size=3D1><STRONG>Ph: +61 8 9463 5069</STRONG>=20
</FONT></MARQUEE><BR><FONT color=3Dred size=3D1>
<MARQUEE id=3DMarquee5 style=3D"WIDTH: 250px" trueSpeed scrollAmount=3D1 =

scrollDelay=3D10 direction=3Dright behavior=3Dslide loop=3D1 =
border=3D"0"><FONT=20
color=3Dblack =
size=3D1>______________________________________________________=20
</FONT></FONT></MARQUEE></FONT></FONT></FONT></FONT></FONT></DIV></BODY><=
/HTML>

------=_NextPart_000_002E_01C34B13.86B0EE70--


------=_NextPartTM-000-8c561044-fc70-4ffb-8cb6-f700cb908f83--