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 

DB2 Stored procedure and dynamic sql.

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


Joined: 03 Aug 2004
Posts: 2
Topics: 1

PostPosted: Tue Aug 03, 2004 1:15 am    Post subject: DB2 Stored procedure and dynamic sql. Reply with quote

Hi,

I am facing some problem while testing the stored procedure.
I have coded a stored procedure with dydnamic sql. I am invoking the
stored procedure from a driver program which is a cobol batch program
with one exec call statement to invoke the stored procedure.

Both stored procedure and driver program are compiled through changeman.

When we executed the driver program , the stored procedure is not getting invoked. All the cobol statements before and after the call statement in the driver program is getting executed and the return code is zero.

I displayed the sqlcode after the call.
I got the following error message:

DSNT408I SQLCODE = -981, ERROR: THE SQL STATEMENT FAILED BECAUSE THE RRSAF COL OPERATIONS, REASON 00C12216

DSNT418I SQLSTATE = 57015 SQLSTATE RETURN CODE

DSNT415I SQLERRP = DSNARA00 SQL PROCEDURE DETECTING ERROR

DSNT416I SQLERRD = 0 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION

DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF'

X'00

MATION

The explanation for the above sql code is as follows

Explanation: The application program issued an SQL or IFI function request without a DB2 connection. SQL or IFI requests cannot be issued until IDENTIFY, SIGNON and CREATE THREAD processing have been completed.



We assume it is because of the DB2 connect problem.

But all the manuals say an explicit DB2 Connect is not required in a stored procedure.

Please let us know if there are any alternate solution for this.

Any help on this will be appreciated.



Thanks in advance!

- Jamshida.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Aug 03, 2004 5:39 am    Post subject: Reply with quote

Jamshida,

Check this link which explains in detail about the sql error code -981

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNMCH11/2.1.6.431?SHELF=&DT=20010718150520&CASE=

Check this link which explains in detail about the reason code 00C12216

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNMCH11/4.2.47?SHELF=&DT=20010718150520&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JAMSHIDA
Beginner


Joined: 03 Aug 2004
Posts: 2
Topics: 1

PostPosted: Tue Aug 03, 2004 6:04 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for the reply.

Please let us know if you are aware of any solution to rectify this problem other than issuing DB2 Connect.

Thanks and regards,

Jamshida
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