Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!portal!cup.portal.com!Bron From: Bron@cup.portal.com (George Bron Faison) Newsgroups: comp.databases Subject: Re: Oracle: Previous Record Message-ID: <20532@cup.portal.com> Date: 17 Jul 89 05:45:09 GMT References: <3900001@tdpvax> Organization: The Portal System (TM) Lines: 38 ->In an article written 7/7/89 17:48 miker@tdpvax.UUCP writes: -> ->I am using Oracle on SCO386 Xenix and I wish to be able to be ->able to retrieve a previous record. I know that Oracle does ->not inherently have such an operation, although I am mystified ->as to why they don't. Does anybody know of a way to emulate 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. ->as to why they don't. Does anybody know of a way to emulate ->such an operation very effiently? Maybe there is an undocumented ->library call that somebody has found? You didn't mention *how* you are accessing your data in your posting, i.e. through SQL*Forms, Sql*Plus, Pro*C, etc. But, 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" as necessary. 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! (This is not to say that there might not be a legitimate reason...) Good Luck! ----------------------------------------------------------------------------- George "Bron" Faison Email: Bron@cup.portal.com USMAIL: Modern Office Systems Technology, Inc. "Be Still!" 6455 Penrith Drive Mechanicsville, VA 23111 Oracle & UNIX Phone: (804) 730-1467 (voice) -----------------------------------------------------------------------------