Db2 (On Premises and Cloud)

Expand all | Collapse all

MutliRowInsert/MultiRowFetch doesn't precompile

  • 1.  MutliRowInsert/MultiRowFetch doesn't precompile

    Posted 30 days ago

    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

     

     

     

     

     

     

     

     

     

     



  • 2.  RE: MutliRowInsert/MultiRowFetch doesn't precompile

    Posted 30 days ago
    Hi Randy, let me pull in one of our experts here work through this with you.


  • 3.  RE: MutliRowInsert/MultiRowFetch doesn't precompile

    Posted Mon March 30, 2020 11:53 AM

    Hi Randy,

           We are in process of delivering the changes to DB2 v11.1 Mod 3 FP3.  Changes are not yet delivered, will let you know the build level once we deliver.