![](/Images/OutliningIndicators/ContractedBlock.gif)
Code
Declare @result varchar(4000),@mxoid varchar(32),@sno int
create table #t
(
MxOID varchar(32),
repeatsno int,
RepeatContent varchar(4000)
)
Declare r_cursor Cursor for --声明游标
select Repeatcontent,repeatsno from repeat
Open r_cursor--打开游标
fetch next from r_cursor into @result,@sno
while @@FETCH_STATUS=0
Begin
set @mxoid=''
select @mxoid= mxoid
from payment
where mxoid like '%'+substring(@result,charindex('MXBILLNO',@result)+9,charindex('&mxdate',@result)-charindex('MXBILLNO',@result)-9)+'%'
set @result=substring(@result,0,charindex('MXBILLNO',@result)+9)+@mxoid+substring(@result,charindex('&mxdate',@result),len(@result))
update repeat set repeatcontent=@result where repeatsno=@sno
insert into #t (mxoid,repeatsno,repeatcontent) values (@mxoid,@sno,@result)
fetch next from r_cursor into @result,@sno
End
select * from #t
drop table #t
close r_cursor
deallocate r_cursor
正版序列号 1377-4868-2899-3328-2083-1968
posted @
2009-03-18 10:45
jinweida
阅读(
170)
评论()
编辑
收藏
举报