Hi
I'm using an embedded SQL statement with a a cursor-based Embedded SQL query that uses host variables in the where clause, however, what I'm doing doesn't seem to work. Can anyone help?
The code I'm using is
set tMessageName = "AssessmentsMessage"
set tIdentifier = "SectionCode"
set ID = 0
&sql(
Declare IDs Cursor For
select %ID
INTO :ID
from GMECC_DocmanConnect_Tables.ParisConnecMessagetSettings
Where MessageName = :tMessageName
and Identifier = :tIdentifier
)
&sql(Open IDs) For {
&Sql(fetch IDs) If SQLCODE Quit // SQLCODE = 100, now rows found
w !, ID
If $$$ISERR(tSC) Quit
} &Sql(Close IDs)
The table being queried contains 9 rows, and with the two parameters provided, it should return only 1 row, and instead returns nothing.
What am I missing?
</body></html>