If a cursor is declared using "Order by" then it gives following error <br /> during updation of the cursor: <br />
ERROR: cursor "c" is not a simply updatable scan of table "test" <br /> Ex: <br /> DROP TABLE IF EXISTS test;<br />
createtable test (num int,num2 int );<br /> insert into test values(1,100);<br /> insert into test values(2,200);<br />
insertinto test values(3,300);<br /> insert into test values(4,400);<br /> insert into test values(5,500);<br /> BEGIN;
<br/> DECLARE c CURSOR FOR SELECT * FROM test ORDER BY num; <br /> FETCH 2 FROM c; <br /> UPDATE test SET num = 500
WHERECURRENT OF c; <br /> ERROR: cursor "c" is not a simply updatable scan of table "test" <br /> SELECT * FROM test;
<br/> FETCH 2 FROM c; <br /> COMMIT; <br /> SELECT * FROM test; <br /> FETCH 2 FROM c; <br /> COMMIT;<br /><br />
Commentsfor this...??<br /><br /> Regards,<br /> Dharmendra<br /><a
href="http://www.enterprisedb.com">www.enterprisedb.com</a><br/>