For example, if you tried to execute the following SQL statement:
SELECT supplier_id
INTO cnumber
from suppliers
where supplier_name = 'IBM';
And there was more than one record in the suppliers table with the supplier_name of IBM, you would receive the ORA-01422 error message.
In this case, it might be more prudent to create a cursor and retrieve each row if you are unsure of how many records you might retrieve.
SELECT supplier_id
INTO cnumber
from suppliers
where supplier_name = 'IBM';
And there was more than one record in the suppliers table with the supplier_name of IBM, you would receive the ORA-01422 error message.
In this case, it might be more prudent to create a cursor and retrieve each row if you are unsure of how many records you might retrieve.