<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><br>
</p>
<p>Hi Wakano.</p>
<p><br>
</p>
<p>Thank you for the answer!<br>
</p>
<p>I have tried a very simple query : "Delete from Mytable". Just it. But it fails too. That is why maybe there is a bug.
<br>
</p>
<p><br>
</p>
<p>I will check that link now.</p>
<p><br>
</p>
<p>Regards.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: +55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>De:</b> users-bounces@lists.opensips.org <users-bounces@lists.opensips.org> em nome de Patrick Wakano <pwakano@gmail.com><br>
<b>Enviado:</b> terça-feira, 3 de novembro de 2015 16:03<br>
<b>Para:</b> OpenSIPS users mailling list<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?</font>
<div> </div>
</div>
<div>
<div dir="ltr">I think Opensips lexer is converting your 'yes' to the integer 1 when running the SQL query in your DB.
<div>See this thread:<br>
</div>
<div>
<div><a id="LPlnk63681" href="http://lists.opensips.org/pipermail/users/2015-February/030946.html">http://lists.opensips.org/pipermail/users/2015-February/030946.html</a><br>
</div>
<div><br>
</div>
<div>Try to use something different from 'yes' to see what happens.</div>
<div><br>
</div>
<div>Patrick</div>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho
<span dir="ltr"><<a href="mailto:pimenta@inatel.br" target="_blank">pimenta@inatel.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Aron.</p>
<p><br>
</p>
<p>Do you know whether it is necessary to commit the modifications made by avp_db_query("Update....") ?</p>
<p>Is there some kind of ' commit' command to be executed in the OpenSIPS script?</p>
<span class="">
<p><br>
</p>
<p>Any hint will be very helpful!</p>
<p><br>
</p>
</span>
<p>Thanks a lot.<br>
</p>
<span class="">
<p><br>
</p>
<div>
<div name="divtagdefaultwrapper">
<div><font size="2">
<div>RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200" target="_blank">
+55 35 3471 9200</a> RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
</span>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block; width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><span class=""><b>De:</b>
<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a> <<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>> em nome de Podrigal, Aron <<a href="mailto:aronp@guaranteedplus.com" target="_blank">aronp@guaranteedplus.com</a>><br>
<b>Enviado:</b> terça-feira, 3 de novembro de 2015 15:26<br>
<b>Para:</b> OpenSIPS users mailling list<br>
</span><b>Assunto:</b> Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?</font>
<div> </div>
</div>
<div>
<div class="h5">
<div>
<div dir="ltr">Try removing the second argument <i style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">"$avp(CallMaxDuration)"</i> from avp_db_query() Because the database backend does not return any results.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho
<span dir="ltr"><<a href="mailto:pimenta@inatel.br" target="_blank">pimenta@inatel.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear OpenSIPS-users,</p>
<p><br>
</p>
<p>In the OpenSIPS database I have created some new tables, for my project. I can read from such tables successfully. For example, the instruction</p>
<p><br>
</p>
<p> <i>avp_db_query("select Value from GeneralConfigurations where Attribute = 'CallMaxDuration'", "$avp(CallMaxDuration)");</i></p>
<p><br>
</p>
<p>run and works very well. It put the right value in the apv!</p>
<p><br>
</p>
<p>However, when the following instruction is executed, it doesn't take any effect in the database:</p>
<p><br>
</p>
<p><i> avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");</i></p>
<p><br>
</p>
<p>The log says:</p>
<p>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------</p>
<p><br>
</p>
<p>Nov 3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update GeneralConfigurations set Value = 'yes' where Attribute = 'Exists_Intercom_Call']<br>
Nov 3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query<br>
Nov 3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query<br>
Nov 3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: <font color="#FF0000">
invalid parameter value</font></p>
<p><br>
</p>
<p>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</p>
<p><br>
</p>
<p>But the query UPDATE is correct, because I have already tested it directly in the database.</p>
<p><br>
</p>
<p>So, am I doing something wrong? What exactly does mean that error "invalid parameter value" in this case? Can I use UPDATE in an avp_db_query?</p>
<p><br>
</p>
<p>Any hint will be very helpful!</p>
<p><br>
</p>
<p>Best regards.<span><font color="#888888"><br>
</font></span></p>
<span><font color="#888888">
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div>
<div name="divtagdefaultwrapper">
<div><font size="2">
<div>RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="+553534719200" target="_blank">
+55 35 3471 9200</a> RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</font></span></div>
</div>
<br>
_______________________________________________<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" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr">
<div>
<div dir="ltr">Aron Podrigal
<div>-</div>
<div>'1000001', '1110010', '1101111', '1101110' '1010000', '1101111', '1100100', '1110010', '1101001', '1100111', '1100001', '1101100'</div>
<div><br>
</div>
<div>P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'<br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>