-----Original Message-----
From: Nathan Neulinger <nneul@mst.edu>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Sent: Sun, May 26, 2013 1:35 am
Subject: Re: [Freeswitch-users] dbh:query - insert id
Looking at the code, I'm not seeing anything that would do this. Affected rows
is directly implemented as part of ODBC,
that's why it's easily available.
You could probably do a subsequent select on last_insert_id(), but there is a
high risk of race condition - some other
thread could use the dbh driver in the intervening time.
I don't believe that the last insert id is returned automatically on any of the
mysql api (underlying calls not FS)
calls, and then you have the odbc layer on top of that.
The way I've seen some other packages do it is to implement a mysql specific sql
execute call that runs the statement,
and then immediately runs a select last_insert_id() and returns it.
-- Nathan
On 05/25/2013 10:01 AM, Lloyd Aloysius wrote:
> William,
>
> Thank you for the reply. Question was related to freeswitch dbh driver. Not
related to sql specific.
>
> 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?
>
> For Example dbh have a method dbh:affected_rows() for insert , update.
>
> Like this do we have a method for ID?
>
> Thanks
> Lloyd
> *
--
------------------------------------------------------------
Nathan Neulinger nneul@mst.edu
Missouri S&T Information Technology (573) 612-1412
System Administrator - Architect
_________________________________________________________________________
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