<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"><<a href="mailto:j_mj@aol.com" target="_blank">j_mj@aol.com</a>></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'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><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 <<a href="mailto:william.king@quentustech.com" target="_blank">william.king@quentustech.com</a>><br>
To: freeswitch-users <<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>><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:
> Hi Seven Du,
>
> I'd really like to know if this is possible too, couldn't find it
> documented anywhere.
>
> 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?
>
> Does it somehow return mysql_insert_id()?
>
> How should we use it.
>
> You help is invaluable and is contributing to the freeswitch community.
>
> -Jm
>
>
> -----Original Message-----
> From: Seven Du <<a href="mailto:dujinfang@gmail.com" target="_blank">dujinfang@gmail.com</a>>
> To: FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>>
> Sent: Sat, May 25, 2013 12:52 pm
> Subject: Re: [Freeswitch-users] dbh:query - insert id
>
> Maybe try the RETURNING clause ?
>
> --
> Seven Du
> <a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a>
> <a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a>
> <a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a>
>
> Sent with Sparrow <<a href="http://www.sparrowmailapp.com/?sig" target="_blank">http://www.sparrowmailapp.com/?sig</a>>
>
> On Saturday, May 25, 2013 at 8:14 AM, Lloyd Aloysius wrote:
>> Hello All
>>
>> How to get the id value after insert a record a record using dbh:query
>>
>> _table_a - columns_.
>>
>> id - auto increment
>> field1
>> field2
>>
>>
>> dbh:query("insert into table_a ( field1,field2) values ('11','Test')")
>>
>>
>> After insert how to get the table_a - id value for the inserted record?
>>
>> Thanks
>> Lloyd
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a> <<a href="mailto:consulting@freeswitch.org?" target="_blank">mailto: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="mailto:FreeSWITCH-users@lists.freeswitch.org?" target="_blank">mailto: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>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a> <<a href="mailto:consulting@freeswitch.org?" target="_blank">mailto: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="mailto:FreeSWITCH-users@lists.freeswitch.org?" target="_blank">mailto: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>
>
>
>
> _________________________________________________________________________
> 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>
>
_________________________________________________________________________
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>