这是什么意思?
AS
BEGIN
--游标申明
declare @MyTestCursor Cursor
declare @KSH char(14)
declare @ZYDH char(2)
declare @YXDH char(4)
declare @JHCGS char(4)
----取出未录取满额专业的专业队列,及差额数
set @MyTestCursor=CURSOR for
(select yxdh,zydh,jhcgs from t_jhk where lqzt='0' )
open @MyTestCursor
fetch @MyTestCursor into @YXDH,@ZYDH,@JHCGS
while @@FETCH_STATUS=0
这个里面的这一句是什么意思?
((select yxdh,zydh,jhcgs from t_jhk where lqzt='0' ))
------解决方案--------------------declare MyTestCursor cursor for
select yxdh,zydh,jhcgs from t_jhk where lqzt='0'
....
跟上面是一个意思,声明游标
------解决方案--------------------就是把select yxdh,zydh,jhcgs from t_jhk where lqzt='0' 这个sql的结果集赋值给@MyTestCursor
------解决方案--------------------申明定义游标,动态sql语发,后面应该还有exec(@MyTestCursor)
------解决方案--------------------declare @MyTestCursor Cursor 是声明游标
set @MyTestCursor=CURSOR for
(select yxdh,zydh,jhcgs from t_jhk where lqzt='0' )是给声明的游标指派值