View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
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 |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
lick you finger, stick it in the plug. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
preethan Warnings : 1 New User
Joined: 15 Dec 2008 Posts: 33 Location: Chennai
|
|
|
|
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 |
|
|
|