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

    Unanswered: How to set up record paging with a stored proc?

    Hi everyone...I've got an ASP page that has an oracle stored proc in it. The problem is im paging records and since I have to run the entire query in the SP even though I'm only viewing say 15 at a time. This is coming at a very large costs because of the sheer amount of total records (20k +??)
    I've found this article:

    On writing a stored proc to do record paging on SQL server....Can anyone give me an example or a link with further info on settnig up record paging with Oracle instead? This would get me out of a huge jam...

    Thank you in advance

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1
    Modify the procedure to take 2 extra IN parameters:
    p_from in integer,
    p_to in integer

    These can then be used in the query like this:
    select empno, ename, rn from
    ( select empno, ename, rownum rn from
      ( select empno, ename from emp
        order by empno
      where rownum <= p_to
    where rn >= p_from;
    Then call it from your ASP page with p_from and p_to values like 1 and 15, 15 and 30, 31 and 45 etc.

Posting Permissions

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