Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: COBOL DB2 PROCEDURE

$
0
0

There is an example program in the Visual COBOL Samples Browser that defines a DB2 SP in COBOL that uses IN, INOUT and OUT parameters.

I just tried it here and it worked perfectly. The script to define the procedure to DB2 is:

DROP PROCEDURE GETEMPSVR;

CREATE PROCEDURE GETEMPSVR

(IN  EMPNO CHAR(6),

 INOUT SQLCD    INT ,

 OUT FIRSTNME CHAR(12),

 OUT LASTNAME CHAR(15),

 OUT HIREDATE CHAR(10),

 OUT SALARY   DEC(9,2) )  

 DYNAMIC RESULT SETS 0

   LANGUAGE COBOL

   PARAMETER STYLE GENERAL

   NO DBINFO

   FENCED

   NOT THREADSAFE

   READS SQL DATA

   PROGRAM TYPE SUB

   EXTERNAL NAME "getempsvr!getempsvr"  ;

Open up the Samples Browser from the Start menu and select SQL in the left hand window and then Db2storedproc (VS) in the left hand side. This goes against the DB2 Sample database which needs to be installed.

Please give this a try and see if you can get it to work.

Thanks.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>