Icon View Incident Report

Serious Serious
Reported By: Roy Lambert
Reported On: 1/23/2011
For: Version 2.05 Build 1
# 3371 Parameters Not Working Correctly When Used in CAST Functions

I just tried executing the following query. Setting the paramter type to integer in EDBManager. I get one row returned rather than the 7 I should. Replaceing

_Date >= CURRENT_DATE - CAST(CAST(:DInt AS INTEGER) AS INTERVAL DAY)

with

_Date >= CURRENT_DATE - CAST(6 AS INTERVAL DAY)
or
_Date >= CURRENT_DATE - INTERVAL '6' DAY

returns the 7 rows I would expect.

SELECT
CASE EXTRACT( DAYOFWEEK FROM _Date)
WHEN 1 THEN 'Monday'
WHEN 2 THEN 'Tuesday'
WHEN 3 THEN 'Wednesday'
WHEN 4 THEN 'Thursday'
WHEN 5 THEN 'Friday'
WHEN 6 THEN 'Saturday'
WHEN 7 THEN 'Sunday'
END AS Day,
CAST(_Date AS VARCHAR(10) DATE FORMAT 'dd/mm/yyyy') AS Date,
_Examined AS Examined,
_Passed AS Passed,
CAST((_Passed / _Examined)*100 AS DECIMAL(6,2)) AS PassRate,
_Sent AS Sent
FROM
emStats
WHERE
_Date >= CURRENT_DATE - CAST(CAST(:DInt AS INTEGER) AS INTERVAL DAY)
ORDER BY _Date DESC



Comments Comments
The problem was related to the fact that EDB cannot determine the type of CAST arguments, and was not internally updating the type of the parameter properly to match that indicated by the code before execution.


Resolution Resolution
Fixed Problem on 1/23/2011 in version 2.05 build 2


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image