Re: PLSQL ORA-01422 & ORA-06512 fetch to many rows I NEED HELP PLS!!!

From: Ken Denny <ken_at_kendenny.com>
Date: Tue, 18 Jun 2002 16:13:20 GMT
Message-ID: <Xns92317E802F3A8kendenny_at_65.82.44.7>


iko_at_iko.demon.nl (iko) wrote in
news:ca270eb5.0206180153.33475013_at_posting.google.com:

> I've looked at the code 4 a week now and cant find the prob. IT
> returnes the ORA 01422 error. Pls help me out here im stuck !!! :(
> The error is in the two fetch statements or in the declare!

Despite what the message says about "fetch" the error is most likely not in a "fetch" statement. This error is most often caused by a "select column(s) into :variable(s) from table where ..." and there is more than one row which satisfies the "where" clause. A likely candidate in the code you posted is:
 select pers_key

      into Personeelsnummer
    from
      copie.personeel_key;

If copie.personeel_key has more than one row in it that would cause it. You can track it by adding the following code to your exception sections:

when too_many_rows then ...  

-- 
Ken Denny
http://www.kendenny.com/

History repeats itself.  Historians repeat each other.
Received on Tue Jun 18 2002 - 18:13:20 CEST

Original text of this message