Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!apple!rutgers!aramis.rutgers.edu!topaz.rutgers.edu!paul.rutgers.edu!yes.rutgers.edu!emuleomo From: emuleomo@yes.rutgers.edu (Emuleomo) Newsgroups: comp.databases Subject: Re: Informix Question (Again) Summary: Informix/SQL Browse and Update Message-ID: Date: 6 Oct 89 17:15:19 GMT References: <1178@jpusa1.UUCP> Distribution: usa Organization: Rutgers Univ., New Brunswick, N.J. Lines: 32 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 had this same problem some time ago trying to port a Foxbase application to Informix. The trick I used was to declare 2 cursors. The 1st one a SCROLL cursor that will be used to retrieve the **SERIAL NUMBERS** of the records you need. The 2nd cursor will be used to select ONLY ONE record; i.e. the record that matches the current serial number!! Furthermore, this 2nd cursor will be declared *for update*. Now you can do NEXT, PREVIOUS, LAST etc.. on the SCROLL cursor and whenever you need to update the current record, all you need to do is fire off the *update* cursor!! This worked quite well and in the application I wrote. Watch out for records in the *active set* of the scroll cursor that may have been deleted. My approach was to inform the user that the record has JUST been deleted!! Hpoe this helps. --Emuleomo O.O. (emuleomo@yes.rutgers.edu) -- ** Writing error-free code MUST be magic! Why else is it sooo difficult to do?