Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
-
a.alekizoglou
- Posts: 32
- Joined: Fri 22 Sep 2006 08:32
Post
by a.alekizoglou » Fri 24 Jan 2014 09:29
I upgraded to UniDAC 5.2.5 from the previous version. For some UniQueries on the when activating I get a 'List index out of bounds' error. Then error comes from procedure TUniSQL.WriteParams(WriteValue: boolean = True) when parsing parameters. Specifically I found a situation where FParamRefs FCount=1, FCapacity=4 and FICommand.GetParamCount = 4.
Code: Select all
...
UseParamRefs := FParamRefs.Count > 0;
for i := 0 to FICommand.GetParamCount - 1 do begin
ParamDesc := FICommand.GetParam(i);
if UseParamRefs then
Param := TDAParam(FParamRefs[i])
else begin
Param := FindParam(ParamDesc.GetName);
FParamRefs.Add(Param);
end;
...
-
a.alekizoglou
- Posts: 32
- Joined: Fri 22 Sep 2006 08:32
Post
by a.alekizoglou » Fri 24 Jan 2014 09:46
I am not sure if this change is correct
Code: Select all
//QUALISYS
if i < FParamRefs.Count then
Param := TDAParam(FParamRefs[i])
else
Param := nil;
-
AlexP
- Devart Team
- Posts: 5530
- Joined: Tue 10 Aug 2010 11:35
Post
by AlexP » Fri 24 Jan 2014 11:26
Hello,
Please provide the text of the query, which opening causes the error.
-
a.alekizoglou
- Posts: 32
- Joined: Fri 22 Sep 2006 08:32
Post
by a.alekizoglou » Fri 24 Jan 2014 11:36
Code: Select all
SELECT
products.*,
currencies.iExchangeRate AS iExchangeRate,
(SELECT group_concat(productalternatives.strProductAlternativeID separator ', ')
FROM productalternatives
WHERE productalternatives.strProductID = products.strProductID) AS strProductAlternativeID,
&NEWROUND(IF(products.iProductTypeID = 702,
IFNULL((SELECT SUM(productbundles.iRetailPrice) as iRetailPackagePrice
FROM productbundles
WHERE productbundles.strProductID = products.strProductID
GROUP BY
productbundles.strProductID),0)
,IF(products.bRetailSpecialPrice AND CURDATE() BETWEEN products.dRetailSpecialPriceFrom AND products.dRetailSpecialPriceTo, products.iRetailSpecialPrice, products.iRetailPrice) ), :CurrencyDecimal) AS iRetailPriceEuro,
&NEWROUND(IF(products.iProductTypeID = 702,
IFNULL((SELECT SUM(productbundles.iBundlePackage * mproducts.iBuyPrice * currencies.iExchangeRate) as iBuyPriceEuro
FROM productbundles
LEFT OUTER JOIN products as mproducts on (productbundles.strProductBundleID = mproducts.strProductID)
LEFT OUTER JOIN currencies ON (mproducts.iCurrencyID = currencies.iCurrencyID)
WHERE productbundles.strProductID = products.strProductID
GROUP BY
productbundles.strProductID),0)
,products.iBuyPrice * currencies.iExchangeRate), :CurrencyDecimal) AS iBuyPriceEuro,
&NEWROUND(IF(products.iProductTypeID = 702,
IFNULL((SELECT SUM(productbundles.iBundlePackage * mproducts.iBuyPrice) as iBuyPriceEuro
FROM productbundles
LEFT OUTER JOIN products as mproducts on (productbundles.strProductBundleID = mproducts.strProductID)
LEFT OUTER JOIN currencies ON (mproducts.iCurrencyID = currencies.iCurrencyID)
WHERE productbundles.strProductID = products.strProductID
GROUP BY
productbundles.strProductID),0)
,products.iBuyPrice), :CurrencyDecimal) AS iBaseCurrencyBuyPrice
FROM
products
LEFT OUTER JOIN currencies ON (products.iCurrencyID = currencies.iCurrencyID)
LEFT OUTER JOIN vatcategories ON (products.iVATCategoryID = vatcategories.iVATCategoryID)
WHERE
products.bActive IS TRUE
ORDER BY
products.iSortOrder,
products.strProductName
-
AlexP
- Devart Team
- Posts: 5530
- Joined: Tue 10 Aug 2010 11:35
Post
by AlexP » Fri 24 Jan 2014 12:52
We have reproduced the problems, and will try to fix them as soon as possible