<font color='black' size='2' face='Arial, Helvetica, sans-serif'>Yep<font size="2">, 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><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 <william.king@quentustech.com><br>
To: freeswitch-users <freeswitch-users@lists.freeswitch.org><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:
> 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">dujinfang@gmail.com</a>>
> To: FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org">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">consulting@freeswitch.org</a> <<a href="mailto:consulting@freeswitch.org?">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">FreeSWITCH-users@lists.freeswitch.org</a>
>> <<a href="mailto:FreeSWITCH-users@lists.freeswitch.org?">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">consulting@freeswitch.org</a> <<a href="mailto:consulting@freeswitch.org?">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">FreeSWITCH-users@lists.freeswitch.org</a> <<a href="mailto:FreeSWITCH-users@lists.freeswitch.org?">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">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>
>
_________________________________________________________________________
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>