[asterisk-users] Multiple Return Values from func_odbc

2007-11-27 Thread Douglas Garstang
Is there any way to return multiple values from functions defined in 
func_odbc.conf?
It appears that you can only return one value.

True? Hope not

Doug.





  

Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  
http://overview.mail.yahoo.com/___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Multiple Return Values from func_odbc

2007-11-27 Thread Tilghman Lesher
On Tuesday 27 November 2007 20:05:55 Douglas Garstang wrote:
> Is there any way to return multiple values from functions defined in
> func_odbc.conf? It appears that you can only return one value.

Use the ARRAY function:

func_odbc.conf:
read=SELECT foo,bar FROM tablename WHERE baz='${ARG1}'

extensions.conf:
Set(ARRAY(foo,bar)=${ODBC_WHATEVER(bax)})

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Multiple Return Values from func_odbc

2007-11-28 Thread Douglas Garstang
Thanks... That was just what I needed.
But what about going the other way? How can I pass multiple values to a 
function in func_odbc?
I can't use ARRAY as it can only be used to set variables, not read form them!

Doug.

- Original Message 
From: Tilghman Lesher <[EMAIL PROTECTED]>
To: Asterisk Users Mailing List - Non-Commercial Discussion 

Sent: Tuesday, November 27, 2007 9:08:50 PM
Subject: Re: [asterisk-users] Multiple Return Values from func_odbc


On Tuesday 27 November 2007 20:05:55 Douglas Garstang wrote:
> Is there any way to return multiple values from functions defined in
> func_odbc.conf? It appears that you can only return one value.

Use the ARRAY function:

func_odbc.conf:
read=SELECT foo,bar FROM tablename WHERE baz='${ARG1}'

extensions.conf:
Set(ARRAY(foo,bar)=${ODBC_WHATEVER(bax)})

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Multiple Return Values from func_odbc

2007-11-28 Thread Tilghman Lesher
On Wednesday 28 November 2007 16:55:14 Douglas Garstang wrote:
> Thanks... That was just what I needed.
> But what about going the other way? How can I pass multiple values to a
> function in func_odbc? I can't use ARRAY as it can only be used to set
> variables, not read form them!

func_odbc.conf:
read=SELECT ${ARG3} FROM tablename WHERE ${ARG1}='${ARG2}'
write=UPDATE tablename SET ${ARG3}='${VAL1}' WHERE ${ARG1}='${ARG2}'

extensions.conf:

Set(foo=${ODBC_WHATEVER(field1,blah,field17)})
Set(ODBC_WHATEVER(field1,blah,field36)=bar)

Multiple values are tricky in 1.4 due to Set syntax, but we've solved that
in the upcoming 1.6 by simplifying the dialplan syntax.

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Multiple Return Values from func_odbc

2007-11-28 Thread Douglas Garstang
Thanks... That was just what I needed.
But what about going the other way? How can I pass multiple values to a 
function in func_odbc?
I can't use ARRAY as it can only be used to set variables, not read form them!

Doug.

- Original Message 
From: Tilghman Lesher <[EMAIL PROTECTED]>
To: Asterisk Users Mailing List - Non-Commercial Discussion 

Sent: Tuesday, November 27, 2007 9:08:50 PM
Subject: Re: [asterisk-users] Multiple Return Values from func_odbc


On Tuesday 27 November 2007 20:05:55 Douglas Garstang wrote:
> Is there any way to return multiple values from functions defined in
> func_odbc.conf? It appears that you can only return one value.

Use the ARRAY function:

func_odbc.conf:
read=SELECT foo,bar FROM tablename WHERE baz='${ARG1}'

extensions.conf:
Set(ARRAY(foo,bar)=${ODBC_WHATEVER(bax)})

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users







  Never miss a thing.   Make Yahoo your homepage.







  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users