• The cursor has been defined in one of the previous executions and never got closed and deallocated. Issue the close and deallocate commands by themselves or just get a new connection.

    The number of columns in your select list in the cursor has to match the number of columns you are fetching. You are missing 2 columns in the fetch.


    And then again, I might be wrong ...
    David Webb