[asterisk-users] func odbc and mult iquery

Tilghman Lesher tlesher at digium.com
Fri Mar 12 10:38:58 CST 2010


On Friday 12 March 2010 05:55:33 voipas wrote:
> 2010/3/10 Tilghman Lesher <tlesher at digium.com>
>
> > On Wednesday 10 March 2010 02:09:54 voipas wrote:
> > >   Does asterisk func odbc support multi query? I'm executing stored
> > > procedure which returns two tables. With tsql command I can see both
> > > tables. But asterisk only shows the first.
> > > My database is MSSQL.
> >
> > Yes, but only in 1.6.0 and above.  You'll need to set mode=multirow in
> > func_odbc.conf, and the behavior of func_odbc changes dramatically.  See
> > the sample func_odbc.conf for more information.
>
>   I'm using 1.6.0.20 asterisk and also I use multirow. I'm getting data
> like this:
>  for (x=0; ${x} < ${ODBCROWS}; x=${x} + 1) {
>   SET(ARRAY(variable,value)=${ODBC_FETCH(${RESULT})});
>   SET(${variable}=${value});
>  };
>
> But using this, I can only retrieve first table. How to detect and retrieve
> the second table?

I haven't the faintest idea how returning two resultsets from a stored
procedure could possibly work, let alone how to retrieve it properly.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list