Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select Into doesn't work properly
You can't assign many results to ONE variable.
Check if it is normal that you have multiple rows returned. If it is, you
must use a cursor :
For line in (SELECT ID_1 FROM TABLE WHERE ID_2 = INPUT_PARAMETER) loop
l_num := line.id_1;
...
...
end loop;
Dirk his Linux bakje <d.joosen_at_planetinternet.nl> a écrit dans le message :
387C3429.C099DE6A_at_planetinternet.nl...
> Hi
>
> I have a problem with a stored procedure where I declared an Select Into
> statement like:
> l_num NUMBER;
> SELECT ID_1 INTO l_num FROM TABLE WHERE ID_2 = INPUT_PARAMETER;
> This occurs in a ORA-01422: exact fetch returns more than requested
> number of rows.
>
> When I type in PL/SQL the statement:
> SELECT ID_1 FROM TABLE WHERE ID_2 = INPUT_PARAMETER;
> Then the PL/SQL says: no rows selected
> You see PL/SQL has no problems.
>
> What do I wrong,?
> Thanks and with best regards
> Dirk Joosen
>
>
Received on Wed Jan 12 2000 - 03:12:23 CST
![]() |
![]() |