2000游标使用方法

来源:互联网 发布:淘宝网洗照片 编辑:程序博客网 时间:2024/05/22 13:15
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

游标使方法
usedb1
declaremy_cursorcursorscrolldynamic/*scroll表示可随意移动游标指针(否则只能向前),dynamic表示可以读写游标(否则游标只读)*/
for
select姓名from个人资料

openmy_cursor
declare@namesysname
fetchnextfrommy_cursorinto@name
while(@@fetch_status=0)
 begin
   print'姓名:'+@name
   fetchnextfrommy_cursorinto@name
 end
fetchfirstfrommy_cursorinto@name
print@name
/*update个人资料set姓名='zzg'wherecurrentofmy_cursor*/
/*deletefrom个人资料wherecurrentofmy_cursor*/
closemy_cursor
deallocatemy_cursor
正文 

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>