CREATE LANGUAGE plpgsql CREATE or REPLACE function getDatirenshu(w_wjID int) RETURNS INTEGER as ' DECLARE datiRenshu INTEGER; BEGIN select count(id) into datiRenshu from rfwenjuan_yuanshijieguo where wenjuanItem_id=w_wjID; return datiRenshu; end;' LA…
UPDATE:UPDATE A SET ApproverID=NULL FROM [SH_MaterialApplyBuyBill] A LEFT JOIN [SH_MaterialApplyBuyBillDetail] B ON A.ID=B.[MaterialApplyBuyBillID]WHERE A.id=125 AND @InDetailCount=0DELETE:DELETE A FROM [SH_ClosingBalance] A LEFT JOIN [SH_StoreHouse]…