正文

SQL数据库上机语言集合2006-10-16 15:12:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/sword2008/19376.html

分享到:

游标: use teaching godeclare student_cursor1 cursorfor select *    from student godeclare student_cursor2 cursor for select suo,sname from student where dept='324' order by snofor read onlygo 打开游标等操作: use teachinggodeclare student_cursor4 cursor for select ok,ko from sword where do='1' order by okfor read onlygo open student_cursor4use teachinggodeclare @ko varchar(7),@ok varchar(20)fetch next from student_cursor4into @ok,@ko while @@fetch_status=0begin print @ok+@kofetch next from student_cursor401into @ko,@okendclose student_cursor4deallocate student_cursor4 go        存储过程: CREATE PROCEDURE student_info  @ok varchar(20)AS select ok,ko,dofrom sword where ok=@okGO

阅读(3246) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册