[HACKERS] DML fails after updatable cursor is used with trigger returning function

2007-10-31 Thread Dharmendra Goyal
I created one function which updates a table using updatable cursor. I wrote one trigger also on the same table. When i execute the function it gives expected results. But after that all DMLs fail. CREATE TABLE test(i int, j int); Drop trigger test_trig; INSERT INTO test VALUES(1, 100); INSERT IN

Re: [HACKERS] order by in cursor declaration does not allow update

2007-10-25 Thread Dharmendra Goyal
"c" is not a simply updatable scan of table "test" SELECT * FROM test; FETCH 2 FROM c; COMMIT; SELECT * FROM test; FETCH 2 FROM c; COMMIT; Regards, Dharmendra www.enterprisedb.com On 10/25/07, Simon Riggs <[EMAIL PROTECTED]> wrote: > > On Thu, 2007-10-25 at 12:

[HACKERS] order by in cursor declaration does not allow update

2007-10-25 Thread Dharmendra Goyal
If a cursor is declared using "Order by" then it gives following error during updation of the cursor: ERROR: cursor "c" is not a simply updatable scan of table "test" Ex: DROP TABLE IF EXISTS test; create table test (num int,num2 int ); insert into test values(1,100); insert into test values(2,200

[HACKERS] second DML operation fails with updatable cursor

2007-10-24 Thread Dharmendra Goyal
b SET num=500 WHERE CURRENT OF c; DELETE FROM tab WHERE CURRENT OF c; --> This delete fails. SELECT * FROM tab; FETCH 2 FROM c; COMMIT; SELECT * FROM tab; FETCH 2 FROM c; Is this as expected..?? Thanks, Dharmendra Goyal