摘要:
beginSELECT a.location,a.flag into @loc,@flag FROM workdrawmst a where a.no=new.no;select count(*) into @c from locstock where loccode=@loc and stockid=new.stockid;if @c<1 theninsert into locstock (loccode,stockid,quantity) values (@loc,new.stockid,-@flag*new.qty);elseupdate locstock set quantity 阅读全文