[OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Rodrigo Pimenta Carvalho pimenta at inatel.br
Tue Nov 3 14:50:22 CET 2015


Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update GeneralConfigurations set Value = 'yes' where Attribute = 'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid parameter value


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


But the query UPDATE is correct, because I have already tested it directly in the database.


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?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20151103/8540b4f5/attachment.htm>


More information about the Users mailing list