Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!texbell!merch!cpe!hal6000!tdpvax!miker From: miker@tdpvax.UUCP Newsgroups: comp.databases Subject: Re: Oracle: Previous Record Message-ID: <3900002@tdpvax> Date: 19 Jul 89 18:48:00 GMT References: <20532@cup.portal.com> Lines: 32 Nf-ID: #R:cup.portal.com:20532:tdpvax:3900002:000:1342 Nf-From: tdpvax.UUCP!miker Jul 19 13:48:00 1989 /* ---------- "Re: Oracle: Previous Record" ---------- */ > Because Oracle is a relational and SQL oriented database >which means you should think *sets* not record-at-a-time! >Previous record has no valid meaning in a truly relational system >where by definition physical ordering is irrelevant. OK, I really meant previous record in the context of the results of an SQL query. I don't care in what order Oracle stores rows internally. > You didn't mention *how* you are accessing your data in your posting, >i.e. through SQL*Forms, Sql*Plus, Pro*C, etc. I am using Pro*C. >I would suggest one method is to use the ROWID, just save each row's >ROWID in a "prevrow" variable and then use it to "recall the previous record" But I want to be able to 'Previous' all the way back to the first record if needed. If the table contains 100,000+ records than this gets ridiculous when one must build an internal table or external file and then re-execute a single record query to retreive the record. >Let me again caution you, however, that the very fact that you feel >the need to do this indicates to me that you may not be >"thinking relationally" in which case you are missing the >real power of Oracle and SQL! By that definition Oracle is voilating the same 'rules' in SQL*Forms. Michael Reamy Tandy Information Services