| |
- Causa
- O nome do CURSOR cursor-name não está definido.
Cursor cursor-name está referenciado em uma declaração SQL, e uma das seguintes situação ocorreu:
- Cursor cursor-name was not declared (using the DECLARE CURSOR statement) or allocated (using the ALLOCATE CURSOR statement) in the
application program before it was referenced.
- Cursor cursor-name was referenced in a positioned UPDATE or DELETE statement which is not a supported operation for an allocated cursor.
- Cursor cursor-name was allocated, but a CLOSE cursor statement naming cursor-name was issued and deallocated the cursor
before this cursor reference.
- Cursor cursor-name was allocated, but a ROLLBACK operation occurred and deallocated the cursor before this cursor reference.
- Cursor cursor-name was allocated, but its associated cursor declared in a stored procedure was not declared WITH HOLD, and a COMMIT
operation occurred and deallocated the cursor before this cursor reference.
The COMMIT operation can be either explicit (the COMMIT statement) or implicit (that is, a stored procedure defined as COMMIT_ON_RETURN = 'Y'
was called before this cursor reference).
- Cursor cursor-name was allocated, but its associated stored procedure was called again since the cursor was allocated, new result sets
were returned, and cursor cursor-name was deallocated.
- Ação do sistema
- A declaração não pode ser executada.
- Resposta ao Desenvolvedor
- Check the application program for completeness and for a possible spelling error in the cursor declaration or allocation.
The declaration for or allocation of a cursor must appear in an application program before SQL statements that reference the cursor.
If the cursor-name was <UNKNOWN>, then the cursor was not successfully declared or allocated.
This can occur if SQL(DB2) was used, and a warning message was issued during precompilation.
Check the precompile output for warning messages on the DECLARE CURSOR or ALLOCATE CURSOR statement, and correct the statement.
For an allocated cursor, if an implicit or explicit COMMIT, ROLLBACK, or CLOSE occurred since the cursor was successfully allocated, modify the
application program logic to do one of the following:
- After the COMMIT, ROLLBACK, or CLOSE operation, call the associated stored procedure again, and reissue the ASSOCIATE LOCATORS and ALLOCATE CURSOR
statements.
- For COMMIT, declare the associated cursor in the stored procedure WITH HOLD so the COMMIT operation will not deallocate the cursor.
For an allocated cursor, if the associated stored procedure was called again and new result sets were returned since the cursor was allocated,
reissue the ASSOCIATE LOCATORS and ALLOCATE CURSOR statements.
SQLSTATE: 34000
© Copyright IBM Corp.
|
| |