Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Art S. Kagel — — source: Informix-list mailing list archive (1991-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
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.