The behavior change might be due to updated drivers, which is the most
common source of modified database behavior. You can probably fix this
either in CF, using something like NumberFormat, or cfqueryparam, or using
casting in SQL Server. If this is a lot of work for you, it might be worth
it to
Greetings.
In one of our systems we're upgrading from ColdFusion 7 to CF 8.
While testing a piece of functionality we were getting 0 returned as 0E-8 for a
query using a stored procedure. If the value is greater than 0, there's no
issue.
Updating the procedure to cast the returned value as a
What is the data type of the field in SQL Server? If you run the query in
Management Studio, what do you see for that value? How are you outputting
the value in CF to see the 0E-8 number? What tag are you using to call the
stored procedure in ColdFusion? Which version of MS SQL Server are you
Thanks for the clarification questions, Mike.
What is the data type of the field in SQL Server?
numeric(10,2)
If you run the query in Management Studio, what do you see for that value?
0.00
How are you outputting the value in CF to see the 0E-8 number?
In a tossed error it was displayed
It occurred to me that I should first ask if this issue is causing any
problems, or if it is only an unexpected way to format a number? For example
0.00 = 0E-8. They are both the same number regardless of how they are
displayed.
For clarification, which number has the unexpected formatting, the
It occurred to me that I should first ask if this issue is causing any
problems, or if it is only an unexpected way to format a number? For example
0.00 = 0E-8. They are both the same number regardless of how they are
displayed.
Unfortunately, it is causing an issue in this particular instance
Why would a SQL cast fix the issue? Casting a numeric(10,2) to a
numeric(10,2) would not solve anything, which means that the value you are
casting to numeric must be of a different data type, likely float or
varchar. Floating point numbers often display in scientific notation. The
numeric value
Thanks Mike.
Opened up the procedure and gave it a look. It looks like there's some
multiplication and division going on, which is resulting in a change. Relevant
part for one of the returned values:
MemberPrice =
(case when qp.productid is null then p.MemberPrice
else
Looks like you might need to revise the procedure to CAST the calculated
value back to Numeric(10,2) before returning it?
Carl
On 2/16/2011 2:30 PM, James Skemp wrote:
Thanks Mike.
Opened up the procedure and gave it a look. It looks like there's some
multiplication and division going on,
Looks like you might need to revise the procedure to CAST the calculated
value back to Numeric(10,2) before returning it?
Carl
Yeah, which is what we're doing for this one to resolve the issue.
But since this is a legacy, third-party, application ... it worries me the
number of places this
10 matches
Mail list logo