COBOL · DB2 SQLCODE

SQLCODE -502

What does SQLCODE -502 mean in COBOL?

Cursor already open. An OPEN was issued for a cursor that is already open.

SQLCODE -502DB2 for z/OS · Db2 (embedded SQL in COBOL)

Condition

Cursor already open. An OPEN was issued for a cursor that is already open.

Fix

Check for a duplicate OPEN CURSOR statement, often from error-handling logic that retries OPEN without first confirming the cursor was actually closed.

Pending source verification. Not yet checked against official documentation.

Related db2 sqlcode