Cursor 1

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Cursor 1 as PDF for free.

More details

  • Words: 106
  • Pages: 1
create function getallempname() returns varchar(5000) begin declare sri cursor for ( select * from sep) for read only declare @ename1 varchar(5000) declare @ename2 varchar(100) open sri fetch next from sri into @ename2 select @ename1='' while @@fetch_status=0 begin select @ename1=@ename1+','+@ename2 fetch next from sri into @ename2 end return @ename1 end

alter

function getbccmail()

returns varchar(5000)

begin declare cur_mail cursor for ( select bu.business_email from business_users bu where bu.business_activity_status='activated' ) for read only declare @bccmai varchar(5000) declare @bccmail varchar(100) open cur_mail fetch next from cur_mail into @bccmail select @bccmai='' while @@fetch_status = 0 begin select @bccmai =@bccmai+ ','+ @bccmail fetch next from cur_mail into @bccmail end return(@bccmai) end

Related Documents

Cursor.
June 2020 16
Cursor 1
October 2019 24
Cursor
April 2020 15
Cursor Handling
November 2019 32
Cursor Examples.txt
November 2019 23
Db2 Cursor
November 2019 23