473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Stored Procedures and COBOL

1
How can I call a stored procedure when one of the parameters is a cursor? Shouldn't the COBOL code looks something like this? :

Expand|Select|Wrap|Line Numbers
  1. EXEC SQL
  2.     CALL CMQRACIN(<what do i place here?> :S-FINANCE-IN-DATA.ACCT-ID);
  3. END-EXEC
  4.  
By the way, the stored procedure looks like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. CREATE OR REPLACE PROCEDURE Cmqracin (P_REP_CURSOR IN OUT Cr_Package.CR_CURSOR, P_ACCT_ID IN CHAR) 
  3. IS
  4.  
  5. BEGIN
  6.  
  7.   DECLARE
  8.  
  9. ...
  10.  
  11. --Write the output fields
  12. OPEN P_REP_CURSOR FOR
  13. SELECT
  14.   CM_PAST_DUE_AMT CM_PAST_DUE_AMT,
  15.   CM_PAST_AMT_DUE_DT CM_PAST_AMT_DUE_DT,
  16.   CM_CURR_DUE_AMT CM_CURR_DUE_AMT,
  17.   CM_CURR_AMT_DUE_DT CM_CURR_AMT_DUE_DT,
  18.   CM_ACCT_BAL CM_ACCT_BAL,
  19.   CM_LAST_PAYM_DT CM_LAST_PAYM_DT,
  20.   CM_LAST_PAYM_RCVD CM_LAST_PAYM_RCVD,
  21.   RCR_CHG_AMT RCR_CHG_AMT,
  22.   CM_CASH_ONLY_IND CM_CASH_ONLY_IND,
  23.   CM_PASSW0RD CM_PASSW0RD,
  24.   CM_NEXT_PAYM_DT CM_NEXT_PAYM_DT,
  25.   CM_KEY_ACCT_ROLE CM_KEY_ACCT_ROLE,
  26.   INSTALL_DT INSTALL_DT
  27. FROM
  28.   DUAL;
  29.  
  30. END;
  31.  
Also, if i get pass the problem of the cursor being passed, how will i be able to retrieve the data from the cursor? Should the code look like an open, fetch, then close type of COBOL SQL call?
Sep 18 '06 #1
0 2494

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Scott Sauyet | last post by:
If this is not the appropriate forum, could someone please let me know? Thanks. I'm part of a very heterogeneous distributed development team, and a clash of cultures is causing some very...
2
by: Thomasb | last post by:
Hi! In our company we have a huge amount of COBOL sub-routines that are called from other COBOL-programs. Now we are looking for a method to call them from Windows/Web applications. One...
5
by: Rhino | last post by:
This question relates to DB2 Version 6 on OS/390. Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a sequential file? I am trying to debug a stored procedure. As far...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
1
by: JLE | last post by:
I'm new to stored procedures, however, the passing of parameters using a group item in the calling cobol program seems incorrect to me. Would this work? Calling COBOL pgm is calling a stored...
4
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
0
by: balaji krishna | last post by:
Hi, I need to handle the return set from COBOL stored procedure from my invoking Java program. I do not know, how many rows the stored proc SQL fetches.I have declared the cursor in that proc, but i...
0
by: pompeyoc | last post by:
I am trying to learn how to use stored procedures written in COBOL so I wrote 2 small programs to test it out: the stored procedure and the the calling program. I have no problems compiling them...
4
by: PJackson | last post by:
I have been given the task of taking a 3,200 line COBOL stored procedure and duplicating the same functionality in UDB 7.2 on the Windows platform with a procedural SQL stored procedure. I have...
1
by: rsreeni | last post by:
Hi, We are planning to use Cobol Stored procedures for doing our Data retrieval from DB2 Tables. The stored procedure(s) will be called from J2EE application via Db2 Connect. Does the linkage...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.