Error code

Oracle ORA-01422

ORACLEORA-01422
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

exact fetch returns more than requested number of rows — SELECT INTO got multiple rows.

How to fix it

  1. Replace SELECT INTO with a cursor to iterate over multiple rows.
  2. Add a more selective WHERE clause to ensure the query returns exactly one row.
  3. Use ROWNUM = 1 or FETCH FIRST 1 ROW ONLY as a last resort if only the first row is needed.

Not affiliated with Oracle. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.