Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Query result empty - no data found

Javier PNov 15 2019 — edited Nov 15 2019

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:

Capture.JPG

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

This post has been answered by fac586 on Nov 15 2019
Jump to Answer
Comments
Post Details
Added on Nov 15 2019
2 comments
344 views