<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content=text/html;charset=ISO-8859-1>
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT face=Arial size=2>when you do an insert with a ZSQL method you do not
get back any info from mysql, you need to do a subsequent search to get
'autogenerated' columns. So do your insert, then do an ZSQL search.
The search returns a 'Results' object which has several methods you can use to
get at the search results.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In a python script try something like:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>rstat=context.UserActivity.SQL_SearchEvents(userId='111')
#substitute your own zsql search</FONT></DIV>
<DIV><FONT face=Arial size=2>print 'rstat= ', rstat<BR>print 'rstat.names=
',rstat.names()<BR>print 'rstat.tuples= ',rstat.tuples()<BR>print 'rstat.asRDB=
',rstat.asRDB()<BR>print 'rstat.data_dictionary=
',rstat.data_dictionary()<BR>print 'rstat.dictionaries=
',rstat.dictionaries()</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>hth</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ben@infotechsc.com href="mailto:ben@infotechsc.com">Benjamin
Menking</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org
href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, July 17, 2006 1:01 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] ZSQL Method
Question</DIV>
<DIV><BR></DIV><FONT face=Verdana>New to python/Zope, old-timer on
PHP....<BR><BR>I'm using MySQL and a ZSQL method to insert data into the
database. ex:<BR><BR> insert into org (org_name,
org_phone) values ('x', 'y')<BR><BR>What I'm trying to figure out is that
org_id (also part of the org table, but not specified in the sql statement) is
an auto_increment primary key field and in PHP I can use mysql_insert_id() to
find out what org_id was set to after the mysql_query() call.<BR><BR>Is there
a way to retrieve that value with ZSQL method, or must I use some other
mechanism?<BR><BR>Thanks!<BR></FONT><PRE class=moz-signature cols="72">--
Ben Menking RHCE
IT Security Consulting
(864) 420-5603
(864) 751-1638 fax
IT and Business Solutions</PRE>
<P>
<HR>
<P></P>_______________________________________________<BR>Zope maillist
-
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BODY></HTML>