Re: scroll cursors ? esql-c prototypes ?
Posted in 1992
Christoph Adomeit writes: >hi esql-c freaks, > >I've got 2 problems with informix : >a) >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. There is no way to determine the "number of the row in the current set", though you could easily track it yourself. The problem is in guaranteeing that a subsequent fetch will have the rows in the sam eoreder as the previous one. This can really only be accomplished in a reliably repeatable fashion through the use of an orde rby (and that requires the order by to be on a column that cannot be altered by the user). For example, you could have a serial column with a unique index on it, and fetch the rows ordered by that column. > >b) >closely related to a) is my second - problem: Informix has nice-librarys: >libsql,libfesql ... , but nobody seems to know, what functions are >declared there, what they do and how to use them ? >Is there a library description or does at least someone have the prototypes >for all those functions ? These functions are generally not for end-user use. There are some folks who will provide prototypes for the sqli functions used by esql/c. The contents of libsql, libfesql, etc. though, are proprietary. Dave -- Disclaimer: These opinions are not those of Informix Software, Inc. ************************************************************************** "I look back with some satisfaction on what an idiot I was when I was 25, but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney