Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Cursor problem
Sat, May 2 2009 12:42 PMPermanent Link

Dieter Nagy
Hello, there is a problem for me.

EDB Manager 2.02 Build 11

I use this in a procedure

DECLARE StatCursor Cursor with return for stmt;
........

unprepare stmt;
    Prepare Stmt FROM 'Select * From Total_ALLES order by Runde'; <-----  order by runde make the problem
    Open StatCursor;

   FETCH FIRST FROM StatCursor (Runde) INTO I;
   UPDATE StatCursor SET RBeginn = I;
   UPDATE StatCursor SET RDIFFERENZ = I;
  
   WHILE NOT EOF(StatCursor) DO
   
   UPDATE StatCursor SET RBeginn = I;
   UPDATE StatCursor SET RDIFFERENZ = K;
   SET K = I;
   FETCH NEXT FROM StatCursor (Runde) INTO I;
    SET K = K-I;
 END WHILE;

I get the error:    ERROR #1000  An error ocurred with the cursor StatCursor(An attempt was made to update a read-only cursor)

When I remove the order by then it works.....

Please help me.
Dieter Nagy
Sat, May 2 2009 1:41 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Dieter,

You can only update SENSITIVE cursors and it looks like you are not obtaining a
sensitive cursor because you don't have an index defined for the column "Runde".

You can read more about cursor sensitiveness here:
http://www.elevatesoft.com/manual?action=mantopic&id=edb2sql&category=0&topic=17

--
Fernando Dias
[Team Elevate]
Sat, May 2 2009 3:59 PMPermanent Link

Dieter Nagy
Thanks for your help.
Dieter Nagy





Fernando Dias wrote:

Dieter,

You can only update SENSITIVE cursors and it looks like you are not obtaining a
sensitive cursor because you don't have an index defined for the column "Runde".

You can read more about cursor sensitiveness here:
http://www.elevatesoft.com/manual?action=mantopic&id=edb2sql&category=0&topic=17

--
Fernando Dias
[Team Elevate]
Image