468,103 Members | 1,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

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 2289

Post your reply

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

Similar topics

5 posts views Thread by Scott Sauyet | last post: by
5 posts views Thread by Rhino | last post: by
reply views Thread by pompeyoc | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.