This is odd or I am too tired but I dont get it (but I guess it is obvious). Here is the code :
for myVariable1 in (select distinct id from myTable1)
loop
begin
select myColumn into AVariable from myTable2 where id = myVariable1.id
exception
When TOO_MANY_ROWS then
dbms_output.put_line('TOO_MANY_ROWS for ' || myVariable1.id);
end;
end loop;
Quite simple and every id selected in myTable2 triggers a Too_MANY_ROWS exception though it is not the case.
here is my log:
TOO_MANY_ROWS for 7500123
TOO_MANY_ROWS for 5900123
Here is the result of the queries :
select myColumn from myTable2 where id = '7500123'
1 row returned
select myColumn from myTable2 where id = '5900123'
1 row returned.
Can somebody explain it ?