Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Develop Cursor

Re: Develop Cursor

From: Bastiaan Schaap <bschaap_at_desyde.nl>
Date: 2000/07/16
Message-ID: <newscache$956sxf$9b9$1@lnews.actcom.co.il>#1/1

Hi Jose,

I take it you are trying to write this cursor in a PL/SQL routine? If it's code controlled, you could base your cursor on a function. You could call your cursor with a number, that will be put into the function. By putting the function in your where clause you could control how many rows will be returned... Create a function that will test for every rownum if the result should be given. Your queury would look something like: select * from emp where rownum = give_me_set( rownum, 1 ); The give_me_set( rownum, setno ) function would check if the rownum 'fits' into the set... If you wanted the second set of 50 results, it would check if your rownum was between 51 and 100.. It has a big impact on your applications performance though... You will do a full tablescan for every returned set.. Maybe there's a more elegant solution, however I can't think of any.

I hope this helps,

Bastiaan Schaap
Oracle web development,
Desyde BV - Baarn
http://www.desyde.nl/
tel. +31355411711

José Gregório <jgregorio_at_inforlandia.pt> wrote in message news:396F2691.9F571FBE_at_inforlandia.pt...
> Hello.
>
> I need a cursor able to manage information of a query. I just
> want 50 rows at each time, and the cursor must return more 50 rows at
> next request. I can request the first 50 rows, the last 50 rows, or the
> previous/next 50 rows.
>
> Is it possible to do?
>
>
> Best regards,
>
> José Gregório.
>
Received on Sun Jul 16 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US