Re: scroll cursors ? esql-c prototypes ?
Posted in 1992
Quoting Christoph Adomeit... } } I wrote a nice tool in esql-c which allows the user to enter a select- } statement and then generates a screen for it and allows the user to } update all the columns he mentioned in the select-statement. This has } nothing to do with perform, i use my own screen handling. } This mainly works by using a scroll-cursor which fetches the data, and } a second "cursor for update" which handles updating. } When the user chooses "Previous", to reupdate the previous updated } statement, I've got a problem: Informix fetches the data from a temporary } table which holds the original data, it does not fetch the data, the } user already updated. So the user gets confused. } How can I force the database then to fetch the newer data. I can close } the cursor and reopen it. This will do it, but then I don't know how to } fetch the same row the user was working at because all this updating } works with a completely dynamical SQL-statement. Is there a way to } determine the number of the row in the active set (not the rowid) ?. } Then I could close the scroll cursor, redeclare and open it and do a } "fetch absolute". Then I would have the right row again. } Take a look at the code generated by DB4GLGEN. It has a rather interesting solution to the problem that you are describing. I only use one cursor to fetch through the database, and the data is ALWAYS current. DAS -- David Snyder @ Snide Computer Services - Folcroft, PA Current Release is db4glgen-3.7 UUCP: ..!uunet!das13!dave INTERNET: dave.snyder@snide.com