[asterisk-users] Return variables from func_odbc calls?

Tilghman Lesher tilghman at meg.abyt.es
Wed Jan 26 13:59:15 CST 2011


On Wednesday 26 January 2011 07:01:12 Paul Belanger wrote:
> On 11-01-26 04:56 AM, Tilghman Lesher wrote:
> > As far as LAST_INSERT_ID, that is a MySQL-ism that is not supported,
> > since it is not portable across database types.
> 
> 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();

That assumes you have only one call in existence at a time.  If two calls
came in and executed the query at about the same time, it's possible for
both reads to return the same value.

-- 
Tilghman



More information about the asterisk-users mailing list