Hi Guys,
In a program I'm doing an operation as follows as my requirement is to update a column using cursor. But while using the FOR UPDATE OF clause in the cursor I'm getting the following error. Can you pls guide me in this regard?
db2 => DECLARE cur1 CURSOR WITH HOLD FOR select no from name FOR UPDATE OF no
DB20000I The SQL command completed successfully.
db2 => OPEN cur1
DB20000I The SQL command completed successfully.
db2 => FETCH cur1
NO
-----------
1
1 record(s) selected.
db2 => UPDATE name SET no=3 where CURRENT OF cur1
DB21031E The SQL statement using the cursor "CUR1" ("SQLCUR102") returned:
SQL0508N The cursor specified in the UPDATE or DELETE statement is not
positioned on a row. SQLSTATE=24504
db2 => ? 24504
SQLSTATE 24504: The cursor identified in the UPDATE, DELETE, SET, or GET
statement is not positioned on a row.