APEX sum different fields on a form

APEX sum different fields on a form

I want to create a page item display only that sums 2 other page itens on a form.
P1_A is a number field with a mask of currency.
P1_B is a display only field based on a database query that returns a single value.
My P1_C is a display only field that I am trying to use as a source the following query:
select :P1_A+:P1_B from dual;
However, this is my result :
Error computing item source value for page item P1_C.

ORA-01722: número inválido
Technical Info (only visible for developers)

is_internal_error: true
ora_sqlcode: -1722
ora_sqlerrm: ORA-01722: número inválido
component.id: 283302822642071708
component.name: P1_C

ORA-06512: em “SYS.DBMS_SYS_SQL”, line 1942
ORA-06512: em “SYS.WWV_DBMS_SQL”, line 1334
ORA-06512: em “SYS.WWV_DBMS_SQL”, line 1358
ORA-06512: em “SYS.WWV_DBMS_SQL”, line 1375
ORA-06512: em “APEX_040100.WWV_FLOW_DYNAMIC_EXEC”, line 776
ORA-06512: em “APEX_040100.WWV_FLOW_FORMS”, line 580

I believe it has been caused by the currency format, but I can not remove it. So, what did I miss to avoid this error?


Solution 1:

Just convert the text (P1_A) to number when using it in the sum calculations.

Example: TO_NUMBER('$94 567,00', 'L999G999D00', NLS_NUMERIC_CHARACTERS ', ')