Results 1 to 4 of 4

Thread: When i enter quantity it should display total

  1. #1
    Geek_Guest
    Guest

    When i enter quantity it should display total

    There is a menu contains fields: Item_id, Description, Rate, Quantity and Total.

    => Item_id contains 5 items.
    => rate and discription can be changed any time.

    now Question is when i enter quantity it should display total (formula)
    and suppose i choose 5 items and i enter quantities it shoud give me the total bill (Summary)

    Which triggers I can use to accomplish this task. and suppose I change the rate and discription what will happen?

    Question asked by visitor Manikumar


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: When i enter quantity it should display total

    no need to write triggers for this purpose.

    Triggers are written to implement some business logic .

    U can write a procedure for the purpose.


  3. #3
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: When i enter quantity it should display total

    you should use "before insert" trigger the statement you need to use would be like,

    :new.total := :new.rate * :new.quantity;


    But in ur case there is no need to use trigger itself. The following insert statement is sufficient,

    insert into item_table(Item_id, Description, Rate, Quantity,Total)
    values (lv_Item_id, lv_Description, lv_Rate, lv_Quantity ,lv_Rate * lv_Quantity)


    Hope this helps


  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: When i enter quantity it should display total

    Thats wha i have suggested.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact