Re: [OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-13 Thread Jayesh Nambiar
Hi Vlad, In this case I am actually calling a stored procedure inside avp_db_query() function to query data from mysql. The stored procedure goes into multiple tables and based on many conditions it gives the output. The datatypes of the the columns in question are actually all DECIMAL(8,4) in the

Re: [OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-13 Thread Vlad Paiu
Hi Jayesh, The first thing that comes to mind is that you can cast your floats to string directly from the mysql query ( with something like cast(your_field as char) ). Could you please send us an example of the avp_db_query that was previously working, along with the 'show create table' for t

Re: [OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-12 Thread Jayesh Nambiar
Oh Ok. Got it. Thanks for the inputs. --- Jayesh On Wed, Mar 13, 2013 at 8:26 AM, Ovidiu Sas wrote: > Make sure that the values are stored as strings in the table, not as float. > > -ovidiu > > On Tue, Mar 12, 2013 at 10:40 PM, Jayesh Nambiar > wrote: > > Hi Ovidiu, > > Thanks for your reply.

Re: [OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-12 Thread Ovidiu Sas
Make sure that the values are stored as strings in the table, not as float. -ovidiu On Tue, Mar 12, 2013 at 10:40 PM, Jayesh Nambiar wrote: > Hi Ovidiu, > Thanks for your reply. But I just expect them to be stored as string in my > AVPs. Even in 1.8.2, when I dumped those AVPs back into a databa

Re: [OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-12 Thread Jayesh Nambiar
Hi Ovidiu, Thanks for your reply. But I just expect them to be stored as string in my AVPs. Even in 1.8.2, when I dumped those AVPs back into a database table, it always put the exact value like 1. or 0.0123 etc. So it was indeed storing the entire value as string in the AVPs and not as 1 or 0.

Re: [OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-12 Thread Ovidiu Sas
You are trying to store a float into an int. Prior to 1.9, there wasn't a strict check on the conversion and whatever the result was, it was stored (i.e. 1.000 was stored as 1 and 0.0123 was stored as 0). For more info: http://linux.die.net/man/3/strtol Starting with 1.9, there is a strict check f

[OpenSIPS-Users] querying float point values in opensips-1.9 gives error

2013-03-12 Thread Jayesh Nambiar
Hi, I am testing out Opensips-1.9 currently. While I was using opensips-1.8.2, I used avp_db_query to query some values from database tables which were float point values and used those values to insert into acc table. Obviously for billing reasons. But after upgrading to 1.9 it gives error. Eg: I