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!

help me in building a sql query that returns the 1st and 1000th record...

ManjitJul 6 2009 — edited Jul 6 2009
I have a EMP table
EMP
emp_id
emp_name


I want to process the entire table in group of 1000 records .That is 1000 records at a timee.

In short in PL-SQL I want to process the 1-1000 emp ids ,then the 1001-2000 emp_ids etc.


Can some one help me building a select query that will returm me records in this fashion


first_emp_id/last_emp_id
1 /1000
1001 /2000
2001 /3000
.
.
.

This way I can grab the first record suply my pl-sql batch the two starting and ending ids and let the batch process it.

I am planning to using dbms_job to run 10 batch at a time,each job will be supplied with the starting and endings ids.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2009
Added on Jul 6 2009
11 comments
839 views