Icon View Incident Report

Serious Serious
Reported By: Doug
Reported On: 3/24/2004
For: Version 4.05 Build 1
# 1624 Using Parameters with SQL Scripts Is Not Working Properly with the OnGetParams Event

I'm using a single parameterized query that contains multiple SQL statements like the following.

Here's the problem:

First I tried "DBISAMQuery1.ParamByName('ProfileId').AsInteger := 1;" But this gave me the following error: Parameter 'ProfileId' not found.

I don't know why this didn't work, so I resorted to creating an event handler for the DBISAMQuery1.OnGetParams event. This event handler gets called the first time I execute the query. However, it does not get called for subsequent calls to open the query (i.e. OnGetParams never gets called again).

I've made sure to close the query after each call and I've tried calling UnPrepare as well, but with no luck.

SELECT
   Name, EntryType, Details, ProfileId, SUM(Value) as TotalValue, 
SUM(Cost1) as 
Cost1Total, SUM(Cost2) as Cost2Total
INTO 
  "\Memory\Totals"
FROM
  Profiles
WHERE
  Profiles.ProfileId = :ProfileId;

SELECT
  Name, EntryType, Details, TotalWeight, (Cost1Total / TotalValue) as 
CPV1, 
(Cost2Total/ TotalValue) as CPV2
FROM
  "\Memory\Totals";



Resolution Resolution
Fixed Problem on 3/24/2004 in version 4.06 build 1
Image