Start of change

-514   THE CURSOR cursor-name IS NOT IN A PREPARED STATE

Explanation

The application program has tried to use a cursor, 'cursor-name,' that is not in a prepared state. The cursor is associated with a statement that:

  1. Was never prepared.
  2. Was invalidated by a commit or rollback operations

System action

The statement cannot be processed.

Programmer response

For case 1, ensure that you prepare the statement that is named in the DECLARE CURSOR statement for 'cursor-name' before you try to open the cursor.

For case 2, take one of the following actions:

  • Use the WITH HOLD option of DECLARE CURSOR.
  • Do not execute a commit or rollback operation until you are finished using the cursor.
  • Prepare the statement again after the commit or rollback.

SQLSTATE

26501

End of change