how to check item sold ? date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbldragon
    New Member
    • Mar 2012
    • 2

    how to check item sold ? date

    hi, guy can anybody help me please to create a trigger.

    example I have data:

    ITEM.......QTY. ......DATE
    ABC........100. .....1-jan-2012
    ABC........150. .....15-jan-2012

    on 25 jan 2012, ABC sold out 120, so i want data above remain like this:

    ITEM.......QTY. ......DATE
    ABC........0... ......1-Jan-2012
    ABC........30.. ......15-Jan-2012

    I'm new for oracle, please help me.

    Thanks in advance.
    Sorry for my bad English.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Please post the code that you are working on for review by experts.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      You shouldn't do it that way. What you have there looks like a transaction history table. Leave that alone. If you want a know the balance of inventory, there are two methods. One is to calculate it from the transaction history, the other is to store it in a separate table. The former method has less discrepancies but is slower to calculate the inventory while the latter method has more chance for discrepancy but the inventory is readily available. If you go with the latter method, you will want to do a discrepancy check every so often to make sure the numbers are in line.

      Comment

      Working...