Multiple Return Values from func_odbc?

Is there any way to return multiple values from functions defined in func_odbc.conf?
It appears that you can only return one value.

Yes you can. Use Array. e.g.,
Dialplan in extensions. conf,
… …
same => n,Set(ARRAY(value1,value2)=${GET_VALUES(${MyID})})

… …
readsql=SELECT field1,field2 from table where id=${SQL_ESC(${ARG1})}

–Satish Barot

Thank’s satish4asterisk,
What i mean is that my SQL request is:

readsql=SELECT field from table where id= ${ARG1} ; where ‘field’ is a list of values.

same =>n,set(Values=${GET_VALUES(${Myid})})

But when i tried this solution, ‘values’ is populated JUST by the first value of the list.
How can i get all values of ‘field’ in my extensions.conf ?

So you are talking about how to handle multiple rows from func_odbc.

Go through following link anf check the section Multirow Functionality with func_odbc to get the idea. … -func-odbc

–Satish Barot

I steel have the same problem odbc_fetch doesn’t work, ODBC_FETCH returns just the first row. and
ODBCROWS=1 instead of 2

Can anyone help me ?

(1) Do you have mode set to multirow in your function? Post complete [GET_VALUES] function from funcodbc.conf.
(2)Post dialplan snippet where you expect result for GET_VALUES function.

–Satish Barot

thanks it works now :wink: