Home » SQL & PL/SQL » SQL & PL/SQL » Rownum
Rownum [message #2224] Sun, 30 June 2002 02:53 Go to next message
Maya
Messages: 7
Registered: May 2002
Junior Member
Hi,

I have a query that retrieves each time 100 rows from a table into buffer.
1) How can I guaranty that each time I will get the next 100 rows from the table ?
2) Also I would like that the buffers will have sequential order, meaning the first record on the next buffer will be sorted after the last record of the previous buffer ?

I also need to consider performance issue.

any help will be appreciate.

Thanks,
Maya
Re: Rownum [message #2243 is a reply to message #2224] Mon, 01 July 2002 12:46 Go to previous messageGo to next message
Dhiren
Messages: 43
Registered: July 2002
Member
What exactly do you mean by buffer/What are u using
sqlplus/forms or something else.
The behaviour of the buffer depends on these kind
of inputs.
eg. Forms has a property for a block - # of records
buffered which controls the behaviour of the
buffered rows.
Normally the orderby clause controls the sequencing
of the records displayed.

Dhiren
Re: Rownum [message #2247 is a reply to message #2243] Tue, 02 July 2002 00:23 Go to previous messageGo to next message
Maya
Messages: 7
Registered: May 2002
Junior Member
what I mean is that I have sql query in a function in pro-c program which brings 100 rows from the DB. I call this function several times from Cobol program, until the number of rows that I got is less then 100 - meaning it is the end of the table. I also commit changes to the DB after finishing to process the 100 rows I had.
The problem is that I need the first row in the second "buffer" to be sorted after the last row in the previous "buffer" of rows and so on.
I have order by but this will effect the selected rows after they were selected. I need something that will guaranty that every time we get 100 rows they are ordered after the previous 100 rows.

I have heard about connect_at command which allowing me to hold the cursor open even when committing the changes to the DB. It this the best solution ? is there something better ?

Thanks.

.
Re: Rownum [message #2255 is a reply to message #2247] Tue, 02 July 2002 06:12 Go to previous message
Dhiren
Messages: 43
Registered: July 2002
Member
Guess you will have to use
Start with and prior in your SELECT statement.
Check out how to use it on this link
http://oradoc.photo.net/ora81/DOC/server.815/a67779/ch4l.htm#10900

Hope this helps
Dhiren
Previous Topic: How to add Quotes while inserting a record
Next Topic: Date Difference in Oracle
Goto Forum:
  


Current Time: Tue May 07 02:39:42 CDT 2024