pass a parameter to firebird query
I want to create a pie chart with the total sale-price-values of different product lines provided those values are greater than a parameter (:TUDIME).
I'm using firebird 2.5 & FsatReport.Net; the query executes perfectly in SQL Manager Lite for InterBase & Firebird. This is the query:
SELECT LIN_PROD, ROUND(SUM(I.EXIST*P.PRECIO),0) AS VALOR
from INVE02 i join PRECIO_X_PROD02 p on i.CVE_ART = p.CVE_ART join INVE_CLIB02 cl on i.CVE_ART = cl.CVE_PROD
where I.LIN_PROD IS NOT NULL AND p.CVE_PRECIO = 1 and cl.CAMPLIB1 IN('BD','BTD') AND I.EXIST > 0
GROUP BY LIN_PROD
HAVING ROUND(SUM(I.EXIST*P.PRECIO),0) > :TUDIME
ORDER BY VALOR DESC
i copy and past it in the query assistant, then in the next screen -'Parameter Definition' i add a parameter with this data:
Name: TUDIME
Data Type: Double
Default Value: 3000
Expression: Empty (I don??t type anything here)
Size: 0
when i click the next botton i get this error message:
ERROR [HY000] [ODBC Firebird Driver][FireBird] Dynamic SQL Error
SQL error code = -206
Column unknown TUDIME
At line 5, column 43
In the query that line and column point to the parameter :TUDIME
I also have tried two changes:
1 In Parameter Definition changing the parameter Name to :TUDIME (Typing the colon at the beginning)
2 changing the ORDER BY clause to ORDER BY ROUND(SUM(I.EXIST*P.PRECIO),0)
but i get the same error.
I know i??m making a mistake, but i don??t know where, Help please. In advance thanks a million.
I'm using firebird 2.5 & FsatReport.Net; the query executes perfectly in SQL Manager Lite for InterBase & Firebird. This is the query:
SELECT LIN_PROD, ROUND(SUM(I.EXIST*P.PRECIO),0) AS VALOR
from INVE02 i join PRECIO_X_PROD02 p on i.CVE_ART = p.CVE_ART join INVE_CLIB02 cl on i.CVE_ART = cl.CVE_PROD
where I.LIN_PROD IS NOT NULL AND p.CVE_PRECIO = 1 and cl.CAMPLIB1 IN('BD','BTD') AND I.EXIST > 0
GROUP BY LIN_PROD
HAVING ROUND(SUM(I.EXIST*P.PRECIO),0) > :TUDIME
ORDER BY VALOR DESC
i copy and past it in the query assistant, then in the next screen -'Parameter Definition' i add a parameter with this data:
Name: TUDIME
Data Type: Double
Default Value: 3000
Expression: Empty (I don??t type anything here)
Size: 0
when i click the next botton i get this error message:
ERROR [HY000] [ODBC Firebird Driver][FireBird] Dynamic SQL Error
SQL error code = -206
Column unknown TUDIME
At line 5, column 43
In the query that line and column point to the parameter :TUDIME
I also have tried two changes:
1 In Parameter Definition changing the parameter Name to :TUDIME (Typing the colon at the beginning)
2 changing the ORDER BY clause to ORDER BY ROUND(SUM(I.EXIST*P.PRECIO),0)
but i get the same error.
I know i??m making a mistake, but i don??t know where, Help please. In advance thanks a million.