View previous topic :: View next topic
|
Author |
Message |
tgwacker50
New User
Joined: 22 Jun 2020 Posts: 3 Location: USA
|
|
|
|
I am receiving a SQLCODE -991 on an OPEN CURSOR statement. The OPEN is in a COBOL program initialization process. The program is not called by another program. The format of the open is:
EXEC SQL
DECLARE cursor-name CURSOR FOR
SELECT column-name1, column-name2, …
FROM table-name
WHERE column-name = 0
ORDER BY column-name
END-EXEC
immediately after issuing the Coen statement, the SQLCODE is checked and that is when the -991 is detected. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2115 Location: USA
|
|
|
|
RTFM:
IBM Knowledge Center
Quote: |
-991 CALL ATTACH WAS UNABLE TO ESTABLISH AN IMPLICIT CONNECT OR OPEN TO DB2. RC1= rc1 RC2= rc2
Explanation
Call attach attempted to perform an implicit connect and open as the result of an SQL statement. The connect or open failed with the returned values. rc1The value returned in FRBRC1 for the failed CONNECT or OPEN request.rc2 The value returned in FRBRC2 for the failed CONNECT or OPEN request.
System action
The statement cannot be processed.
Programmer response
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.
SQLSTATE
57015
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3074 Location: NYC,USA
|
|
|
|
Your login ID needs a GRANT access to the Plan. |
|
Back to top |
|
|
|