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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Limit no of recs in cursor

RE: Limit no of recs in cursor

From: Justin Cave (DDBC) <jcave_at_ddbcinc.com>
Date: Wed, 17 Mar 2004 01:39:52 -0700
Message-ID: <87E9F113CEF1D211A4C3009027301874195DA8@ddbcinc.ddbc.local>


Can you explain a bit of background-- are you doing some processing of the rows (so that you want to eventually retrieve all the rows), are you doing some sort of paging (so users may or may not want to fetch the next page of data)? For the former, I would do bulk fetches into collections using the LIMIT clause, though I would tend to fetch records 1000 at a time rather than 1 000 000 at a time.

Will you always be fetching the next set of records in the same session that you fetched the first set of records? Will you be fetching the records in the same transaction?

Justin Cave
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of manoj.gurnani_at_polaris.co.in Sent: Wednesday, March 17, 2004 1:29 AM
To: oracle-l_at_freelists.org
Subject: RE: Limit no of recs in cursor
Importance: High

Hi,

   I want to process the remaining recs also. How can I achieve the below logic:
I.e if 5 lakh recs in cursor,the pl/sql script should pick 1 lakh recs in cursor. The next time I execute the same script,it should pick the next 1 lakh recs.

Thanks
Manoj

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Naveen, Nahata (IE10)
Sent: Wednesday, March 17, 2004 1:58 PM
To: oracle-l_at_freelists.org
Subject: RE: Limit no of recs in cursor

by using a WHERE clause?

If you already have a where clause in your query, then append the following:

AND rownum < 100

>-----Original Message-----
>From: manoj.gurnani_at_polaris.co.in [mailto:manoj.gurnani_at_polaris.co.in]
>Sent: Wednesday, March 17, 2004 1:27 PM
>To: oracle-l_at_freelists.org
>Subject: Limit no of recs in cursor
>Importance: High
>
>
>Hi All,
> I have a cursor which retrieves recs in lakhs .
>How can I limit the no of recs in the cursor.
>
>
>Thanks
>Manoj
>
>
>
>
>



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Wed Mar 17 2004 - 02:32:56 CST

Original text of this message

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