[asterisk-users] Return variables from func_odbc calls?

Sherwood McGowan sherwood.mcgowan at gmail.com
Wed Jan 26 08:18:52 CST 2011


I actually was pondering that same thing :D

On Wed, Jan 26, 2011 at 7:33 AM, Paul Belanger <pabelanger at digium.com> wrote:
> On 11-01-26 08:19 AM, Sherwood McGowan wrote:
>>> While, LAST_INSERTID(); is a MySQL-ism, I've been able to use it with
>>> func_ODBC.  Of cource, my database is MySQL and this function would not
>>> work on anything else.
>>>
>>> [CREATECALL]
>>> dsn=Example
>>> writesql=INSERT INTO x (y) VALUES (z)
>>> readsql=SELECT LAST_INSERT_ID();
>>>
>>
>> Hey, thanks for the tip Paul!
>>
> I should also note, make sure you create a 2nd DSN for your specific
> ODBC commands that will use LAST_INSERT_ID(), otherwise if you are using
> ODBC CDR or CEL, there is a chance LAST_INSERT_ID() will return the ID
> of those records.
>
> --
> Paul Belanger
> Digium, Inc. | Software Developer
> twitter: pabelanger | IRC: pabelanger (Freenode)
> Check us out at: http://digium.com & http://asterisk.org
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list