Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
← Back to SQLCODE Reference
Error

SQLCODE -510

Cursor with PREPARE not open

Explanation

FETCH or CLOSE on cursor with prepared statement that was not opened.

Solution

OPEN the cursor after PREPARE and before FETCH.

Example

Dynamic SQL cursor lifecycle