[Freeswitch-users] dbh:query - insert id

Ken Rice krice at freeswitch.org
Sat May 25 22:51:12 MSD 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130525/9c3f2178/attachment.html 


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