<font color='black' size='2' face='Arial, Helvetica, sans-serif'>Yep<font size="2">, super helpful..&nbsp; /sarcasm<br>
<br>
Point us to general sql related pages, none of which are related to freeswitch and the way the language interacts with the db ..<br>
<br>
We all know that insert_id exists that's why we are asking. What we don't know is how specifically the freeswitch:dbh handler interacts and can return the inserted record id.<br>
</font><font color="black" face="Arial, Helvetica, sans-serif" size="2">
<div> <br>

</div>



<div> <br>

</div>



<div style="font-family:helvetica,arial;font-size:10pt;color:black">-----Original Message-----<br>

From: William King &lt;william.king@quentustech.com&gt;<br>

To: freeswitch-users &lt;freeswitch-users@lists.freeswitch.org&gt;<br>

Sent: Sat, May 25, 2013 11:24 pm<br>

Subject: Re: [Freeswitch-users] dbh:query - insert id<br>

<br>






<div id="AOLMsgPart_0_b58be040-0c53-4371-99ef-272ca19d7c8e" style="margin: 0px;font-family: Tahoma, Verdana, Arial, Sans-Serif;font-size: 12px;color: #000;background-color: #fff;">

<pre style="font-size: 9pt;"><tt><a href="http://lmgtfy.com/?q=sql+returning+clause" target="_blank">http://lmgtfy.com/?q=sql+returning+clause</a>

<a href="http://en.wikipedia.org/wiki/Insert_%28SQL%29#Retrieving_the_key" target="_blank">http://en.wikipedia.org/wiki/Insert_%28SQL%29#Retrieving_the_key</a>

<a href="http://www.postgresql.org/docs/9.2/static/sql-insert.html" target="_blank">http://www.postgresql.org/docs/9.2/static/sql-insert.html</a>

Much less useful unless you have no other choice than to use mysql:
<a href="http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id</a>

William King
Senior Engineer
Quentus Technologies, INC
1037 NE 65th St Suite 273
Seattle, WA 98115
Main:   (877) 211-9337
Office: (206) 388-4772
Cell:   (253) 686-5518
<a href="mailto:william.king@quentustech.com">william.king@quentustech.com</a>

On 05/24/2013 08:59 PM, John M wrote:
&gt; Hi Seven Du,
&gt; 
&gt; I'd really like to know if this is possible too, couldn't find it
&gt; documented anywhere.
&gt; 
&gt; Instead of being cryptic, if you know the answer won't you please help
&gt; by explaining what the RETURNING clause is and how to use it?
&gt; 
&gt; Does it somehow return mysql_insert_id()?
&gt; 
&gt; How should we use it.
&gt; 
&gt; You help is invaluable and is contributing to the freeswitch community.
&gt; 
&gt; -Jm
&gt; 
&gt; 
&gt; -----Original Message-----
&gt; From: Seven Du &lt;<a href="mailto:dujinfang@gmail.com">dujinfang@gmail.com</a>&gt;
&gt; To: FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&gt;
&gt; Sent: Sat, May 25, 2013 12:52 pm
&gt; Subject: Re: [Freeswitch-users] dbh:query - insert id
&gt; 
&gt; Maybe try the RETURNING clause ?
&gt; 
&gt; -- 
&gt; Seven Du
&gt; <a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a>
&gt; <a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a>
&gt; <a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a>
&gt; 
&gt; Sent with Sparrow &lt;<a href="http://www.sparrowmailapp.com/?sig" target="_blank">http://www.sparrowmailapp.com/?sig</a>&gt;
&gt; 
&gt; On Saturday, May 25, 2013 at 8:14 AM, Lloyd Aloysius wrote:
&gt;&gt; Hello All
&gt;&gt;
&gt;&gt; How to get the id value after insert a record a record using dbh:query
&gt;&gt;
&gt;&gt; _table_a - columns_.
&gt;&gt;
&gt;&gt; id - auto increment
&gt;&gt; field1
&gt;&gt; field2
&gt;&gt;
&gt;&gt;
&gt;&gt; dbh:query("insert into table_a ( field1,field2) values ('11','Test')")
&gt;&gt;
&gt;&gt;
&gt;&gt; After insert how to get the table_a - id value for the inserted record?
&gt;&gt;
&gt;&gt; Thanks
&gt;&gt; Lloyd
&gt;&gt; _________________________________________________________________________
&gt;&gt; Professional FreeSWITCH Consulting Services:
&gt;&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a> &lt;<a href="mailto:consulting@freeswitch.org?">mailto:consulting@freeswitch.org</a>&gt;
&gt;&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>
&gt;&gt;
&gt;&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server
&gt;&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>
&gt;&gt;
&gt;&gt; Official FreeSWITCH Sites
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
&gt;&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
&gt;&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
&gt;&gt;
&gt;&gt; FreeSWITCH-users mailing list
&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
&gt;&gt; &lt;<a href="mailto:FreeSWITCH-users@lists.freeswitch.org?">mailto:FreeSWITCH-users@lists.freeswitch.org</a>&gt;
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
&gt; 
&gt; _________________________________________________________________________
&gt; Professional FreeSWITCH Consulting Services:
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a> &lt;<a href="mailto:consulting@freeswitch.org?">mailto:consulting@freeswitch.org</a>&gt;
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>
&gt; 
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server
&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>
&gt; 
&gt; Official FreeSWITCH Sites
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
&gt; 
&gt; FreeSWITCH-users mailing list
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a> &lt;<a href="mailto:FreeSWITCH-users@lists.freeswitch.org?">mailto:FreeSWITCH-users@lists.freeswitch.org</a>&gt;
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
&gt; 
&gt; 
&gt; 
&gt; _________________________________________________________________________
&gt; Professional FreeSWITCH Consulting Services:
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>
&gt; 
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server
&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>
&gt; 
&gt; Official FreeSWITCH Sites
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
&gt; 
&gt; FreeSWITCH-users mailing list
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
&gt; 

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</tt></pre>
</div>

 <!-- end of AOLMsgPart_0_b58be040-0c53-4371-99ef-272ca19d7c8e -->



</div>

</font></font>