Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Invoke a stored procedure (SQL) from a COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
a69356

New User


Joined: 01 Dec 2006
Posts: 21
Location: Gurgaon

PostPosted: Sat Sep 20, 2008 1:44 am    Post subject: Invoke a stored procedure (SQL) from a COBOL program
Reply with quote

I need to invoke a stored procedure (SQL) from a COBOL program. The stored procedure returns ONE result set, so the last (meaningful) statement in the stored procedure is OPEN cursor name.
PLease let me know how will I do this?

It will of great help if anyone can provide me the sample code for this?

Thanks in advance.
Back to top
View user's profile Send private message

a69356

New User


Joined: 01 Dec 2006
Posts: 21
Location: Gurgaon

PostPosted: Sun Sep 21, 2008 4:31 pm    Post subject:
Reply with quote

My question is that When I call the stored procedure from the Cobol program then how will the SP(Stored Procedure) returns the resultset back to the calling program and how will the calling Program will handle it.As the last meaningful statement in the SP is OPEN Cursor.

Thanks
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon Sep 22, 2008 9:44 am    Post subject:
Reply with quote

In our shop, JAVA program extracts the result set. Open cursor will open the cursor and make available the rows to extarct either thru front end (like JAVA)or back end (Cobol-db2 program that calls SP).

As for as I know if u want to extract rows from back end, you have to fetch the rows from the program that calls the SP.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Sep 23, 2008 12:54 am    Post subject:
Reply with quote

This is the link for the pdf that describes how to handle the results in a calling program. I haven't gone through this pdf, but have gone through an earlier verion of this document and found it very helpful. http://www.redbooks.ibm.com/abstracts/sg247604.html?Open
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Sep 23, 2008 12:55 am    Post subject:
Reply with quote

Never mind the link I sent, it may not apply to you.
Back to top
View user's profile Send private message
a69356

New User


Joined: 01 Dec 2006
Posts: 21
Location: Gurgaon

PostPosted: Wed Sep 24, 2008 4:14 pm    Post subject:
Reply with quote

Thankyou very much.it is very helpful document. again thanks a lot
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us