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!

ORA 1722: Invalid number in DA

Javier PFeb 14 2020 — edited Feb 14 2020

Hi all!

In Apex 19.2

Am having this invalid number error with a DA PL/SQL action that converts numbers to negative:

Capture3.JPG

PL/SQL code:

declare

nPrima number;

nDerrama number;

nCargo_adicional number;

begin

if :P33_TIPO_FACTURA IN ('Crédito','Cancelación') then

select -SIGN(to_number(:P33_PRIMA))*to_number(:P33_PRIMA) INTO nPrima FROM DUAL;

:P33_PRIMA := to_char(nPrima);

select -SIGN(to_number(:P33_DERRAMA))*to_number(:P33_DERRAMA) INTO nDerrama FROM DUAL;

:P33_DERRAMA := to_char(nDerrama);

select -SIGN(to_number(:P33_CARGO_ADICIONAL))*to_number(:P33_CARGO_ADICIONAL) INTO nCargo_adicional FROM DUAL;

:P33_CARGO_ADICIONAL := to_char(nCargo_adicional);

end if;

end;

When adding the record the values of the items are calculate this way in session state:

Capture.JPG

Everything works fine.

But when modifying the page and items are formatted

Capture2.JPG

I get the error.

The P33_PRIMA item is type number and this is its format mask:

Capture4.JPG

At least this is what I figured, that there is a problem with the format mask and values once the items is saved.

What could be wrong with the code?

Hope I explain the problem well!

Thanks for the help!

This post has been answered by InoL on Feb 14 2020
Jump to Answer
Comments
Post Details
Added on Feb 14 2020
8 comments
1,050 views