freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

sqlserver存儲(chǔ)過(guò)程使用說(shuō)明書(shū)-資料下載頁(yè)

2025-05-13 22:11本頁(yè)面
  

【正文】 [for update [of列表名]]定義一個(gè)游標(biāo),使之對(duì)應(yīng)一個(gè)select語(yǔ)句 for update任選項(xiàng),表示該游標(biāo)可用于對(duì)當(dāng)前行的修改與刪除 open 打開(kāi)一個(gè)游標(biāo),執(zhí)行游標(biāo)對(duì)應(yīng)的查詢,結(jié)果集合為該游標(biāo)的活動(dòng)集 open 游標(biāo)名 fetch 在活動(dòng)集中將游標(biāo)移到特定的行,并取出該行數(shù)據(jù)放到相應(yīng)的變量中 fetch [next | prior | first | last | current | relative n | absolute m] 游標(biāo)名into [變量表] close 關(guān)閉游標(biāo),釋放活動(dòng)集及其所占資源。需要再使用該游標(biāo)時(shí),執(zhí)行open語(yǔ)句 close 游標(biāo)名 deallocate 刪除游標(biāo),以后不能再對(duì)該游標(biāo)執(zhí)行open語(yǔ)句 deallocate 游標(biāo)名 @@fetch_status 返回被fetch 語(yǔ)句執(zhí)行的最后游標(biāo)的狀態(tài). 0 fetch語(yǔ)句成功 1 fetch語(yǔ)句失敗 2 被提取的行不存在游標(biāo)實(shí)例 例:查詢電子商務(wù)系學(xué)生信息,性別為女輸出為female,否則輸出為male? declare c1 cursor for select sno,sname,ssex from student where sdept=39。ec39。 declare @sno char(10),@sname char(10),@ssex char(2) open c1 fetch c1 into @sno,@sname,@ssex while @@fetch_status==0 begin if @ssex=39。女39。 begin set @ssex=39。female39。 end else begin set @ssex=39。male39。 end select @sno,@sname ,@ssex fetch c1 into @sno,@sname,@ssex end例: alter proc [dbo].[dnt_userrecoverybyusername] @username nvarchar(50)asbegin declare @uid int。 declare @tid int。 declare @replies int。 declare @temp varchar(50)。 set @uid = (select top(1) uid from dnt_users where username = 39。@username39。)。 set @tid = 0。 set @replies = 0。 update dnt_users set accessmasks = 0 where uid = @uid。 update dnt_userforum set groupid = 5 where groupid = 4 and uid = @uid。 update dnt_posts set invisible = 0 where invisible = 1 and posterid = @uid。 定義一游標(biāo) declare ctemp cursor for select tid from dnt_topics where posterid = @uid for read only for update open ctemp fetch next from ctemp into @tid。 while (@@fetch_status = 0) begin set @replies = (select count(1) from dnt_posts where tid = @tid and layer 0)。 update dnt_topics set replies = @replies where posterid = @uid and tid = @tid。 fetch next from ctemp into @tid。 end close ctemp。 deallocate ctemp。end
點(diǎn)擊復(fù)制文檔內(nèi)容
范文總結(jié)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1