Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: Check if Next X records exist

    Hi all. I just want to know what the best way to have a stored procedure check if the next X number of records exist. Let's say 15...I have a stored proc, but I need to add some logic to it to return me 1 if there are more records, or a 0 if there are not for example.

    Perhaps it is easier if I add a count to the number of records that exist given the arguments that are already going into my stored proc?
    What would be the best way to go about this?

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1
    The next X records from where? If you mean from a cursor you already have open, then no: even Oracle doesn't know whether there are any more records until you fetch them. So your only option would be to actually (try to) fetch X more records, and then presumably keep the data in an array (collection) so that you can use it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts