2 Replies Latest reply: Nov 17, 2012 2:37 PM by Andreas Weiden RSS

    Quantity Update

    Moazam Shareef
      Hi Guyz,

      Im updating my stock table from material delivery table but it is not updating quantity is anything wrong with my below code, i wrote the below code on PRE-INSERT form level on one details tubular block.

      when user commit the form it should update the quantity.
      IF NVL(:MN_MDV_DET.BAL_QTY,0)>=0 THEN
           UPDATE MN_STK_DET
           SET QTY=NVL(QTY,0)- NVL(:MN_MDV_DET.GVN_QTY,0)
           WHERE ITEM_NO=:MN_MDV_DET.ITEM_NO AND UOM=:MN_MDV_DET.UOM;
      ELSIF
           NVL(:MN_MDV_DET.BAL_QTY,0)<=0 THEN
           UPDATE MN_STK_DET
           SET QTY=NVL(QTY,0)- NVL(:MN_MDV_DET.BAL_QTY,0)
           WHERE ITEM_NO=:MN_MDV_DET.ITEM_NO AND UOM=:MN_MDV_DET.UOM;
      END IF;
      I'm using forms 6i. Oracle 9i

      Regards

      Edited by: Moazam Shareef on Nov 14, 2012 10:11 AM