<br><br><div class="gmail_quote">2008/12/1 Tim Panton <span dir="ltr">&lt;<a href="mailto:thp@westhawk.co.uk">thp@westhawk.co.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><br><div><div><div></div><div class="Wj3C7c"><div>On 1 Dec 2008, at 13:38, Giedrius Augys wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">2008/12/1 Tilghman Lesher <span dir="ltr">&lt;<a href="mailto:tilghman@mail.jeffandtilghman.com" target="_blank">tilghman@mail.jeffandtilghman.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div>On Monday 01 December 2008 06:15:15 Giedrius Augys wrote:<br> &gt; &nbsp; I&#39;m working with asterisk 1.6. And I have success using func_odbc with<br>
 &gt; one row query results (SELECT source,destination from cc WHERE ... ):<br> &gt; exten =&gt; s,1,Ringing<br> &gt; exten =&gt; s,n,Wait(4)<br> &gt; exten =&gt; s,n,Answer<br> &gt; exten =&gt;<br> &gt; s,n,Set(ARRAY(NUMBER,REALNUMBER1,REALNUMBER2,STATUSAS)=${ODBC_GETVARIABLES(<br>
 &gt;${NUMERIS})}) exten =&gt; s,n,Verbose(1| ${NUMERIS}, ${REALNUMBER1}<br> &gt; ${REALNUMBER1}, ${STATUSAS})<br> &gt;<br> &gt;<br> &gt; But I don&#39;t know how to retrieve data, if query returns a lot of rows. In<br> &gt; documentation I read that need to use in config file:<br>
 &gt; mode=multirow,<br> &gt; and use function ODBC_FETCH. But how to get result-id variable and use<br> &gt; ODBC_FETCH?<br> <br> </div>The initial result in mode=multirow is not data at all, but a query_id that<br> may be used with ODBC_FETCH to return the first row of data and every<br>
 subsequent row of data (up to the max number of rows, if any).<br> <div><br> &gt; And another question is, if I execute not SELECT , but stored procedure,<br> &gt; and this procedure will return two, three tables? Is it possible retrieve<br>
 &gt; these data from couple tables?<br> <br> </div>If you&#39;re talking about a JOIN, then yes. &nbsp;As long as the fields have distinct<br> names, then you can retrieve each row in turn, same as any other query.<br> <br> --<br>
 Tilghman<br> <br> _______________________________________________<br> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br> <br> asterisk-users mailing list<br>
 To UNSUBSCRIBE or update options visit:<br> &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br> </blockquote></div><br><br>Thanks for your reply, but I don&#39;t get it... Is there any documentation or simple examples how to use ODBC_FETCH and so on.<br>
<br></blockquote><div><br></div></div></div><div>For your own sanity (if nothing else) I&#39;d wrap the stored procedure in a view, then</div><div>get FUNC_ODBC to query that view.</div><div><br></div><font color="#888888"><div>
Tim.</div></font></div></div><br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all">Thanks for your replies, I found how to do that :)<br>
-- <br>Pagarbiai &nbsp;/ Best Regards,<br>Giedrius Augys<br>