Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!ucsd!ucsdhub!hp-sdd!ncr-sd!ncrlnk!uunet!mcvax!ukc!harrier.ukc.ac.uk!eagle.ukc.ac.uk!icdoc!bilpin!jim From: jim@bilpin.UUCP (jim) Newsgroups: comp.databases Subject: Oracle : Next/Previous row selection Keywords: Oracle cursor Pro*C previous row Message-ID: <686@bilpin.UUCP> Date: 2 Feb 89 12:47:55 GMT Organization: SRL, London, England Lines: 24 #{ v_database.1 } Oracle V5.1.17 Looking for an EFFICIENT solution to selecting NEXT or PREVIOUS row ( with respect to the indexed column(s) being selected upon ) in Pro*C. The first step wpuld seem to be opening two cursors, one with 'ORDER BY ... ASC' and the other with 'ORDER BY ... DESC', which is fine if you're always reading in the same direction, but falls down if you want to periodically change the direction in which you are reading through the table, as the pointers in the two active sets get out of synch, and you can only re-access a row from earlier in the active set by closing and re-opening the cursor and reading back to that point, which is going to be unacceptably slow. Anydoby solved this, or got any ideas? -- _______________________________________________________________________________ Path : mcvax!ukc!icdoc!bilpin!jim * Being paranoid doesn't mean that Who : Jim G, Hatfield, England * everybody ISN'T out to get you. _______________________________________________________________________________