<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>

<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<P><FONT size=2>Zsql methods are your answer.<BR><BR>check <A 
href="http://zope.org/Documentation/Books/ZopeBook/2_6Edition/RelationalDatabases.stx" 
target=_blank>http://zope.org/Documentation/Books/ZopeBook/2_6Edition/RelationalDatabases.stx</A><BR><BR>here 
is a sample zsql method obtained by using fpt port on zope to download.<BR>by 
using a form to gather the data then passing the REQUEST object to the following 
method data is inserted into the database.<BR><BR><BR><BR><BR>DTML method to get 
data and update 
database<BR>******************************************************************************************************************************************************<BR>&lt;dtml-var 
standard_html_header&gt;<BR><BR>&lt;!-- Check to see if the form has been 
submitted --&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dtml-if submit&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
&lt;dtml-try&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-call 
"AddBuyerForm.validate_all_to_request(REQUEST)"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dtml-else&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Update the database with the 
new values --&gt;<BR><FONT color=#ff0000 
size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-call 
"add_buyer(REQUEST)"&gt; &lt;!-- this calles the sql method to insert the data 
into the database 
---&gt;</FONT><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/dtml-try&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
&lt;/dtml-if&gt;<BR><BR>&lt;!-- Show the header of the form, using 'Form action' 
and 'Form method' from settings<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (form action="..." 
method="..."&gt;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
---&gt;<BR>&lt;dtml-var&nbsp; "AddBuyerForm.header()"&gt;<BR>&lt;form 
action=addbuyer&gt;<BR><BR>&lt;table border="0"&gt;<BR><BR>&lt;!--- get a list 
of all the fields in the form ---&gt;<BR>&lt;dtml-in 
"AddBuyerForm.get_fields()"&gt;<BR><BR>&lt;!--- rename each sequence item to 
field so they can be used more easily ---&gt;<BR>&lt;dtml-let 
field=sequence-item&gt;<BR><BR>&lt;tr&gt;<BR>&lt;td&gt;&lt;dtml-var 
"field.get_value('title')"&gt;&lt;/td&gt;<BR>&lt;td&gt;&lt;dtml-var 
"field.render()"&gt;&lt;/td&gt;<BR>&lt;/tr&gt;<BR><BR>&lt;/dtml-let&gt;<BR>&lt;/dtml-in&gt;<BR><BR>&lt;tr&gt;<BR>&lt;td&gt;&lt;input 
type="submit" value="Submit" 
name="submit"&gt;&lt;/td&gt;<BR>&lt;/tr&gt;<BR><BR>&lt;/table&gt;<BR><BR>&lt;dtml-var 
"AddBuyerForm.footer()"&gt;<BR><BR>&lt;dtml-var 
standard_html_foo<BR>******************************************************************************************************************************************************<BR><BR><BR>Data 
below was obtained from ZOPE&nbsp; by using ftp <BR>this is the add_buyer 
method</FONT><FONT 
size=2><BR>******************************************************************************************************************************************************<BR>&lt;params&gt;buyer_name_last 
buyer_name_first buyer_name_mi buyer_phone_home&nbsp; buyer_phone_work 
buyer_phone_cell&nbsp; buyer_email_primary buyer_address_street 
buyer_address_city buyer_address_state buyer_address_zip 
&lt;/params&gt;<BR>insert into 
buyer<BR>(<BR>buyer_id,<BR>buyer_name_last,<BR>buyer_name_first,<BR>buyer_name_mi,<BR>buyer_phone_home,<BR>buyer_phone_work,<BR>buyer_phone_cell,<BR>buyer_email_primary,<BR>buyer_address_street,<BR>buyer_address_city,<BR>buyer_address_state,<BR>buyer_address_zip)<BR>Values(<BR>nextval('buyer_buyer_id_seq')<BR>&lt;dtml-sqlvar 
buyer_name_first type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_name_last 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_name_mi 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_phone_home 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_phone_work 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_phone_cell 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_email_primary 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_address_street 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_address_city 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_address_state 
type="string"&gt;,<BR>&lt;dtml-sqlvar buyer_address_zip 
type="string"&gt;<BR>)<BR>******************************************************************************************************************************************************<BR><BR>-----Original 
Message-----<BR>From: Justin M. Keyes [<A 
href="mailto:m9u35@yahoo.com">mailto:m9u35@yahoo.com</A>]<BR>Sent: June 09, 2004 
3:14 PM<BR>To: zope-db list<BR>Subject: [Zope-DB] newbie--Putting Zope data into 
MSSQL<BR><BR><BR>Hi,<BR>I've set up the ZODBCDA and successfully *pulled* data 
from MSSQL using an Z<BR>SQL query. But, I do not know how to *put* Zope data 
into the MSSQL database.<BR>I'm very new to databases--does SQL have commands to 
"push" data?&nbsp; Stupid<BR>question I'm sure...<BR><BR>I've read that ZODB can 
export itself to an XML file and then I can parse it<BR>from there.&nbsp; Is 
that the only way to get data from ZODB, or can I somehow use<BR>the ZODBCDA for 
my purpose?<BR><BR>Thanks so 
much.<BR><BR>Justin<BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>__________________________________<BR>Do 
you Yahoo!?<BR>Friends.&nbsp; Fun.&nbsp; Try the all-new Yahoo! Messenger.<BR><A 
href="http://messenger.yahoo.com/" 
target=_blank>http://messenger.yahoo.com/</A><BR><BR>_______________________________________________<BR>Zope-DB 
mailing list<BR>Zope-DB@zope.org<BR><A 
href="http://mail.zope.org/mailman/listinfo/zope-db" 
target=_blank>http://mail.zope.org/mailman/listinfo/zope-db</A><BR></P></FONT></BODY></HTML>