[SR-Users] avp_db_query => affected rows

David K kamailio.org at spam.lublink.net
Mon Jul 15 15:52:31 CEST 2013


Hello,

Are you saying that avp_db_query is obsolete?

Thanks for the clarification,

David

On 13-07-15 09:44 AM, Alex Balashov wrote:
> On 07/15/2013 09:40 AM, David K wrote:
>
>> Hello,
>>
>> I want to run an SQL UPDATE command from my kamailio script. I am using
>> the command 'avp_db_query'.
>>
>> How can I get the number of affected rows after the UPDATE runs?
>
> This is a very legacy, obsolete approach to custom SQL query 
> interactions.  What you want is to use 'sqlops':
>
>    http://kamailio.org/docs/modules/4.0.x/modules/sqlops.html
>
> It has a nice $sqlrows variable that serves the exact function you're 
> looking for:
>
>    5.2. $sqlrows(con)
>
>    Number of affected rows of the previous query on the specified
>    connection. It's primary use is to get the number of rows
>    affected by UPDATE, INSERT and DELETE queries.
>
> -- Alex
>




More information about the sr-users mailing list