Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Possible to look ahead with a cursor

707697Jun 23 2009 — edited Jun 23 2009
I need to know if you can do sort of a cursor look ahead and view data from the next row in the cursor. I'll try to succinctly explain why, maybe there's a better solution.

We have several items that are valid through certain date ranges. The database was designed to only hold the starting date of an item, thinking that the end date could be calculated by looking at the start date of the next revision of that item. For instance:
Cert1 version 1's start date -> January 1, 2000

Cert1 version 2's start date -> January 1, 2002
From that we can deduce that Cert1 was valid between January 1, 2000 and December 31, 2001. Unfortunately, this isn't working out quite like I expected in my function because I don't have access to the second version information until AFTER I've already processed version one's information and the processing of version one is dependent upon the data in version two. I'm sure you can see where this is headed... =)

So is there a way I can read something out of the next row, without moving the cursor, or will I need to redesign that particular table in the DB?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2009
Added on Jun 23 2009
2 comments
901 views