Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rownum or Fetch/offset is good to select and process million of records

user10463788Sep 16 2018 — edited Sep 18 2018

Hi,

I would like to read million of records from oracle and transfer to another table through Java.  Due to some reason we are using Java process we are going this.

I would like to ask best approach to select records from tables for examples 1000 records at a time..  Whether rownum is good or Fetch/Offset in 12c?

for example if the table has 10000 records following query i may use.

select * from table first 500 rows only  -- first time

select * from table offset 500 next 500 rows only ... second time  ( Is this time oracle again fetch 1000 records and send 500 rows to Resultset ..)

select * from table offset 1000 next 500 rows only ....Is this time oracle again fetch 1500 records and send 500 rows to resulset...

... so on

so I am not sure the best approach whether Rownum to select 500 records at a time or offset/fetch approach... need advise..

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2018
Added on Sep 16 2018
14 comments
5,759 views