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@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@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@gmail.com>
To: FreeSWITCH Users Help <freeswitch-users@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@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org