Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011

    Unanswered: recording a sale (trigger)

    hey guys just wondering how would you create a trigger to record a sale

    Record a new Sale when a sale is made

    table schema
    sale_id Number(6),
    prod_qnty Number(5) NOT NULL,
    sale_price Number(6,2) NOT NULL,
    sale_date Date,
    prod_id Number(4) NOT NULL,
    cust_id Number(4) NOT NULL,
    discount Number(6,2)


  2. #2
    Join Date
    Mar 2007

    firstly you should decide on which database event (if you are requiring database trigger) should this trigger fire. Or, is it somehow connected with the application whichever language it is written in? Then you would post more about it, would not you?

    I see a vague requirement and a table description. Unfortunately, there is no map between them in your post. Based on this I would say: I would not write any trigger, just INSERT statement based on "sale" properties entered somehow somewhere on the time (or shortly after) "sale was made".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts