<HTML>
<HEAD>
<TITLE>Re: [Freeswitch-users] dbh:query - insert id</TITLE>
</HEAD>
<BODY>
<FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>I don&#8217;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 (&#8216;foo&#8217;, &#8216;bar&#8217;) 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 &#8220;insert&#8221; per say, it looks more like a &#8220;select&#8221; when executing as data is returned<BR>
<BR>
<BR>
<BR>
On 5/24/13 10:59 PM, &quot;John M&quot; &lt;<a href="j_mj@aol.com">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'd really like to know if this is possible too, couldn't find it documented anywhere.<BR>
<BR>
Instead of being cryptic, if you know the answer won'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>
&nbsp;<BR>
&nbsp;<BR>
</FONT></SPAN><FONT SIZE="2"><FONT FACE="Helvetica, Verdana, Arial"><SPAN STYLE='font-size:10pt'>-----Original Message-----<BR>
From: Seven Du &lt;<a href="dujinfang@gmail.com">dujinfang@gmail.com</a>&gt;<BR>
To: FreeSWITCH Users Help &lt;<a href="freeswitch-users@lists.freeswitch.org">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>
&nbsp;<BR>
&nbsp;Maybe try the RETURNING clause ? <BR>
&nbsp;<BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE="2"><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">http://www.FreeSWITCH.org</a><BR>
<a href="http://www.ClueCon.com">http://www.ClueCon.com</a><BR>
<a href="http://www.OSTAG.org">http://www.OSTAG.org</a><BR>
</U></FONT>irc.freenode.net #freeswitch<BR>
</SPAN></FONT>
</BODY>
</HTML>