Split a result set into equal parts

I am trying to use multi-threading in my code for faster performance. I get a result set using a stored procedure as follows -
      OPEN p_eft_noc FOR
            SELECT
            NOTICE_OF_CHANGE_ID,
            BATCH_NUMBER,
            ITEM_SEQ_NUMBER,
            ACCOUNT_NUMBER,
            ASSOCIATION_ID,
            MEMBERSHIP_NUMBER,
            ASSOCIATION_ID,
            PROCESS_DATE
            from NOTICE_OF_CHANGE eftnoc
        where nvl(eftnoc.process_date, 'N') <> 'Y'
        order by MEMBERSHIP_NUMBER;
This result set can return any number of rows from 0 to 3000. I am using java code and once I obtain the result set, i need to divide it into 8 parts so that each part is processed separately in a thread.
Can someone help me, i need to figure out how to divide this result set...and should i do it in stored procedure itself or in java code and how. Thanks...
smahaj2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sdstuberCommented:
easiest way would be to include a an extra column that designates your splits.

Does it matter how you thread it?

can the first row go to the first thread, 2nd row to second thread, up to 9th row to 1st thread again, and so on?

If so....

Then try something like this....
Each row will be identified by thread_id  0-7

OPEN p_eft_noc FOR
            SELECT
            MOD(ROWNUM,8)  thread_id
            NOTICE_OF_CHANGE_ID,
            BATCH_NUMBER,
            ITEM_SEQ_NUMBER,
            ACCOUNT_NUMBER,
            ASSOCIATION_ID,
            MEMBERSHIP_NUMBER,
            ASSOCIATION_ID,
            PROCESS_DATE
            from NOTICE_OF_CHANGE eftnoc
        where nvl(eftnoc.process_date, 'N') <> 'Y'
        order by MEMBERSHIP_NUMBER;



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sdstuberCommented:
Do you need any further help?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.