Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I'm trying to use variable vART in the sql script
SQL
SELECT ITMREF_0, SUM(QTYSTU_0) AS QTYSTU FROM x145.JOLLY.STOJOU WHERE ITMREF_0 = $(vART)
AND IPTDAT_0 <= '20131231' GROUP BY ITMREF_0;
but I get the following error
SQL##f - SqlState: S0022, ErrorCode: 207, ErrorMsg: [Microsoft][ODBC SQL Server Driver][SQL Server]Il nome di colonna 'IBBHH001' non è valido.
SQL
SELECT ITMREF_0, SUM(QTYSTU_0) AS QTYSTU FROM x145.JOLLY.STOJOU WHERE ITMREF_0 = IBBHH001
AND IPTDAT_0 <= '20131231' GROUP BY ITMREF_0
vART variable contains the item number (alphanumeric value) and it is assigned as follows:
LET vART = TEXT('$(vID)');
Can someone help me?
Thanks
Hi,
use single quote to evaluate the Variable .
Example.
SQL
SELECT ITMREF_0, SUM(QTYSTU_0) AS QTYSTU FROM x145.JOLLY.STOJOU WHERE ITMREF_0 = '$(vART)'
AND IPTDAT_0 <= '20131231' GROUP BY ITMREF_0;
-Nilesh
thank you, this helps me but now I have another problem in the for loop
Errore di riga Script:
FOR i = 1 TO
Errore di riga Script:
NEXT i
Tabella non trovata
DROP TABLES statement
I do not think that the sql is wrong
can you help me on this?
Thanks