存储过程问题(急!马上给分)
create procedure pc_updateMagaType
@iBigClassID_Old int,
@iClassID_Old int,
@iSubClassID_Old int,
@iBigClassID_New int,
@iClassID_New int,
@iSubClassID_New int
as
declare magaID int
--将杂志数据放入游标
if @iClassID_Old=0
begin
--当类别为空时
DECLARE magack_info CURSOR for select * from magack_tbl where maga_id = @iBigClassID_Old
end
else
begin
if @iSubClassID_Old = 0
begin
DECLARE magack_info CURSOR for select * from magack_tbl where magackid in (select DISTINCT magackid from graph_tbl where magaid= @iClassID_Old)
end
else
begin
DECLARE magack_info CURSOR for select magafiles,magafilepath from magack_tbl where magackid in (select DISTINCT magackid from graph_tbl where magaid= @iClassID_Old and subClass = @iSubClassID_Old)
end
end
可以这么定义吗?
为什么我定义declare magaID int他提示错误:int不可识别的游标选项
以上语句还有什么错误???