Hi,
I have this PL/SQL code in a dynamic action in order to look for a values and fill some a page items.
declare
l_percent number;
l_comission number;
begin
if NVL(:P42_AGENCY_ID,'0') != 0 AND NVL(:P42_COMPANY_ID,'0') != 0 AND NVL(:P42_CODE_ID,'0') != 0 then
select percent, comision into l_porciento, l_comision
from comissions c
where c.agency\_id = :P42\_AGENCY\_ID
and c.company\_id = :P42\_COMPANY\_ID
and c.code\_id = :P42\_CODE\_ID;
IF l_percent is not null or l_comission is not null then
if NVL(l\_percent,'0') != 0 then
:P42\_PERCENT := to\_number(l\_percent);
else
:P42\_COMISSION := to\_number(l\_comission);
end if;
end if;
end if;
end;
The problem is when the query does not return any values.
I get this error:

How do I avoid this? That when there is no matching information on the search table I don't assign any values to the page items and don't get the error.
Thanks for the help!
Javier