<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yes, I must do it when I need to know an autonumber PK after an insert.<br>
when DB support transaction i write:<br>
<br>
begin transaction<br>
<pre wrap="">insert foo into bar
<dtml-var sql_delimiter>
SELECT LAST_INSERT_ID() as lastid</pre>
commit<br>
<br>
Then, a DTML method:<br>
<br>
<dtml-in myZSQLinsertandselect()><br>
<dtml-var lastid><br>
</dtml-in><br>
<br>
Make the insert and write the id returned by the select.<br>
<br>
Illorca<br>
<br>
Gaute Amundsen ha scritto:
<blockquote cite="mid200703091520.44625.gaute@div.org" type="cite">
<pre wrap="">On Friday 09 March 2007 10:12, Remil Mathew wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
How can run multiple query in an Z sql method.. I am using Mysql..
Also is there any method to return a value from insert query?
Thanks
Remil
</pre>
</blockquote>
<pre wrap=""><!---->
could you possibly be thinking of?
insert foo into bar
<dtml-var sql_delimiter>
SELECT LAST_INSERT_ID()
gaute
_______________________________________________
Zope maillist - <a class="moz-txt-link-abbreviated" href="mailto:Zope@zope.org">Zope@zope.org</a>
<a class="moz-txt-link-freetext" href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</a>
** No cross posts or HTML encoding! **
(Related lists -
<a class="moz-txt-link-freetext" href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a>
<a class="moz-txt-link-freetext" href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev</a> )
.
</pre>
</blockquote>
<br>
</body>
</html>