PL/SQL (MOSC)

MOSC Banner

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

in PL/SQL (MOSC) 4 commentsAnswered ✓

Hello,

I have an issue where the following script returns ORA-01422.

my problem is that after handling the exception and checking my_row values, I found that it contains the values from the first record, and strangely did not store the date value.


/*CURRENT TABLE RECORDS*/

INSERT INTO test_table VALUES('A',TO_DATE('2022-03-29 00:00:00', 'YYYY-MM-DD HH24:MI:SS'));

INSERT INTO test_table VALUES('A',TO_DATE('2022-03-30 00:00:00', 'YYYY-MM-DD HH24:MI:SS'));

INSERT INTO test_table VALUES('B',TO_DATE('2022-03-29 00:00:00', 'YYYY-MM-DD HH24:MI:SS'));

/* ------------------- */

DECLARE

 my_row   test_table%ROWTYPE;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center