ORA-01422: exact fetch returns more than requested number of rows

    You are trying to execute a select ... into ... inside a pl/sql block, but the select returns more than 1 row.



    A select into always need to return 1 row, if there is more than 1 row, this error is generated, if there are no rows returned, you will get the ORA-01403: No data found error message


    eg:


    declare
    do dba_objects%rowtype;
    begin
    select *
    into do
    from dba_objects
    where object_id in (1, 2);
    end;
    /

    declare
    *
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 4




Adverteren bij Daisycon
Forum Messages
22-FEB-2008 07:37:15 Reply
declare
do dba_objects%rowtype;
begin
select *
into do
from dba_objects
where object_id in (1, 2);
end;
/
Add your message for ORA-01422
Name:email:
Validation Code:cfw2tqhmvixio6nft
Enter Code above:
Title:
State your problem: