我写了一个存储过程,但是有一行有问题,
不知大家能理解我的意思不
[code="java"]
create procedure addIdeaData
as
declare @taskId varchar(50)
declare @acceptid varchar(50)
declare @max int
declare @cx int
set @cx=1
declare my_cursor cursor scroll
for
select taskid,acceptid
from tk_task
select count(*) into @max/////////////////////////////这一行有问题.........
from tk_task
where islasttask=1
open my_cursor
while @cx<@max
begin
fetch from my_cursor into @taskId,@acceptid
insert into evoa_idea(taskid,acceptid) values (@taskId,@acceptid)
set @cx=@cx+1
end
close my_cursor
deallocate my_cursor
[/code]