DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

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

Hybrid View

  1. #1
    Join Date
    Jun 2001
    Posts
    243
    I'm getting following error messages..what should I look for?


    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "RPIDB.RPI_MISC", line 690
    ORA-06512: at "RPIDB.RPI_ARMY", line 393
    ORA-06512: at line 20


    both RPI_MISC and RPI_ARMY are Procedures...

    Thanks.

  2. #2
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598
    hi,
    i think u r using some select *** into lv_var from table_name;
    here is the problem

    i think i hv helped u
    thnx,
    Cheers!
    OraKid.

  3. #3
    Join Date
    Jun 2001
    Posts
    243
    yes..I'm using select...into......
    what's my option to solve this problem?

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    write a query that returns one row. you can do this by running the query in SQLPlus without the into part of the query and see how many rows are returned. You can also add the distinct word to the clause.

    If you need further help post the query.

  5. #5
    Join Date
    Dec 2001
    Location
    Brazil
    Posts
    282

    Use a Cursor.

    DECLARE
    CURSOR cursor_name IS Select ... ;
    var1 ...
    var2 ...

    BEGIN
    OPEN cursor_name;
    LOOP
    FETCH cursor_name INTO var1, var2, ....
    .
    .
    .
    END LOOP;
    CLOSE cursor_name;
    END;


    F.




  6. #6
    Join Date
    Dec 2000
    Posts
    23
    generally that error occurs due to the select statement returns more than one value.
    means if u issue SELECT INTO from ...............
    so every variable can hold only one value at a time.
    so that if that select statment returns more than one value, then system doesn't understood which value should be stored in that variable.
    thats why the error occured.
    so u can try that using
    SELECT DISTINCT INTO from
    ...............
    or using cursors.

    Vth pleasure...
    Bhaskar Akkala.............
    sridhar garige

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  


    Click Here to Expand Forum to Full Width