Re: Please help: invalid cursor state error ???
Posted in 1998
filtrasucur@my-dejanews.com wrote: > > I need some help here. > > I'm using esqlc and cursors in a program that should update a field from a > table, but I get this error message: SQLSTATE code 24000: INVALID CURSOR > STATE. > > And this is what I do: > > EXEC SQL declare micursor cursor for > select login into :login > from otp_users > where id_mode ="N" > for update of login; > > I open the cursor and then there's a loop with this (among other things): > > EXEC SQL fetch micursor into :login; > > EXEC SQL update otp_users set login= :login > where current of micursor; > > Besides, if the cursor is declared with the "for update" statement I get > nothing when I print out the content of the login variable. > > What am I doing wrong? Try getting rid of the "into :login" clause in the cursor declaration. It does not belong there but only in the FETCH. Art S. Kagel