Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!wuarchive!texbell!sequoia!bob From: bob@sequoia.UUCP (Bob Kieras) Newsgroups: comp.databases Subject: Re: Informix Question (Again) Message-ID: <857@sequoia.UUCP> Date: 6 Oct 89 21:22:36 GMT References: <1178@jpusa1.UUCP> Reply-To: bob@sequoia.UUCP () Distribution: usa Organization: Execucom Systems Corp., Austin, Texas Lines: 31 In article <1178@jpusa1.UUCP> rick@jpusa1.UUCP (Rick Mills) writes: > > I have Informix 4GL 1.10 Rev A and a question... > > I would like to declare a scrolling cursor to select >a list of rows for a screen form. I want the ability to do a >Next-Previous with these rows, and update selectively as I go. > Is this possible without declaring a second cursor to >keep track of where I'm at in the list? Shouldn't this be easy? > I know that I have to reopen the cursor to realize any >updates I've made underneath the nose of the current one, but >then I start back at the beginning of the list... > I'm sure someone has wrestled with this one before - >Any help would be appreciated... Rick, I too wanted this sort of update as you go. This is how I solved the problem. When the user picks a record for update, the 4gl program first stores the rowid for that record. The record is then updated with an update sql statement like " Update xtabel set xxx= yyyy where rowid = stored_rowid". Then the cursor is closed and reopened. A while loop is used to position the cursor back to the record that was updated again by matching the rowid with the stored rowid. Then the updated record is displayed for review. This solution is brute force. It would grind too much if the cursor returned too many records and the record updated was the 500th one. In my case, the records to be scanned for update were already limited to a small number by the query the cursor was using. Hope this helps, Bob Kieras (usual disclaimer stuff)