Whats wrong with the below cursor. It works well with oracle, but with db2 gives error "The FOR UPDATE clause is not allowed because the table specified by the cursor cannot be modified.. SQLCODE=-511, SQLSTATE=42829, "
CURSOR DED_CU(PCTYPE IN NUMBER) is
SELECT D.something, D.something2,
D.cid, D.used_something,D.type, crv.xrate,crv.xrate2
FROM xbx D, xvx CRV
WHERE D.cid = CRV.CACHE_KEY
AND CRV.CACHE_VALUE1 = Declaredvariable1 AND CACHE_TYPE=Declaredvariable2
AND D.used_something > 0
AND D.type = Declaredvariable3
ORDER BY D.something2, D.something
FOR UPDATE OF used_something;
I am using cursor in a stored procedure. I am new to DB2.