<font face="verdana,sans-serif">William,</font><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Thank you for the reply. Question was related to freeswitch dbh driver. Not related to sql specific.</font></div>

<div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Most of the SQL Driver have a method to get the id after the insert record. My questions was does freeswitch dbh have any method to get the id?</font></div>

<div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">For Example dbh have a method </font><span style="background-color:rgb(249,249,249);line-height:1.1em">dbh:affected_rows()</span><span style="font-family:verdana,sans-serif"> </span><font face="verdana, sans-serif"> for insert , update. </font></div>

<div><font face="verdana, sans-serif"><br></font></div><div><span style="font-family:verdana,sans-serif">Like this do we have a method for ID?</span></div><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Thanks</font></div>

<div><font face="verdana, sans-serif">Lloyd</font></div><div><div><div><div><font face="verdana, sans-serif" color="#cc6600" size="1"><b><br></b></font></div><div><font face="verdana, sans-serif" color="#cc6600" size="1"><b> <a href="http://www.sunteltech.ca/blog/" target="_blank"></a></b></font></div>

</div>
<br><br><div class="gmail_quote">On Sat, May 25, 2013 at 10:23 AM, John M <span dir="ltr">&lt;<a href="mailto:j_mj@aol.com" target="_blank">j_mj@aol.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<font color="black" face="Arial, Helvetica, sans-serif">Yep<font>, super helpful..  /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&#39;s why we are asking. What we don&#39;t know is how specifically the freeswitch:dbh handler interacts and can return the inserted record id.<br>
</font><div><div class="h5"><font color="black" face="Arial, Helvetica, sans-serif">
<div> <br>

</div>



<div> <br>

</div>



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

From: William King &lt;<a href="mailto:william.king@quentustech.com" target="_blank">william.king@quentustech.com</a>&gt;<br>

To: freeswitch-users &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>

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

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

<br>






<div style="font-size:12px;font-family:Tahoma,Verdana,Arial,Sans-Serif;margin:0px">

<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:   <a href="tel:%28877%29%20211-9337" value="+18772119337" target="_blank">(877) 211-9337</a>
Office: <a href="tel:%28206%29%20388-4772" value="+12063884772" target="_blank">(206) 388-4772</a>
Cell:   <a href="tel:%28253%29%20686-5518" value="+12536865518" target="_blank">(253) 686-5518</a>
<a href="mailto:william.king@quentustech.com" target="_blank">william.king@quentustech.com</a>

On 05/24/2013 08:59 PM, John M wrote:
&gt; Hi Seven Du,
&gt; 
&gt; I&#39;d really like to know if this is possible too, couldn&#39;t find it
&gt; documented anywhere.
&gt; 
&gt; Instead of being cryptic, if you know the answer won&#39;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" target="_blank">dujinfang@gmail.com</a>&gt;
&gt; To: FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">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(&quot;insert into table_a ( field1,field2) values (&#39;11&#39;,&#39;Test&#39;)&quot;)
&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" target="_blank">consulting@freeswitch.org</a> &lt;<a href="mailto:consulting@freeswitch.org?" target="_blank">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" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
&gt;&gt; &lt;<a href="mailto:FreeSWITCH-users@lists.freeswitch.org?" target="_blank">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" target="_blank">consulting@freeswitch.org</a> &lt;<a href="mailto:consulting@freeswitch.org?" target="_blank">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" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a> &lt;<a href="mailto:FreeSWITCH-users@lists.freeswitch.org?" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">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>

 



</div>

</font></div></div></font><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><br></div></div>