472,995 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Using returned results from a stored procedure

Hi,

I am developing a Cobol/400 system, which will use information contained within a DB2/400 system, its possible that some of this information will also be used within a PC front end system. Because of this I thought I'd do all my I/O via stored procedures which can then be called from either system / platform and leave me only having to develop the I/O functionality once.

Its all going well until I tried to set up a stored procedure to retrieve a list.

My stored procedure is roughly as follows:
Expand|Select|Wrap|Line Numbers
  1. Create Procedure Chg/ObjectLst()                  
  2.   Result Sets 1                                   
  3.   Language SQL                                    
  4.   Set Option DbgView = *SOURCE                    
  5. --Set Option UsrPrf = *OWNER                      
  6.   Begin                                           
  7.  
  8.   Declare c1 Cursor For                           
  9.      Select a.objname
  10.         From Chg/Objects a 
  11.  
  12.    Open C1;                   
  13.    Set Result Sets Cursor C1; 
  14.  
  15. End;                          
  16.  
The cursor is a bit more complex than listed but I have run interactivly and confirmed it returns what I need.

The IBM redbooks give examples of how to use this in a VB program to retrieve results and it works, but as previously mentioned my main platform will be Cobol 400, does anyone know how to run the stored procedure within Cobol and use the returned cursor?

Thanks,

John.
Feb 26 '10 #1
0 1748

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

Similar topics

0
by: Steve Weet | last post by:
Does anyone know how to retrieve the values returned from an Informix Stored procedure in PHP. I have a procedure that returns 4 values but only 1 row. If I prepare it and then execute it I can...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
5
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
4
by: Janaka | last post by:
Hi this is kind of an ASP.NET/ADO.NET question. I've got a stored procedure on SQL Server that returns a results set. It also sets 3 output parameters in a seperate Select statement. When...
5
by: JIM.H. | last post by:
Hello, What is the easiest way to run a select SQL string and find out the number of row returned. If you give a code example it would be helpful? Jim.
2
by: Patrick Olurotimi Ige | last post by:
When i run the code below with stored proc :- I get only the first table results :-"templates" even if i fill the dataset with another table for example category,pages etc.. Any ideas? ...
2
by: Crash | last post by:
SQL Server 2005 SP1 Standard & Express ..NET 2.0 and ADO.NET C# Hi, I have a stored procedure that returns results from 3 select statements. When I "ExecuteDataset" from C# code the...
4
by: red vertigo | last post by:
HI All, Can't quite get my head aorund this problem. My knowledge or more importantly my experience of using T-SQL is small and as a consequence my stored procedures are basic. My current...
3
by: Bogdan | last post by:
Hi, I've been struggling subqueries/joins and table adapters for some time and can't find a clear answer. I have a stored procedure that returns columns from 2 tables. Two columns from the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.