求解一道题
将游标teacher_cursor中倒数第二行的教师姓名改为“张三”,职称改为“教授”。 --------------------编程问答-------------------- 结帖率:0.00% --------------------编程问答--------------------DECLARE @tid char(20), @tname char(20), @tpossion char(20)
OPEN teacher_cursor
FETCH LAST RELATIVE 2 from cursor_name into @tid,@tname,@tpossion
WHILE @@fetch_status = 0
BEGIN
--PRINT “ID:”+@tid+" _Name:"+@tname+" _Possion:"+@tpossion
select * from tbXXX where id=@tid
update tbXXX set tname="张三",tpossion="教授" where tid=@tid
select * from tbXXX where id=@tid
END
CLOSE teacher_cursor
DEALLOCATE teacher_cursor
不知道成不成了
--------------------编程问答-------------------- 每天回帖即可获得10分可用分!
补充:.NET技术 , .NET Framework