Hi all, I am sharing my problem to all of you for need help to resolve it. I am going to retrieve millions data from a table.Now I want to retrieve data part by part wise by ResultSet, giving some example like,a table having 1000 of rows now I want to retrieve those data in 10 steps. like in one steps ResultSet limit 0 to 100, and after finish 1 step 2nd ResultSet limit come 101 to 200. So if you have done like this or faced like it. please reply me.
Karthi, the title of the post includes the phrase "in Oracle database". True, it would have been better to mention that in the body of the post, but at least it's somewhere.
While this might work in some caises, it is risky in two ways: 1) You are ordering by whichever field is first. If the column order changes, the order by changes. Stating the column explicitly is safer. 2) The rownum <= upperlimit is not correct as it depends on the order by. This is functionally wrong.
See the Ask Tom article again, in particular the section titled "Pagination with ROWNUM". He shows the pattern to use is: