MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resultset and Output parameters of a DB2 SP

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
pradeepg
Beginner


Joined: 06 Jan 2003
Posts: 25
Topics: 12
Location: Columbus, OH

PostPosted: Mon Feb 24, 2003 11:57 am    Post subject: Resultset and Output parameters of a DB2 SP Reply with quote

Hi,

I am facing a probelm with DB2 SP's while calling it from (ASP pages or C++ components). I have defined my DB2 SP with one I/P and 2 O/P parameters. I will move SQLCODE to one of my Out Parameters and error message to other output parameter. When I am trying to display it in ASP page always these 2 parameters are showing zero and spaces respectively. This is happening only if I have RETURN CURSOR statement in my SP. Is it some thing to do with RESULTSET = 1definition so that we can only send Resultset to front end not the output parameteres, OR is it some mistake I am doing in front end programming. Same SP when I am executing from DB2 main driver proram then it is displaying the output parameters whatever I have populated in my SP.

Please share your thoughts.

Thanks,
Pradeep
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Wed Feb 26, 2003 4:25 pm    Post subject: Reply with quote

I have been waiting for a reply on this issue as I am having a similar problem. I am using a Visual Basic front end accessing an SP on the mainframe. When I return a resultset, I cannot access any output parameters. I ended up passing back any SQL Errors as a resultset and having the front end application check the fields being returned to determine if an error occurred.
Back to top
View user's profile Send private message
pradeepg1
Beginner


Joined: 06 Jan 2003
Posts: 20
Topics: 7
Location: Columbus, OH

PostPosted: Thu Feb 27, 2003 4:28 pm    Post subject: Reply with quote

At last we found the answer after doing lot of research on this.
In order to see the values in output parameters we need to close or destroy the recordset before accessing the output parameters.

say

SET RECORDSET = NOTHING

Hope this woud help you.

Folks are not responding as they use to. Please help other by responding immly. I am sure somebody must have faced the same problem and they also must have got the answer. Any how Thank God !
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Fri Feb 28, 2003 11:37 am    Post subject: Reply with quote

Pradeepq1,

I tried your solution and it worked great. Thanx.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group