[Freeswitch-users] dbh:query - insert id

Daniel Ivanov sertys at gmail.com
Sun May 26 09:01:55 MSD 2013


It doesn't support it. And still we're looking at luasql driver, not
freeswitch or odbc implementations. Just use the LAST_INSERT_ID() function.
If it returns weird things, disable autocommit and build your own
transactions to be certain you get the right value. And as addition
transaction != session != connection when it comes to modern database
driving.
On May 25, 2013 9:55 PM, "Ken Rice" <krice at freeswitch.org> wrote:

>  I don’t know if mysql even supports the returning keywork...
>
> The way RETURNING works is its an addon to your insert statements
>
> INSERT INTO table_foo (col_a, col_b) values (‘foo’, ‘bar’) RETURNING
> row_id;
>
> Where row_id is an auto incrementing field such as a SERIAL (sequence) in
> PGSQL or an auto-increment field in mySQL.
>
> While this is an “insert” per say, it looks more like a “select” when
> executing as data is returned
>
>
>
> On 5/24/13 10:59 PM, "John M" <j_mj at aol.com> 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 <dujinfang at gmail.com>
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> Sent: Sat, May 25, 2013 12:52 pm
> Subject: Re: [Freeswitch-users] dbh:query - insert id
>
>
>  Maybe try the RETURNING clause ?
>
>
>
> --
> Ken
> *http://www.FreeSWITCH.org
> http://www.ClueCon.com
> http://www.OSTAG.org
> *irc.freenode.net #freeswitch
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130526/1485b098/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list