I am adding the following SQL to my COBOL program. It returns ZEROES as the SQLCODE, but does not put the fields in my COBOL fields so that I can use them in my program.
EXEC SQL
SELECT TOP 1
"CourtEventNo"
,"CrtCaseDefNo"
,"EventDate"
,"EventTime"
,"FineAmount"
,"DeleteInd"
FROM "CR_DefFineCase"
INTO
:J0901-CourtEventNo
,:J0901-CrtCaseDefNo
,:J0901-EventDate
,:J0901-EventTime
,:J0901-FineAmount
,:J0901-DeleteInd
WHERE "CrtCaseDefNo" = :WS-CRTCASE AND
"DeleteInd" = 'N'
ORDER BY
"EventDate" DESC
,"EventTime" DESC
,"CR_DefFineCaseSID" DESC
END-EXEC.
Our configuration
Studio Enterprise Edition 6.0 Platform Net Express Database is MS SQLServer
We have 37 new tables for this project. Can access tables by primary keys (SIDS), but all access using Alternate keys has been problematic. This is the code from the first table which I have tried using both the middle tier software to access and embedded SQL. Both return a SQLCODE value of zero, but no values in the fields declared in the INTO variables. The second table I tried to access using embedded SQL with a cursor. It works until it gets to the FETCH statement and then it bombs with a nonsensical error.
#EnterpriseDeveloper

