The Following SQL works SQL Server 2005 executed from Fujitsu COBOL via an ODBC Driver. ( EXEC Statements excluded)
SELECT FIELDA, FIELDB FROM CTRY_TAB
WHERE FIELDC = 'A' AND FIELDD = :XCTRY
XCTRY IS A DECLARED SQL VARIABLE.
The following does not work with SQL Server but does with MySQL.
SELECT FIELDA, FIELDB FROM CTRY_TAB
WHERE FIELDD = :XCTRY AND FIELDC = 'A'
The error message is 00137 must declare scalar variable '@P1AND'
I believe that the variable is being concatenated the the AND ? I guess it is simple if you know what option to set but ut baffles me !!!
SELECT FIELDA, FIELDB FROM CTRY_TAB
WHERE FIELDC = 'A' AND FIELDD = :XCTRY
XCTRY IS A DECLARED SQL VARIABLE.
The following does not work with SQL Server but does with MySQL.
SELECT FIELDA, FIELDB FROM CTRY_TAB
WHERE FIELDD = :XCTRY AND FIELDC = 'A'
The error message is 00137 must declare scalar variable '@P1AND'
I believe that the variable is being concatenated the the AND ? I guess it is simple if you know what option to set but ut baffles me !!!