order by in cursor declaration does not allow update
От | Dharmendra Goyal |
---|---|
Тема | order by in cursor declaration does not allow update |
Дата | |
Msg-id | f87e6d710710242358mb97b12bu45c70d35681b6500@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: order by in cursor declaration does not allow update
Re: order by in cursor declaration does not allow update |
Список | pgsql-hackers |
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/>
В списке pgsql-hackers по дате отправления: