zoukankan      html  css  js  c++  java
  • 游标的使用

    --建立处理游标     

     declare  sub_order_cur  cursor   for               

          select tbSub_Order.stock_no ,unit_price ,order_quantity ,unit ,order_remark ,stockreceive_remark ,order_amount          

            from tbSub_Order         

            inner join tbMaster on tbMaster.stock_no=tbSub_Order.stock_no         

            where location_id=@location_id and order_no =@order_no     and status not in (3,5,6)            

    open sub_order_cur           

     fetch next from  sub_order_cur into @stock_no,@unit_price ,@order_quantity,@unit,@order_remark,@stockreceive_remark ,@order_amount     

     while @@fetch_status=0      

       begin       

        insert into OPENDATASOURCE('SQLOLEDB','Data Source=10.200.253.25;User Id=SMSLinkuser;Password=SMS@link*2012%^&')         .AIS20120531133013.dbo.t_ZDF_SynPOOrderEntry  

                values (@FUUID ,@stock_no ,@unit_price,@order_quantity  ,@unit ,@order_remark ,@stockreceive_remark,@order_amount )   

    fetch next from  sub_order_cur into @stock_no,@unit_price ,@order_quantity,@unit,@order_remark,@stockreceive_remark ,@order_amount     

       end

         close sub_order_cur      

         deallocate sub_order_cur

  • 相关阅读:
    shell加密为二进制可执行文件
    lua自写限制并发访问模块
    centos虚拟机中挂新硬盘
    lua文件修改为二进制文件
    常用一些命令方法
    常用问题处理方法
    CVE-2010-3333
    Kernel Stack Overflow(转)
    NULL Pointer Dereference(转)
    Linux内核漏洞利用-环境配置(转)
  • 原文地址:https://www.cnblogs.com/withoutaword/p/2537665.html
Copyright © 2011-2022 走看看