[Zope] Writing to SQL Databases

Ross J. Reedstrom reedstrm@wallace.ece.rice.edu
Mon, 19 Jul 1999 13:07:14 -0500


On Mon, Jul 19, 1999 at 11:32:01AM -0400, Sean McMains wrote:
> Hi folks,
> 
> I've been working with Zope for a month or two now off and on, trying to
> figure out how to port several of my existing websites to Zope, since it
> will make my life much easier and more pleasant. (I really am impressed with
> the work you've done, DC folks! Great job!) 
> 
> One area that's giving me fits right now is inserting data into a SQL
> Database. By working with the existing documentation and sample code, I've
> gotten database connections set up and templates built, but am missing
> something at the insert phase.
> 
> Here's the template I'm using:
> 
> ID: addEntry
> Arguments: nameField emailField maidenField yearField websiteField
> 
> Query Template:
> insert into alumDirectory
> (ALUMNAME,
>  ALUMEMAIL,
>  ALUMMAIDEN,
>  ALUMYEAR,
>  ALUMWWW
> ) 
> values 
> (<!--#sqlvar nameField type=string-->,
>  <!--#sqlvar emailField type=string-->,
>  <!--#sqlvar maidenField type=string-->,
>  <!--#sqlvar yearField type=string-->,
>  <!--#sqlvar websiteField type=string-->
> )
> 
> I've verified that this template works when I use the TEST function. But
> when I try to call it:
> 
> <!--#call addEntry.manage_test(REQUEST)-->
> 

<!--#call addEntry(REQUEST)-->

or perhaps

<!--#call addEntry(REQUEST=REQUEST)-->

should do it.

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005