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!

update table is delayed

Cass647Nov 22 2017 — edited Nov 22 2017

hi OTN. im having alittle trouble with my update procedure. I am trying to update my

salaries with a small equation in apex my procedure fires and everything but it will only update my table after i submit my page for the second time. in other words, when i want to change work out the net salary, i punch the value in, i click submit, and nothing happens, but when i go another employee, and do the same thing, the information i just put in by the previous employee is used to populate the net salary

this is the table structure:

Column NameData TypeNullableDefaultPrimary Key
EMPLOYEE_IDNUMBER(5,0)No-1
SALARYNUMBER(7,2)No--
COMMISSION_PCTNUMBER(5,2)Yes--
SALARY_DEDUCTIONNUMBER(7,2)Yes--
OVER_TIMENUMBER(5,0)Yes--
PENALTIESNUMBER(5,0)Yes--
BONUSNUMBER(7,2)Yes--
NET_SALARYNUMBER(8,2)Yes--

This is the procedure i am using

create or replace PROCEDURE update_salary_new(

    p_employee_id      IN NUMBER ,

    p_salary          IN NUMBER,

    p_salary_deduction IN NUMBER,

    p_penalties        IN NUMBER,

    p_bonus            IN NUMBER,

    p_over_time        IN NUMBER,

    p_commission_pct    IN NUMBER)

IS

BEGIN

update salaries

    set net_salary = (p_salary - nvl(p_salary_deduction,0) - nvl(p_penalties,0) + nvl(p_bonus,0) + nvl(p_over_time,0)),

        salary =            p_salary,

        salary_deduction =  nvl(p_salary_deduction,0),

        penalties =         nvl(p_penalties,0),

        bonus =             nvl(p_bonus,0),

        over_time=          nvl(p_over_time,0),

        commission_pct =    nvl(p_commission_pct,0)

  where employee_id = p_employee_id;

  commit;

end;

and this is how i link it to my dynamic action button in apex :

update_salary_new(

    p_employee_id      => :P7_EMPLOYEE_ID ,

    p_salary          => :P7_SALARY,

    p_salary_deduction => :P7_SALARY_DEDUCTION,

    p_penalties        => :P7_PENALTIES,

    p_bonus            => :P7_BONUS,

    p_over_time        => :P7_OVER_TIME,

    p_commission_pct => :P7_COMMISSION_PCT);

any help would be appreciated. i have been struggling for over a day now

***Moderator action (Timo): moved from   to for better alignment.***

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2017
Added on Nov 22 2017
5 comments
341 views