How to catch 'too-many-rows' exception for the SELECT ... INTO statement?

Given The following SQL statement:
SELECT COLUMN1, COLUMN2
INTO ITEM1, ITEM2
FROM TABLE1
WHERE COLUMN1 = X AND
COLUMN2 = Y;
As I know, NO_DATA_FOUND error will be generated when nothing is found. However, if more than 1 row is returned, what is the reserved error word should i use?
Thanks for any help!

Bearing in mind exception names have underscores rather than hyphens, you have answered your own question!

Similar Messages

  • How much is too much to wait for the computer to work

    I need some help and ideas on this one since I am about to throw out every Apple product I have out the window.
    Let me try and keep it short:
    got my iMac end of June
    it crashes mid September
    took it to authorized service, told it will be fixed in two days, took them 35 days
    since I got it back it was always crashing and not working properly even though they said they replaced the hard drive and logic board and that that was the original problem with it
    about 20 days later when I saw there are too many problems with it to me something minor (internal mic never worked since I got it back from service, crashing all the time, iMovies won't open because of some mess in iPhoto library, etc)
    Apple sent on site repair, the guy replaced 7 parts in the computer!
    7-10 days later, the computer shuts down in the middle of the movie and won't turn back on.
    Before sending on site repair guy, the senior adviser told me that if the repair doesn't get my computer to stay working, I will get my computer replaced. After the computer died this last time, I called him and can not get him to call me back. I actually called him twice this week, in his work hours and didn't get a call back. So I guess all their "I am so sorry for the inconvenience, we will get to the bottom of this and get your computer working or replace it" is just bs they tell you to get you off the phone??
    Now the new senior ad. says I will get replacement if this repair doesn't work. Also was told I will get a call back from repair service in 24 hrs, which didn't happen. So here we go again! I even called the very first sen. ad. I got the number from - yes, you can guess, never heard back from her either.
    I have a list of 4 or 5 senior advisers that all tell me to call them if something we agreed on doesn't work, but I never can get to them nor do I get call backs.
    So out of the 5+ months I had the computer so far, it worked as much as it was broken. Now with holidays coming, who knows how long will I have to wait.
    This is really frustrating, to be told they will fix it or replace it yet I keep having to deal with not having a working computer.
    Is there anyone that is above the people that keep giving me their numbers without actually following up that I can contact and find out when can I get a working computer that doesn't have parts breaking down every week!!?!??!??!?

    aSsirovich wrote:
    It's been almost more than a month since nokia released it,,, and it was supposed to be a worlwide release on oct 24th,,,, i don't feel like waiting for christmas nokia,,,,, we want the symbian belle preferably before the end of november at least..
    Belle firstly has not been released.
    secondly Belle will not be released for existing symbian ^3 or symbian anna phones till after the whole world has Anna, to which Canada and Australia and some other places still do not have.
    And lastly Nokia do not do world wide releases, they are released based on carrier approval.
    So when it is released it will be given to the carriers first for testing then once approved it will then be released to the public. If it is not approved due to errors it will be taken back and fixed, then resubmitted for testing and so on until it is approved. However if the carrier just says no they dont want it released, then Nokia will not release it at all to any customers that are on that carrier.
    So just like Anna, you will have to wait till it is ready and testing has been completed and the carriers give the approval.
    Skyee has confirmed that Belle will not be released until after the Anna roll out is completed.
    Please be patient

  • Exception too many rows...

    Hi
    I am getting two different outputs with following code depending upon i declare the variable in first or second way...
    when i declare the variable v_empno as number(10) and too many rows exception is raised....and after that i dbms this variable..it is null...
    but when i declare the same variable as table.column%type....and the similar scenario happens and i dbms the value of variable...it is not null...rather the first value from output of the query...
    declare
    --v_empno number(10);
    v_empno emp.empno%type;
    begin
    dbms_output.put_line('before '||v_empno );
    select empno into v_empno from emp;
    dbms_output.put_line('first '||v_empno);
    exception when too_many_rows then
    dbms_output.put_line('second '||v_empno);
    dbms_output.put_line('exception'||sqlerrm);
    end;
    is there any specific reason for this....
    ur comments plz
    Thanks
    Sidhu

    In 9i:
    SQL> declare
      2  --v_empno number(10);
      3  v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11  end;
    12  /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> declare
      2  v_empno number;
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11  end;
    12  /
    before
    second
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  declare
      2  v_empno number(10);
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11* end;
    SQL> /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.In 10G:
    SQL> declare
      2  v_empno number(10);
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11  end;
    12  /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  declare
      2  v_empno number;
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11* end;
    SQL> /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  declare
      2  --v_empno number;
      3  v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11* end;
    SQL> /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.Anyhow you should not rely on the fact Oracle fetches the first value into variable
    and keeps it when the excaprion is raised.
    Tom Kyte discusses the SELECT INTO issue here:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:7849913143702726938::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1205168148688
    Rgds.

  • ADF problem... too many objects exception

    Dear sirs...
    i created a custom method that loads data from a binary file and insert these data into a number of tables.
    the problem: when i insert a row into a specific view object i get too many objects exception , i am sure the table is empty and there is no duplicate in the primary key but i still have the problem.
    these information might help you...
    1- the project contains about 15 tables in two schemas
    2- i have one application module
    3- more than 50 view objects
    thanks for help in advance
    best regards

    There are multiple ways to do good the. You can put a button on the page bind it to the rollback operation. Or you catch the jbo exception and show it in a dialog. When the user closed the dialog you call rollback.
    Timo

  • Too many rows found

    I have two data blocks, one data block joins two tables and second datablock is based on one table.
    first datablock has all fields with 1:1 relationship with Packing_id and second data block details has multiple rows
    for every Packing_id. I wrote 2 procs for 2 datablocks are called in respective Post-Query trigger.
    My problem is when I am running forms it gives error Message('too many rows found_orders_begin');
    Here are my codes.
    PROCEDURE post_query IS
    CURSOR mast_cur IS
    SELECT pa.ship_to_last_name,
    pa.ship_to_first_name,
    pa.ship_to_address1,
    pa.ship_to_address2,
    pa.ship_to_city,
    p.packing_id,
    FROM packing_attributes pa,packing p
    WHERE p.packing_id ; = pa.packing_id
    AND p.packing_id ; = :PACKING_JOINED.PACKING_ID;
    BEGIN
    Message('too many rows found_orders_begin');
    OPEN mast_cur;
    loop
    FETCH mast_cur INTO :PACKING_JOINED.SHIP_TO_LAST_NAME,
    :PACKING_JOINED.SHIP_TO_FIRST_NAME,
    :PACKING_JOINED.SHIP_TO_ADDRESS1,
    :PACKING_JOINED.SHIP_TO_ADDRESS2,
    :PACKING_JOINED.SHIP_TO_CITY,
    :PACKING_JOINED.PACKING_ID,
    end loop;
    CLOSE mast_cur;
    EXCEPTION
    WHEN too_many_rows THEN
    Message('too many rows found');
    WHEN no_data_found THEN
    Message('no data was found there');
    WHEN OTHERS THEN
    Message('do something else');
    END post_query;
    Detail proc
    PROCEDURE post_query IS
    CURSOR det_cur IS
    SELECT pd.quantity,
    pd.stock_number,
    FROM packing_details pd,packing p
    WHERE p.packing_id ; = pd.packing_id
    AND pd.packing_id = :PACKING_JOINED.PACKING_ID;
    BEGIN
    Message('too many rows found_pack_begin');
    OPEN det_cur;
    FETCH det_cur INTO
    :DETAILS.QUANTITY,
    :DETAILS.STOCK_NUMBER,
    CLOSE det_cur;
    EXCEPTION
    WHEN too_many_rows THEN
    Message('too many rows found');
    WHEN no_data_found THEN
    Message('no data was found there');
    WHEN OTHERS THEN
    Message('do something else');
    END post_query;
    Thanks in advance for your help.
    Sandy

    Thanks for reply.
    Maybe it gives this message because you have programmed to show this message ?
    I intentionally gave this message to see how far my code is working,if I don't give this message and execute query I get FRM-41050:You cannot update this record.
    Even though I am not updating record(I am querying record) and data block UPdate Allowed is set to NO.
    Some additional comments on your code:
    What is the loop supposed to do? You just fill the same fields in forms repeating with the values of your cursor, so after the loop the last record from your query will be shown. In general, in POST-QUERY you read Lookup's, not details.
    Sorry but I have no idea how to show detail records,thats why i tried with loop. In first proc I will have only 1 row returned so I guess I don't need loop in that proc?
    In second there will be multiple rows for one packing_id(packing_id is common column for both block), please let me know how to do that?
    Your exception-handler for NO_DATA_FOUND and TOO_MANY_ROWS are useless, for these errors cannot be raised using a cursor-for-loop
    I will remove these. Thanks
    Sandy
    Edited by: sandy162 on Apr 2, 2009 1:28 PM

  • List of Value: Best practice when there are too many rows.

    Hi,
    I am working in JDev12c. Imagine the following scenario. We have an employee table and the organization_id as one of its attributes. I want to set up a LOV for this attribute. For what I understand, if the Organization table contains too many rows, this will create an extreme overhead (like 3000 rows), also, would be impossible to scroll down in a simple LOV. So, I have decided the obvious option; to use the LOV as a Combo Box with List of Values. Great so far.
    That LOV will be use for each user, but it doesn't really depend of the user and the list of organization will rarely change. I have a sharedApplicationModule that I am using to retrieve lookup values from DB. Do you think would be OK to put my ORGANIZATION VO in there and create the View Accessor for my LOV in the Employees View?
    What considerations should I take in term of TUNING the Organization VO?
    Regards

    Hi Raghava,
    as I said, "Preparation Failed" may be (if I recall correctly) as early as the HTTP request to even get the document for indexing. If this is not possible for TREX, then of course the indexing fails.
    What I suggested was a manual reproduction. So log on to the TREX host (preferrably with the user that TREX uses to access the documents) and then simply try to open one of the docs with the "failed" status by pasting its address in the browser. If this does not work, you have a pretty good idea what's happening.
    Unfortunately, if that were the case, this would the be some issue in network communications or ticketing and authorizatuions, which I can not tell you from here how to solve.
    In any case, I would advise to open a support message to SAP - probably rather under the portal component than under TREX, as I do not assume that this stage of a queue error has anything to do with the actual engine.
    Best,
    Karsten

  • Jpeg to gif ( too many color exception !)

    Dear all :
    I want to convert a jpeg file to gif file (no need to animation's one ) using java . I have found a source program (GIFEncoder ) that convert the image to the gif file . But when i using the class to convert a jpeg to gif, a ' too many color exception ' has return . It is not diffcult to think why the exception happen , it is because the jpeg is always represent in true color (24 bits) , while the gif can only display 256 color (8 bits) . so , i have no ideas that how to create a 256 color jpeg using java ? because the JPEGEncoder package provided by sun will create a 24 bits jpeg file .The JAI can't create the gif files as the animation features of gif files .
    So anyone can teach me the ways of how to create a 256 color jpeg using java , or a suggestions that create gif file using java ?
    Thanks in advance !

    Here's how I do it (it's not based on a color theory or anything, it's just the first thing that came to my mind when I needed this functionality in one of my applications):
    I set up a table with the 256 most frequently appearing colors in the image. Sometimes, these colors are too similar, so I use a little algorithm that makes sure that the colors are satisfyingly different. The algorithm takes a parameter (the color dispersion parameter) and works according to the following pseudocode:
    for all colors in the palette do:
    differential = 0;
    differential = abs(oldColor.red - newColor.red) + abs(oldColor.green - newColor.green) + abs(oldColor.blue - newColor.blue);
    if differential < color dispersion parameter
    don't add new color
    If the new color passes this test, it is added to the palette. Depending on your needs, you may want to let the user select the degree of "color dispersion". If the palette doesn't contain 256 colors after this first pass, I decrease the color dispersion parameter by one and loop over the colors again (keeping the palette from the first pass of course). When this parameter reaches 0, there must be 256 colors in the palette, or the picture wouldn't need to be converted.
    Then make an IndexColorModel from your palette data and set up a MemoryImageSource. From this you can create your image and do whatever you want with it.
    Hope this helps!

  • Too many Subscribers/Receivers for Queue

    The link of Feedback in Java EE 5 tutorial doesn't work, because of this I ask my question here.
    I have tried the " Simple Example of Synchronous Message Receives" in Chapter 32 of Java EE 5 tutorial.
    In case of destination type queue I got error message.
    The log of test:
    M:\java\javaeetutorial5\examples\jms\simple\producer\dist>appclient -client producer.jar queue 3
    Destination type is queue
    Sending message: This is message 1
    Sending message: This is message 2
    Sending message: This is message 3
    M:\java\javaeetutorial5\examples\jms\simple\producer\dist>cd ../../synchconsumer/dist
    M:\java\javaeetutorial5\examples\jms\simple\synchconsumer\dist>appclient -client synchconsumer.jar queue
    Destination type is queue
    Exception occurred: com.sun.messaging.jms.ResourceAllocationException: [C4073]:
    A JMS destination limit was reached. Too many Subscribers/Receivers for Queue :
    PhysicalQueue user=guest, broker=pc2900:7676(1442)
    My question: How can I configure the Queue for more subcribers/receivers?

    Hi,
    Depending on the version of JMS, this may be a limitation of iMQ PE Edition (This is early in the morning for me, I can't remember which one). So you can look at the documentation, this may be a limitation of PE versus SE or EE. If you can modify it it would be using either the command line imqcmd or the gui based, imqadmin. With it, you can get into the connection factory, and change the maximum number of active consumers onto the queue.
    I beleive that using glassfish (as 9) would alleviate this limitation, if it is there, since this is using openmq (imq v4.0).
    HTH
    TE

  • Can you have too many rows in a table?

    How many rows would you consider to be too many for a single table and how would you re-arrange the data if
    asked?
    any answers?
    sukai

    I have some tables with over 100 million rows that still perform well, and I'm sure much larger tables are possible.  The exact number of rows would vary significantly depending on a number of factors including:
    Power of the underlying hardware
    Use of the table – frequency of queries and updates
    Number of columns and data types of the columns
    Number of indexes
    Ultimately the answer probably comes down to performance – if queries, updates, inserts, index rebuilds, backups, etc. all perform well, then you do not yet have too many rows.
    The best way to rearrange the data would be horizontal partitioning.  It distributes the rows into multiple files; which provides a number of advantages including the potential to perform well with larger number of rows.
    http://msdn.microsoft.com/en-us/library/ms190787.aspx

  • Result set does not fit; it contains too many rows

    Dear All,
    We are in BI7 and running reports on Excel 2007. Even though number of rows limitation in Excel 2007 is more than  1Million, when I try to execute a report with more than 65k records of output, system is generating output only for 65k rows with message "Result set does not fit; it contains too many rows".
    Our Patch levels:
    GUI - 7.10
    Patch level is 11
    Is there any way to generate more than 65000 rows in Bex?
    Thanks in advance...
    regards,
    Raju
    Dear Gurus,
    Could you please shed some light on this issue?
    thanks and regards,
    Raju
    Edited by: VaraPrasadraju Potturi on Apr 14, 2009 3:13 AM

    Vara Prasad,
    This has been discussed on the forums - for reasons of backward compatibility I do not think BEx supports more that 65000 rows .... I am still not sure about the same since I have not tried out a query with more that 65K rows on excel 2007 but I think this is not possible...

  • When I choose a song on my iPhone 5c, it deletes them all except for the ones I have purchased off of iTunes. How do I fix this and why is it happening?

    Ok. So if you didn't know, there are some sites that allow you to download music for free legally. For example many industry artists release "free albums" or "mixtapes" just for their fan base. They are uploaded by the actual artists themselves and downloaded by millions of fans. However when I choose to play one on my iPhone 5c, all of them get deleted except for the iTunes purchased songs. This has never happened before and I would like to know why it is happening now, and how to fix it.
    Thanks.

    Hello yung ron,
    It may be that your iPhone's set to sync automatically, which can potentially remove any music that's been added to the device. It may help to set the device to 'manual mode,' so that you have complete and total control over what content is on the device.
    Managing content manually on iPhone, iPad, and iPod
    http://support.apple.com/kb/HT1535
    Cheers,
    Allen

  • Hi, All the information that I had on my desktop has gone, except for the hard drive logo, how can I get it back please?

    Hi, Can anyone help please, I have lost everything that was displayed on my desktop, except for the Mac HD, and I do not know how to retrieve it

    Hi Ronda,
    Thank you for the reply, underneath the hard drive logo, it says 55.77GB. 12.88GB free, do you think that it is too full? if so, what do I do to reduce it, you can probably tell computers are not my best subject. I include the Hardware overview, I hope that this helps
    Hardware Overview:
      Machine Name: iBook G4
      Machine Model: PowerBook6,7
      CPU Type: PowerPC G4 (1.1)
      Number Of CPUs: 1
      CPU Speed: 1.42 GHz
      L2 Cache (per CPU): 512 KB
      Memory: 512 MB
      Bus Speed: 142 MHz
      Boot ROM Version: 4.9.3f0
    Best wishes
    Ragmah

  • Too many recipients found for message type ORDERS in the ALE model

    Hi all ,
    please help me to solve this issue .
    i done with ale settings .
    orders message type is used in 2 different model view for 2 different systems
    when i create po it is giving error in output  "Too many recipients found for message type ORDERS in the ALE model"
    how can i rectify this error.
    Thanks

    > orders message type is used in 2 different model view for 2 different systems
    do both of them carter diffrent needs or is it the same idoc which is being sent to diffrent systems?
    if yes, then use a single model view with noth receiver systems defined in it.
    if not, i would suggest, copying the standard idoc and create a zidoc and then use different ones for diffrent receivers....
    or u can use diff versions of the orders message type...
    say orders05 for one.... receiver and orders02 for another one....
    hope this helps!!
    Cheers!!
    Sidharth

  • ALE settings error   "Too many recipients found for message type" urgent

    Hi all ,
    please help me to solve this issue !!!!!!!!
    i done with ale settings .
    in the bd64 , orders message type is used in 2 different model view for 2 different systems
    when i create po it is giving error in output "Too many recipients found for message type ORDERS in the ALE model"
    how can i rectify this error.
    Thanks

    Hi,
    Try to redefine your distribution model to have both receivers of your message type ORDERS in one "model view".
    Regards,
    Jakub

  • Too many recipients found for message type (Distribution model)

    Hi,
    I wanna send Dilvery note using message type DESADV from a SAP system to another non-SAP System.
    I have Created port partner profile and distribution model.
    But the Problem is the same message type DESADV is used to send Dilvery from SAP System to another SAP Client.
    Idoc getting failed and throwing error stating ‘Too many recipients found for message type DESADV in the ALE model ‘.
    I am sure we can create the more than one recipients for same message types. I have done it some time back. Any help highly appreciated.
    Regards
    Raj

    This message pops up when SAP can't identify how to distribute the IDoc based on the settings in BD64. Take a look at the settings there, most likely you'll need to add a filter.
    The big ALE/EDI/IDoc book suggests that the same IDoc may be distributed to 2 different systems but specific details are not clear. It seems that one system should be configured first (it does mention a need to use a filter) and then somehow menu Edit -> Model View -> Distribute should be used.
    I've never done it myself though and have only run into that error when I missed some filter settings in BD64. Hope this helps.

Maybe you are looking for

  • HT4864 Mail once again not "online"; Anyone else having this issue?

    Anybody having Mail issues this afternoon? Monday 12/03/2012? iCloud support indicates systems are all online; however, when I login to iCloud and try to access email from there, I get the message that an error has happened and there are "missing res

  • Monitor occasionally takes a blue-green tint

    Why does my monitor occasionally, at very irregular times,  take on a blue green tint? It lasts from a few seconds to a few minutes, online and off. E. C. S.

  • How can compare two xml files.........

    Hi developers.......... I have a problem in compare two xml files.My project description is I take two xml(file1,file2) files.Compare file1 with file2. Now I want what are the same words in to the file2. file1: <hello> <html> <jsp:plugin> file2: <hel

  • Listing system component information

    I'd like to be able to get (and then display) the system component information in my .NET program using the .NET connector.  (The information contained within System->Status...->Component Information) Any idea on how to get this info? (More generally

  • BP Balance query?

    Hi experts, I need a query that will help me design a report for a customer. The query should show the journal entry transactions for business partners, that is their debit and credit transactions. Also the query should help me to design the report a