游标里怎么套游标啊,喜欢高手解答,谢谢
ALTER proc sbank_copy
(
@ym varchar(10)--应该是2007-03这样的格式
)
as
--二级银行ID
declare @tbankid varchar(10)
--三级银行ID
declare @sbankid varchar(10)
--业务类型ID
declare @roomtypeid varchar(10)
--费率
declare @ivalue numeric(3,2)
--读出二级银行的银行ID,业务类型,费率
declare xs1 cursor
for
select bankid,roomtypeid,ivalue from b_ivalue where iftwo= '0 '
open xs1
fetch next from xs1 into @tbankid,@roomtypeid,@ivalue
while @@fetch_status=0
begin
--读出二级银行ID
--再读出下面所有的3级银行
declare tt cursor
for
select sbankid from b_sbank where tbankid=@tbankid
open tt