<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr"><span class="">On Tue, Sep 20, 2016 at 7:25 PM, Bogdan-Andrei Iancu &lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt; wrote:<br>&gt;<br>&gt; Hello,<br>&gt;<br>&gt; The avp_db_query() stores the DB result (multiple rows with multiple columns) into a set of AVPs (kind of an array). See<br>&gt;     <a href="http://www.opensips.org/html/docs/modules/2.2.x/avpops.html#id293973" target="_blank">http://www.opensips.org/html/<wbr>docs/modules/2.2.x/avpops.<wbr>html#id293973</a><br>&gt;<br>&gt; Using a while loop (see <a href="http://www.opensips.org/Documentation/Script-Statements-2-2#toc3" target="_blank">http://www.opensips.org/<wbr>Documentation/Script-<wbr>Statements-2-2#toc3</a>), you can iterate throw all the rows, by checking the if $(avp(xxx)[$var(idx)]) is NULL or not (where $var(idx) is the variable in the while loop).<br>&gt;<br>&gt; Inside the loop, simply store the row (all the AVPs with that index) into cache DB .<br>&gt;<br></span>Just a example, if I understand what you mean:<div><a href="https://gist.github.com/was4444/ef203d871d5ed3b32144d41787862ac0" target="_blank">https://gist.github.com/<wbr>was4444/<wbr>ef203d871d5ed3b32144d41787862a<wbr>c0</a><div><br></div><div>It seems that we cannot fetch AVPs use `cache_fetch(&quot;local&quot;, &quot;attribute&quot;, $avp(values))` according to the document</div><div><a href="https://www.opensips.org/Documentation/Script-CoreFunctions-2-2#toc4" target="_blank">https://www.opensips.org/<wbr>Documentation/Script-<wbr>CoreFunctions-2-2#toc4</a></div><div><div><br><br>Regards,<span class=""><br><br>xiaofeng<br><br>--<br>gpg key fingerprint:<br>2048R/5E63005B<br>C84F 671F 70B7 7330 4726  5EC8 02BC CBA2 5E63 005B<br>--<br></span><span class="">______________________________<wbr>_________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><div class="gmail_extra">
</div></span></div></div></div></div>
</div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span><font color="#888888">xiaofeng<br><br>--<br>gpg key fingerprint:<br>2048R/5E63005B<br>C84F 671F 70B7 7330 4726  5EC8 02BC CBA2 5E63 005B</font></span><br><span><font color="#888888">--</font></span><br><span><font color="#888888">trans-zh_cn mailing list<br>
<a href="mailto:trans-zh_cn@lists.fedoraproject.org" target="_blank">trans-zh_cn@lists.fedoraproject.org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/trans-zh_cn" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/trans-zh_cn</a></font></span></div></div></div></div></div></div></div>
</div>