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!

Invalid number while DML using format mask

Hi guys, i'm having an issue that i cannot deal yet. (I guess it's very easy, but I'm new at APEX).

I am using the table EMP and I'm using a button to insert and update (not the built-in) method, but a PL-SQL code.

In the form I use the column SAL (salary) and i used the format mask: FML999G999G999G999G990D00

The error returns “invalid number”, i removed the format for that colum “SAL” and it works like it should. Is there a way to ONLY limit the numbers and not the whole visible data? I use as an example 4000 and the format mask displays: $4,000.00 which is ok, but I only want the update or the insert to take numbers (4000, or 4000.00). Is it possible without html, css, or java code? If not, please what's the easiest way you handle this (without using the built-in DML)

Below the code:

Begin
  If :P21_Empno is NULL Then
     Begin
        Insert into EMP
            (ename, job, mgr, hiredate, sal, comm, deptno)
        values
           (:P21_ename, :P21_job, :P21_mgr, :P21_hiredate, :P21_sal, :P21_comm, :P21_deptno);
     End;
     :P21_Status := 'Inserted: '||:P21_Ename;
  Else
     Update Emp
        set Ename    = :P21_Ename, 
            Job      = :P21_job,
            MGR      = :P21_mgr,
            hiredate = :P21_hiredate, 
            sal      = :P21_sal, 
            comm     = :P21_comm, 
            deptno   = :P21_deptno
      where empno    = :P21_empno;
  End If;
  :P21_Status := 'Updated: '||:P21_Ename;
Exception
  When Others Then
     :P21_STATUS := ‘ERROR!!!!!!!!!!!!!!!!!!! Salary: ‘||:P21_Sal||’ ’||SqlErrM;
End;
This post has been answered by Solomon Yakobson on Nov 18 2024
Jump to Answer
Comments
Post Details
Added on Nov 17 2024
2 comments
230 views