Hello
I am running Visual Cobol for Eclipse V 7 on a windows computer. The database is on Linux.
I am trying to call a DB2 (v11.5) stored procedure that returns a result set (returning an open cursor) but I can't use the ASSOCIATE and ALLOCATE commands in my Cobol program.
The compile error, SQL4911N, suggests that SQL Directive BEHAVIOR should be used but I can't seem to find this setting in my Visual Cobol for Eclipse.
My attempt in Cobol prog calling a DB2 SP called CFS:
01 LOC-CFS SQL TYPE IS RESULT-SET-LOCATOR VARYING.
exec sql
call cfs(:cfs-in)
end-exec
exec sql ASSOCIATE result set LOCATOR (:LOC-CFS) WITH PROCEDURE CFS end-exec
exec sql ALLOCATE C1 CURSOR FOR RESULT SET :LOC-CFS end-exec
Fetch and loop until end of cursor
I can call DB2 stored procedures with just input and output parameters but not handling a result set.
Any suggestions?
regards
/Peter