zoukankan      html  css  js  c++  java
  • 0510

    DECLARE @fitemid int
    declare @fdcstockid int
    declare @fqty decimal(18,10)
    declare @fbatchno varchar(50)
    DECLARE #point_cursor CURSOR
    FOR
    select fitemid,FDCStockID,fqty,fbatchno from ICStockBillEntry where finterid = 18605
    OPEN #point_cursor
    FETCH NEXT FROM #point_cursor INTO @fitemid,@fdcstockid,@fqty,@fbatchno
    while @@fetch_status = 0
    BEGIN
    select fitemid,fstockid,fqty,fbatchno,* from ICInventory where FStockID=@fdcstockid and fbatchno=@fbatchno and fitemid=@fitemid
    update ICInventory set fqty=fqty+@fqty where FStockID=@fdcstockid and fbatchno=@fbatchno and fitemid=@fitemid
    select fitemid,fstockid,fqty,fbatchno,* from ICInventory where FStockID=@fdcstockid and fbatchno=@fbatchno and fitemid=@fitemid

    FETCH NEXT FROM #point_cursor INTO @fitemid,@fdcstockid,@fqty,@fbatchno
    END
    CLOSE #point_cursor
    DEALLOCATE #point_cursor

  • 相关阅读:
    JAVA 练习1
    JSP基础
    网络协议
    mysql基础
    python之高级
    powershell基础
    python之迭代器与遍历
    python之面向对象
    linux常用命令
    docker 安装 ElasticSearch:7.4.2
  • 原文地址:https://www.cnblogs.com/xujiating/p/6836661.html
Copyright © 2011-2022 走看看