游标使用之三

Posted 新作伟平

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了游标使用之三相关的知识,希望对你有一定的参考价值。

  declare myCur Cursor
  for(select RowGuid, Name from [LY_BIMPM_ModelData].[dbo].[BidSection_BaseInfor] where ProjectRowGuid = ‘61cebf00-bd9a-4f5f-b8e3-359583bfcd71‘)
  open myCur;
  declare @BidRowGuid varchar(50),@BidName varchar(50),@PGuid varchar(50)=‘61cebf00-bd9a-4f5f-b8e3-359583bfcd71‘,@ModelGuid varchar(50)=‘61f71964-10b2-4555-91cc-a9fe6fd38355‘
  declare @UserGuid varchar(50)=‘755D80DE-75DA-449F-8AF3-60F2600D12ED‘
  fetch next from myCur into @BidRowGuid,@BidName
  while(@@FETCH_STATUS=0)
  begin
     INSERT INTO [LY_BIMPM_Document].[dbo].[BidSectionShareDocumentCategory]
           ([RowGuid]
           ,[ModuleFunctionRowGuid]
           ,[ProjectRowGuid]
           ,[BidSectionRowGuid]
           ,[ParentRowGuid]
           ,[Title]
           ,[Description]
           ,[SortOrder]
           ,[CreateUserRowGuid]
           ,[CreationDate]
           ,[LastModificationDate])     
     SELECT NEWID(),@ModelGuid,@PGuid,@BidRowGuid,‘‘,[DesignSpecialityName],‘‘,0,@UserGuid,GETDATE(),GETDATE()
     FROM [LY_BIMPM_Draw].[dbo].[LocaleDraw]
     where BIMPM_ProjectInfoRowGuid = ‘61cebf00-bd9a-4f5f-b8e3-359583bfcd71‘ and SubProjectName like ‘%‘[email protected] +‘%‘
     group by SubProjectName,DesignSpecialityName

  fetch next from myCur into @BidRowGuid,@BidName
  end
  close myCur

  

以上是关于游标使用之三的主要内容,如果未能解决你的问题,请参考以下文章

Java代码工具箱之超出游标最大数

DeepID人脸识别算法之三代

日常Geetest滑动验证码(三代canvas版)处理小结(以B站登录验证为例)

Java代码工具箱之链接Oracle

mysql之游标

oracle基础之游标的理解与使用