Installed the latest drop s1707130100) for DB2 V11.1 Mod 3 Fixpack 3which indicated it had support for multirowInsert/Fetch support in embedded COBOL applications but when I try to precompile program using IBM PRECOMPILER, I get error indicating no declared properly.
16 SQL0314N The host variable "w2-deptno" is incorrectly declared.
17 SQL0314N The host variable "w2-deptname" is incorrectly declared.
18 SQL0314N The host variable "w2-mgrno" is incorrectly declared.
19 SQL0314N The host variable "w2-admrdept" is incorrectly declared.
Definitions look like this:
01 w2-tbl.
05 w2-deptno pic x(6) occurs 10 times.
05 w2-deptname pic x(20) occurs 10 times.
05 w2-mgrno pic x(5) occurs 10 times.
05 w2-admrdept pic x(6) occurs 10 times.
So when it gets to multiple row INSERT statement, precompiler indicates error:
*exec sql insert into DEPT
* values
* (:w2-deptno
* ,:w2-deptname
* ,:w2-mgrno
*
*SQL4002N "W2-MGRNO" and "W2-DEPTNAME" are undeclared host
*variables that cannot both be used as descriptor names in a
*single SQL statement.
W2-MGRNO,:w2-admrdept
)
for :ws-no-rows rows
not atomic continue on sqlexception
end-exec
Sample code is based on IBM DB2 z/os example program
#Db2