存储过程中调用游标!
create procedure txmd_pbsjy
@ylgg char(20)
as
declare @pbbh char(20)
declare pbsjy cursor scroll
for select pbbh,ylgg from ymj.txmd_pbsjy where ylgg like '%'+@ylgg+'%'
open pbsjy
fetch next from pbsjy into @ylgg,@pbbh
while(@@fetch_status=0)
begin
print @pbbh+' '+@ylgg
fetch next from pbsjy into @ylgg,@pbbh
end
close pbsjy
deallocate pbsjy
很奇怪,例如 16*12/108*56*47
exec txmd_pbsjy ‘108*56*47’就有结果返回
exec txmd_pbsjy ‘16*12’ 就只显示命令被成功执行??