Icon View Incident Report

Serious Serious
Reported By: Roy Lambert
Reported On: 5/9/2010
For: Version 2.03 Build 13
# 3209 Derived Tables with Parameters Not Executing Properly On Second and Subsequent Executions

The following query is being used in a function to populate three advstringgrids with the following code:

PNODetails.Close;
PNODetails.Unprepare;
PNODetails.Prepare;
PNODetails.ParamByName('PNO').AsString := pno;
PNODetails.ExecSQL;

If I don't make the UnPrepare/Prepare calls, then the second and third iteration are wildly wrong eg rows not there, percentages wrong by 2 orders of magnitude.

SELECT
_PNO,
COALESCE(_Result,'-') AS _Result,
COALESCE(_Analysis,'-') AS _Analysis,
COUNT(*) AS _Count,
CAST(100 * COUNT(*) / T._Total AS NUMERIC(0,1)) AS _Percentage
FROM CallStats
JOIN
(
SELECT COALESCE(_Result,'-') AS _Result, COUNT(*) AS _Total
FROM CallStats
WHERE
_fkProjects = :ProjectID
AND
_PNO = :PNO
AND
_Date BETWEEN :StartDate AND :EndDate
GROUP BY _PNO,COALESCE(_Result,'-')
) T ON COALESCE(T._Result,'-') = COALESCE(_Result,'-')
WHERE
_fkProjects = :ProjectID
AND
_PNO = :PNO
AND
_Date BETWEEN :StartDate AND :EndDate
GROUP BY _PNO,COALESCE(_Result,'-'),COALESCE(_Analysis,'-')



Resolution Resolution
Fixed Problem on 5/17/2010 in version 2.03 build 14


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 VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image