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!

SQL: numeric or value error: character to number conversion error

elmo j hAug 27 2018 — edited Aug 28 2018

I have an After Submit computation in my APEX 5.1 application that looks like this:

Type:  PL/SQL Function Body

PL/SQLFunction Body:

return  fz_pct_of_total(:P2_ZORENRL_APPL, :P2_ZORENRL_INQ);

That PL/SQL function looks like this:

create or replace function fz_pct_of_total (num1   number,

                                            totl   number)

   return  number

as

   pct_of_total             number(12,4);

   begin

      -- If both numbers are positive, use normal calculation

      if num1 != 0 and totl != 0 then

         pct_of_total := (num1 / totl) * 100;

      else

         pct_of_total := 0;

      end if;

    return pct_of_total;

end;

The P2_ZORENRL_INQ, P2_ZORENRL_APPL, AND P2_ZORENRL_PCT_APPL fields are all defined as Number fields.

The format mask for P2_ZORENRL_PCT_APPL IS 999G999G999G999G990D0000

I don't understand why I'm getting this error.

When I look at the session variables after the error is displayed, they have the following values:
P2_ZORENRL_INQ        Number Field   1600

P2_ZORENRL_APPL       Number Field   1500

P2_ZORENRL_PCT_APPL   Number Field   93.75

Can anyone suggest other things to looks at?

This post has been answered by elmo j h on Aug 27 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2018
Added on Aug 27 2018
21 comments
1,245 views