Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6543029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:17:50+00:00 2026-05-25T11:17:50+00:00

As the title says, how to bulk collect into a nested table with LIMIT

  • 0

As the title says, how to bulk collect into a nested table with LIMIT clause?
In the following examples, cur_data is a nested table which gets overwritten on the subsequent BULK COLLECT. I have seen EXTEND used for adding data to a nested table. Is there any way to do something similar with BULIK COLLECT?

  OPEN cur;
  LOOP
      FETCH cur bulk collect INTO cur_data LIMIT 500;
      EXIT WHEN cur_data%COUNT=0;
  END LOOP;
  CLOSE cur;
  /*Data gets overwritten with empty cursor--> No data in cur_data here*/


  OPEN cur;
  FETCH cur bulk collect INTO cur_data;
  CLOSE cur;
  /*No Problems--> All data fetched into cur_data */

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:17:51+00:00Added an answer on May 25, 2026 at 11:17 am

    I’m not sure that I understand the problem you are trying to solve.

    If you want to load every row the is fetched from the cursor into your collection, there is no point to using the LIMIT clause. Simply

    OPEN cur;
    FETCH cur
     BULK COLLECT INTO cur_data;
    <<do something with the data>>
    CLOSE cur;
    

    If you want to use the LIMIT clause, that implies that you want to process a subset of the data returned from the cursor at a time in order to limit the amount of the server’s PGA that is allocated to your collection. Assuming you are doing that

    OPEN cur;
    LOOP
      FETCH cur
       BULK COLLECT INTO cur_data LIMIT 500;
      EXIT WHEN cur_data%count = 0;
      <<do something with the 500 elements in cur_data>>
    END LOOP;
    CLOSE cur;
    

    It doesn’t make any sense to fetch the data 500 rows at a time inside your loop and then do something with the collection outside of the loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title says it. I'm looking for a way to determine exactly which file/registry
Title says what i'm trying to do. I can successfully generate an assembly if
Title says it mostly. I want to add a simple extension method to the
Question title says it all really - a lot slower than VS2005, with a
As title says, how do I call a java class method from a jsp,
The title says it mostly. If I have an object in Python and want
The title says it! I know that Jon Skeet was working on an implementation
The title says enough I think. I have a full quality BufferedImage and I
As title says, im having trouble with my junit tests passing for checking if
Just what the title says, I need to change the password for an existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.