4 Replies Latest reply: Feb 12, 2014 11:12 AM by AndyH RSS

    ORA-01400: cannot insert NULL into ("BBB"."INV_01_07"."BAS_COD")

    Gulzar6155

        declare  

         itm number;

         begin

          SELECT count(itm_cod) into itm FROM smlbhone.inv_01_07  WHERE itm_cod=:itm_cod;

      if itm >= 1 then

          update smlbhone.inv_01_07 set prv_qty = :prv_qty where  itm_cod=:itm_cod;

         else

            insert into smlbhone.inv_01_07 (BAS_COD,ITM_COD,BCH_NO,EXP_DTE,ALC_FLG,BCH_STA,ITM_QO1,ITM_QO2,ITM_QO3,ITM_VAL,ITM_RAT,

                                              CST_PRC,SAL_PRC,BOK_NUM,BOK_BAS,ALC_QTY,PRV_QTY,PRV_ISS,PRV_ALC)

                                      values(300,:itm_cod,2003,null,0,0,0,0,0,0,0,0,0,0,0,0,:prv_qty,0,0);

      end if;

       

         end;