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

Getting SqlCODE = -991 while opening cursor.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Jul 04, 2012 6:42 pm
Reply with quote

Hi,
I have declared following cursor
DECLARE CARIERL CURSOR FOR
SELECT STATUS,AC_No,POLICY_NO,STATE_NO,
ADDR_NO,EFFEE_ABC,EXP_ABC,
CONCAT(FRST_NAME, LAST_NAME)
AFIRST_NAME, BLAST_NAME,
DAYS(EXP_DAT) - DAYS(CURRENT DATE),
SEQ_NO,AOIOOO,UISEQ_NO
FROM Table
WHERE SEQ_NO IN (
SELECT A.SEQ_NO
FROM TANBLED A ,
TABB B
WHERE A.ID = 'TANTAN' AND
A.SEQ_NO = B.SEQ_NO AND
( B.ACC_TANTAN = 'ME&U' OR
B.ACC_TANTAN = 'ME&I' OR
B.ACC_TANTAN = 'ME&O' OR
B.ACC_TANTAN = 'ME&L' OR)) AND
( STATUS = 'ACT ' AND
(DAYS(EXP_DATE) - DAYS(CURRENT DATE) <= 890
AND DAYS(EXP) - DAYS(CURRENT DATE) >= 1 )
OR ( STATUS = 'ROTLU' AND
(DAYS(CURRENT DATE) - DAYS(EXP_DATE) <= 30
AND DAYS(CURRENT DATE) - DAYS(EXP_DATE) >= 1)))


while opening the above curosr i am getting SQLCODE = -991.

May u explain why I am getting such error. In spufi I am able to execute the above qurey properly
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Jul 04, 2012 6:50 pm
Reply with quote

When you look up the manual what does it say about -991? I could look it up but why should I when you can? and, do you not know about using code tags for displaying your code and adat?
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Jul 04, 2012 6:52 pm
Reply with quote

I am not getting anything for -991 when trying to serach in google

THe SQL table I am llooking for cursor issue has no such code.
I am getting followin ,
SQLERRMC = 0008 00F30034
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Jul 04, 2012 6:55 pm
Reply with quote

SQLCODE -991, Error: CALL ATTACH WAS UNABLE TO ESTABLISH AN IMPLICIT CONNECT OR OPEN TO DB2.


How can i connect to DB2
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Jul 04, 2012 7:09 pm
Reply with quote

krunalbafna wrote:
SQLCODE -991, Error: CALL ATTACH WAS UNABLE TO ESTABLISH AN IMPLICIT CONNECT OR OPEN TO DB2.


How can i connect to DB2

Use a plan for which you're authorized.

BTW, since your Google-fu is obviously non-existent ("SQLCODE -991" gave me 4,250,000 hits), here is a link to the DB2 V10 troubleshooting guide. Enjoy
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 04, 2012 7:13 pm
Reply with quote

lick you finger, stick it in the plug.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jul 04, 2012 7:14 pm
Reply with quote

To answer your question, we have to guess:
1. In which program do you execute this SQL: is it a cobol program or rexx or something else ?
2. How do you run this program: with DSN or in EXEC PGM= or something else ?

You are not new on this Forum, you should know the rules! icon_evil.gif icon_evil.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Jul 04, 2012 7:36 pm
Reply with quote

Refer to ibmmainframes.com/about8550.html
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Jul 04, 2012 7:37 pm
Reply with quote

Also look at below explanation,

Verify that the application intended to use the call attachment facility
(CAF) as the mechanism to connect to DB2. For functions or stored
procedures running in the WLM-established stored procedure address space
the application must be link-edited with or dynamically allocate the RRS
attachment language interface module (DSNRLI), not CAF.
Back to top
View user's profile Send private message
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jul 04, 2012 10:03 pm
Reply with quote

Bind the program again with the id that you are running the program. The previous bind would have been done by some other user. Try and tell once

krunalbafna wrote:
Hi,
I have declared following cursor
DECLARE CARIERL CURSOR FOR
SELECT STATUS,AC_No,POLICY_NO,STATE_NO,
ADDR_NO,EFFEE_ABC,EXP_ABC,
CONCAT(FRST_NAME, LAST_NAME)
AFIRST_NAME, BLAST_NAME,
DAYS(EXP_DAT) - DAYS(CURRENT DATE),
SEQ_NO,AOIOOO,UISEQ_NO
FROM Table
WHERE SEQ_NO IN (
SELECT A.SEQ_NO
FROM TANBLED A ,
TABB B
WHERE A.ID = 'TANTAN' AND
A.SEQ_NO = B.SEQ_NO AND
( B.ACC_TANTAN = 'ME&U' OR
B.ACC_TANTAN = 'ME&I' OR
B.ACC_TANTAN = 'ME&O' OR
B.ACC_TANTAN = 'ME&L' OR)) AND
( STATUS = 'ACT ' AND
(DAYS(EXP_DATE) - DAYS(CURRENT DATE) <= 890
AND DAYS(EXP) - DAYS(CURRENT DATE) >= 1 )
OR ( STATUS = 'ROTLU' AND
(DAYS(CURRENT DATE) - DAYS(EXP_DATE) <= 30
AND DAYS(CURRENT DATE) - DAYS(EXP_DATE) >= 1)))


while opening the above curosr i am getting SQLCODE = -991.

May u explain why I am getting such error. In spufi I am able to execute the above qurey properly
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 DB2 for z/OS and LUW Admin Job Opening Mainframe Jobs 0
No new posts Looking For a PDS Member Without Open... PL/I & Assembler 10
No new posts Vision PLUS Mainframe opening Mainframe Jobs 0
No new posts Urgent MF opening for TCS India Mainframe Jobs 0
No new posts SQLCODE = -122 while using the scalar... DB2 4
Search our Forums:

Back to Top