<!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><dtml-var
standard_html_header><BR><BR><!-- Check to see if the form has been
submitted --><BR>
<dtml-if submit><BR>
<dtml-try><BR>
<dtml-call
"AddBuyerForm.validate_all_to_request(REQUEST)"><BR>
<dtml-except
FormValidationError><BR>
<ul><BR>
<dtml-in
"error_value.errors"><BR>
<li><BR>
<dtml-var
"field.get_value('title')">:<BR>
<dtml-var
error_text><BR>
</li><BR>
</dtml-in><BR>
</ul><BR>
<dtml-else><BR>
<!-- Update the database with the
new values --><BR><FONT color=#ff0000
size=3>
<dtml-call
"add_buyer(REQUEST)"> <!-- this calles the sql method to insert the data
into the database
---></FONT><BR><BR>
</dtml-try><BR>
</dtml-if><BR><BR><!-- Show the header of the form, using 'Form action'
and 'Form method' from settings<BR>
(form action="..."
method="...">)<BR>
---><BR><dtml-var "AddBuyerForm.header()"><BR><form
action=addbuyer><BR><BR><table border="0"><BR><BR><!--- get a list
of all the fields in the form ---><BR><dtml-in
"AddBuyerForm.get_fields()"><BR><BR><!--- rename each sequence item to
field so they can be used more easily ---><BR><dtml-let
field=sequence-item><BR><BR><tr><BR><td><dtml-var
"field.get_value('title')"></td><BR><td><dtml-var
"field.render()"></td><BR></tr><BR><BR></dtml-let><BR></dtml-in><BR><BR><tr><BR><td><input
type="submit" value="Submit"
name="submit"></td><BR></tr><BR><BR></table><BR><BR><dtml-var
"AddBuyerForm.footer()"><BR><BR><dtml-var
standard_html_foo<BR>******************************************************************************************************************************************************<BR><BR><BR>Data
below was obtained from ZOPE by using ftp <BR>this is the add_buyer
method</FONT><FONT
size=2><BR>******************************************************************************************************************************************************<BR><params>buyer_name_last
buyer_name_first buyer_name_mi buyer_phone_home buyer_phone_work
buyer_phone_cell buyer_email_primary buyer_address_street
buyer_address_city buyer_address_state buyer_address_zip
</params><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><dtml-sqlvar
buyer_name_first type="string">,<BR><dtml-sqlvar buyer_name_last
type="string">,<BR><dtml-sqlvar buyer_name_mi
type="string">,<BR><dtml-sqlvar buyer_phone_home
type="string">,<BR><dtml-sqlvar buyer_phone_work
type="string">,<BR><dtml-sqlvar buyer_phone_cell
type="string">,<BR><dtml-sqlvar buyer_email_primary
type="string">,<BR><dtml-sqlvar buyer_address_street
type="string">,<BR><dtml-sqlvar buyer_address_city
type="string">,<BR><dtml-sqlvar buyer_address_state
type="string">,<BR><dtml-sqlvar buyer_address_zip
type="string"><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? 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. 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> <BR>
<BR>__________________________________<BR>Do
you Yahoo!?<BR>Friends. Fun. 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>