← All errors

SQLCODE -508

SQL0508 Cursor not positioned on a locked row

IBM message text
Cursor &1 not positioned on locked row.
SQLCODE
-508
SQLSTATE
24504

Most common cause

UPDATE or DELETE WHERE CURRENT OF after the FETCH returned +100, or before any FETCH.

Other causes

  • A COMMIT HOLD or ROLLBACK HOLD released the lock on the current row.

How to fix it

Update only after a FETCH with SQLCODE = 0, and FETCH again after a COMMIT HOLD.

Text and codes from IBM documentation for 7.6. Checked on .