Bulk collect treats all lines not containing the LIMIT clause.

Hi all

I was referring the Oracle Site for COLLECTION in BULK.

http://www.Oracle.com/technology/oramag/Oracle/08-Mar/o28plsql.html

In the following code, I found and I ran the same.

I just want to know why motor Pl - SQL is not processing or recital 27 last lines when I use % NOTFOUND cursot attribute.


PROCEDURE process_all_rows_foi_test (p_limit PLS_INTEGER DEFAULT 100)
IS
   CURSOR c1
   IS
      SELECT *
        FROM all_objects
       WHERE ROWNUM <= 227;

   TYPE foi_rec IS TABLE OF c1%ROWTYPE
      INDEX BY PLS_INTEGER;

   v_foi_rec   foi_rec;
   v_number    NUMBER  := 1;
BEGIN
   OPEN c1;

   LOOP
      FETCH c1
      BULK COLLECT INTO v_foi_rec LIMIT p_limit;

      EXIT WHEN v_foi_rec.COUNT = 0;--------EXIT WHEN c1%NOTFOUND;--->Here is the issue
      DBMS_OUTPUT.put_line (v_number);
      v_number := v_number + 1;
   END LOOP;

   CLOSE c1;
END;
Please guide me on this.

Thank you
Arun

% NOTFOUND will have the value TRUE when it gets below the limit

(it is documented)

But your workaround works fine

SQL> declare
  2     CURSOR c1
  3     IS
  4        SELECT *
  5          FROM all_objects
  6         WHERE ROWNUM <= 227;
  7
  8     TYPE foi_rec IS TABLE OF c1%ROWTYPE
  9        INDEX BY PLS_INTEGER;
 10
 11     v_foi_rec   foi_rec;
 12     v_number    NUMBER  := 1;
 13  BEGIN
 14     OPEN c1;
 15
 16     LOOP
 17        FETCH c1
 18        BULK COLLECT INTO v_foi_rec LIMIT 100; --p_limit;
 19
 20        EXIT WHEN v_foi_rec.COUNT = 0;--------EXIT WHEN c1%NOTFOUND;--->Here is the issue
 21        DBMS_OUTPUT.put_line (v_foi_rec.count);
 22        v_number := v_number + 1;
 23     END LOOP;
 24
 25     CLOSE c1;
 26  END;
 27  /
100
100
27

PL/SQL procedure successfully completed.

SQL> 

Another option would be to place the EXIT right before your END LOOP;

Tags: Database

Similar Questions

  • Error 1074395241: The model descriptor does not contain the data required for the corresponding rotation invariant.

    Hi all

    I use the model Match 4 IMAQ to detect the angle of rotation of an image of model. However, it displays the error: "error 1074395241: the model descriptor does not contain the data required for the corresponding rotation invariant." What exactly is the problem? How to solve this problem? The details are explained below.

    My project is a bit complicated. Part of the block diagram containing the IMAQ Match model 4 is illustrated below:

    The source image is a series of images of images read from an AVI video (I used a loop for to process the images frame by frame). The image of the model is an area of the first selected image. So, this means, the user selected the ineterst object in the first frame of the video, and each of the following images to find the object corresponding interest & determine its rotation angle. When I run the above diagram, there no error. However, it shows the angle of rotation zero no matter what it is 'really '. Therefore, I changed the schema by adding parameters, listed below:

    But in this case, when I run it, it shows the error I mentioned in the subject line.

    If you need more information about my project to identify the problem, please let me know.

    Thanks in advance.

    S ' Please example from model that comes with labview First
    Go to labview Help > find examples and you can search for example.
    -You create model with angle range and what kind of special criteria you want to use.
    -To do this you must use IMAQ learn pattern before using IMAQ model Match 4
    Reference:http://zone.ni.com/reference/en-XX/help/370281U-01/imaqvision/imaq_match_pattern_4/

  • How can I get the top lines of the page, I have my toolbar back? The first line starting with 'file' on the right and the second line which contains the refersh button as well as the search bar disappeared. How to make a comeback?

    The first two lines of my toolbar disappeared. I find myself with most visited but the lines above, containing the button refresh, bookmarks, and search bar and above the one containing the links to the files, etc are passed, how do em back?

    == I was juggling the different bars and must have clicked smth, that I should not have.

    ALT V
    T
    M

    Don't forget to do this in a new empty tab.

  • the location does not contain the driver * for required processor architecture

    I'm trying to set up my hp laserjet as a shared printer on my network domestic. The printer is attached to a Win7 x 64 machine, all the other computers on my network are XP 32. When I try to load additional x 86 drivers on Win7 computer, I get the message: "the specified location does not contain the driver hp LaserJet 1320 PCL 5 for the architecture of processor required. I get this message, no matter which driver I try. I have tried several different choices of drivers XP 32. What I am doing wrong? where can I find the correct driver?

    Everyone,

    After the announcement yesterday, all of a sudden today, in Windows Update, there is a new driver PCL 6, Microsoft Update. I had to uninstall the printer in order to obtain this update to install. After this update, the shared property now would allow me to install the x 86 drivers. This update was not there yesterday, got to admit that Microsoft has acted quickly on this one.

    Brian & Jack thanks for trying to help!

    Ken

  • Windows 7 Installer error "Setup could not use the existing system partition because it does not contain the required free space.

    Repeatedly tried to install the upgrade to windows 7 and pure install and get the error message on all partitions available "Setup could not use the existing system partition because it does not contain the required free space.  All 3 partitions on a single disk have over 90 GB and separated from the disc more than 65 GB of free space according to the properties of the disk and initial screen during installation.  Tried to reformat a partition empty all reinstall Xp sp3 without result.  What can I do?

    Remove the data cable of all drives except the drive that you want to install Windows 7 on.

    Remove all external devices.

    Delete all partitions on the disk leave all of the disc as "unallocated".

    Boot from the Windows 7 DVD and then install, when you reach the point where it asks you to select a drive, click the "Advanced" option and create a new partition (at least 50 GB) to install Windows and continue with the installation process.

    Also: http://social.technet.microsoft.com/Forums/nb-NO/w7itproinstall/thread/1b1adc74-3d94-4897-a3c1-7aabde44fe4b

    JS
    http://www.PAGESTART.com

  • How can I search for all files not containing a speific (_) character in a folder in Windows 7?

    How can I search in Windows 7 for all files not containing a speific (_) character in the file?

    I have two files with about 50 000 files in each folder.  There are many copies of the same file (only one folder contains photos, the other file has data files.  In the two files copies have the same name as the original file, for example IMG01, but identified for example IMG01_1, IMG01_2, etc..)

    I would like to find all files that DO NOT have a _ in them.  Can I do this?  How?

    Or I have to search for all files that have a _ by searching for * _ *?  Delete these files?

    I tried, but program trotted for 2 hours.  Just take a while?

    I thought that if I could search only files without the _ it would be more effective.

    Less than 20% of the files in each folder have not a _ in them.

    You should be able to use a? or * to replace a number of characters that are either unique or variable.  * book would find both book and facebook, or? ook would only book.

    Anyway, there's probably not a way to identify the files corrupted by a search.

  • cannot save modified photos. receive messages - "Nothing has been imported" "the file or folders selected to import did not contain the supported file type.

    If anyone can help. I use Photoshop elements 13. I can save is no longer modified pictures. receive messages - "Nothing has been imported" "the file or folders selected to import did not contain the supported file type. It began a few weeks ago and I had a friend come fix it only 2 days ago. It took several hours and I lost all the tags I had on more than 10,000 images. Now he has done it again. I'm so angry. I lost a lot of things. I don't want to keep bothering him with that. Help, please.

    Yes, open with editor.

  • Generation does not contain the correct beta right?

    Hi all

    I'd be worried about this warning message?  Thank you.

    "Build 32.0.1.17.99204 does not contain the correct beta right '

    Looks like you need regenerate your provisioning profiles. See ios - App "does not contain the correct beta right" - stack overflow.

    Neil

  • The source does not contain the Image of HP recovery

    I am trying to create a bootable USB key with the HP recovery disk creation utility. After having moaned that my 8560w was working on battery power, and that he has no place on a USB stick formatted to FAT32 16 GB, I finished in the next screen that says ""source drive does not contain the Image of HP recovery " which is wrong: D partition is the main, contains the recovery disc." So what? Cannot create a recovery disk? Also note that I have no Recovery Manager (?) and F11 never worked (?). Decision of HP out of the PC business is probably the best thing that can happen to the customers.

    pher

    Hello

    See the link below:

    Creation of recovery disks or saving a recovery Image on a USB drive (Windows 7)

    Quote from this document:

    "Use a blank USB key with at least 32 GB of memory. HP recommends using a brand name of a manufacturer, to trust you. »

  • During the installation of Windows 7 Ultimate, get error, "the installation program could not use the existing system partition because it does not contain the need free space."

    When installing win7 ultimate, {install} error message indicates "Setup could not use the existing system partition because it does not contain the free space required... I have 500 GB free, ram 4 GB 2.4 ghz quad... any help?"

    If you have any external storage devices such as external hard drive or thumb drive, unplug them, they might interfere with installation.

  • the installation program could not use the existing partition because it does not contain the required free space

    before I have install android 5.0 lollipop on mylaptop but I can't use wifi to connect then I use return windows 8.1 and I decided to install windows 8 because I have experience an error I couldn't manage on windows 8.1 .when I try to install windows 8 it shows me this error Setup could not use the existing partition because it does not contain the required free space... I google search for the solution but could not find so I install the windows partition 8 on my system reserved.

    Hi Lawren,

    Thank you for your update on the issue.

    In this case, you may need to format the entire disk, clean the partitions and reinstall new windows as suggested before. However, I suggest you to contact local support for the backup of your data from hard disk partitions.

    Please post back your results for assistance.

  • I transferred X 1 pro overall to another PC, but opening I get the message "serial number you provided is valid but calling it a product was not found on this computer", the drop-down list of products responding to the does not contain the ProX1 op

    I transferred X 1 pro overall to another PC, but opening I get the message "serial number you provided is valid but calling it a product was not found on this computer", the drop-down list of products responding to the does not contain the option ProX1.

    Hi Carl,

    It seems that you have installed Acrobat XI pro as an upgrade and an upgrade you will need a serial number for a product older Acrobat X, etc. 9:

    See, error: "this serial number is not for a product calling it" | Adobe Creative Suite

    Also, I checked with your Adobe ID on the forums and I can only locate XI of Acrobat pro upgrade recorded, please check if you have registered an earlier version of Acrobat on some another email to get this serial number.

    Let us know if that helps.

    Kind regards

    Sandrine Bani

  • Is there a way to select all text objects containing the specified character?

    Is there a way to select all text objects containing the specified character?

    For example,.

    My work consists of points and numbers.

    Points are separated into blocks of text, so are numbers.

    I want to select all points, so I group.

    Or numbers and group together them.

    Screen Shot 2014-09-23 at 14.48.52.png

    Yes,

    -loop through all the elements of text

    -get each content

    -compare to '. '.

    -If the matching, save a reference to that block of text

    -When does with all frames

    -loop through all stored references and move to a group

  • I just installed CS6 Master Collection and I do not see the Acrobat application.

    I just installed CS6 Master Collection and I do not see the Acrobat application.

    I solved the problem and installed Acrobat this morning. The issue proved to be, as I suspected, that Adobe Reader had already been installed on the machine and, for some reason, this prevents the installation of Acrobat.

    Thanks for your help on this one.

  • WARNING: could not set the limit of asynch I/O

    Each night database generation of trace with WARNING below
    Anyone know what this means?

    WARNING: could not set the limit asynch I/O to 252 for SQL direct I/O. It is set to 200


    Oracle Version: 11.1.0.7
    AIX 5.3

    This is the bug number, you must place it in the bugs database.
    Search for metalink notes is easy (as well that I mentioned) and then click bug.

Maybe you are looking for