<p dir="ltr">It doesn&#39;t support it. And still we&#39;re looking at luasql driver, not freeswitch or odbc implementations. Just use the LAST_INSERT_ID() function. If it returns weird things, disable autocommit and build your own transactions to be certain you get the right value. And as addition transaction != session != connection when it comes to modern database driving.</p>

<div class="gmail_quote">On May 25, 2013 9:55 PM, &quot;Ken Rice&quot; &lt;<a href="mailto:krice@freeswitch.org">krice@freeswitch.org</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<font face="Monaco, Courier New"><span style="font-size:11pt">I don’t know if mysql even supports the returning keywork...<br>
<br>
The way RETURNING works is its an addon to your insert statements<br>
<br>
INSERT INTO table_foo (col_a, col_b) values (‘foo’, ‘bar’) RETURNING row_id;<br>
<br>
Where row_id is an auto incrementing field such as a SERIAL (sequence) in PGSQL or an auto-increment field in mySQL.<br>
<br>
While this is an “insert” per say, it looks more like a “select” when executing as data is returned<br>
<br>
<br>
<br>
On 5/24/13 10:59 PM, &quot;John M&quot; &lt;<a href="http://j_mj@aol.com" target="_blank">j_mj@aol.com</a>&gt; wrote:<br>
<br>
</span></font><blockquote><span style="font-size:11pt"><font face="Arial"> Hi Seven Du,<br>
<br>
I&#39;d really like to know if this is possible too, couldn&#39;t find it documented anywhere.<br>
<br>
Instead of being cryptic, if you know the answer won&#39;t you please help by explaining what the RETURNING clause is and how to use it?<br>
<br>
Does it somehow return mysql_insert_id()?<br>
<br>
How should we use it.<br>
<br>
You help is invaluable and is contributing to the freeswitch community.<br>
<br>
-Jm<br>
 <br>
 <br>
</font></span><font><font face="Helvetica, Verdana, Arial"><span style="font-size:10pt">-----Original Message-----<br>
From: Seven Du &lt;<a href="http://dujinfang@gmail.com" target="_blank">dujinfang@gmail.com</a>&gt;<br>
To: FreeSWITCH Users Help &lt;<a href="http://freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
Sent: Sat, May 25, 2013 12:52 pm<br>
Subject: Re: [Freeswitch-users] dbh:query - insert id<br>
<br>
 <br>
 Maybe try the RETURNING clause ? <br>
 <br>
</span></font></font></blockquote><font><font face="Helvetica, Verdana, Arial"><span style="font-size:10pt"><br>
</span></font></font><font face="Monaco, Courier New"><span style="font-size:11pt">-- <br>
Ken<br>
<font color="#0000FF"><u><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>
<a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br>
</u></font><a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
</span></font>
</div>


<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div>