Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting SqlCODE = -991 while opening cursor.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Getting SqlCODE = -991 while opening cursor.
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: 1712
Location: UK

PostPosted: Wed Jul 04, 2012 6:50 pm    Post subject:
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    Post subject: Reply to: Getting SqlCODE = -991 while opening cursor.
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Wed Jul 04, 2012 7:09 pm    Post subject:
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    Post subject:
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: 1218
Location: Israel

PostPosted: Wed Jul 04, 2012 7:14 pm    Post subject: Reply to: Getting SqlCODE = -991 while opening cursor.
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Jul 04, 2012 7:36 pm    Post subject: Reply to: Getting SqlCODE = -991 while opening cursor.
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Jul 04, 2012 7:37 pm    Post subject:
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    Post subject: Re: Getting SqlCODE = -991 while opening cursor.
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
This topic is locked: you cannot edit posts or make replies. Job Opening for 3 to 10 yrs exp. in I... princeaggarwal Mainframe Jobs 0 Sat Aug 20, 2016 3:17 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us