IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Invoke a stored procedure (SQL) from a COBOL program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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: 355
Location: New York

PostPosted: Mon Sep 22, 2008 9:44 am
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top