請問在sybase中,holdlock命令的優缺點及使用時機. |
尚未結案
|
jwj
一般會員 發表:2 回覆:1 積分:0 註冊:2003-05-31 發送簡訊給我 |
|
Mickey
版主 發表:77 回覆:1882 積分:1390 註冊:2002-12-11 發送簡訊給我 |
holdlock applies a read-lock on the data until the transaction ends. holdlock -makes a shared lock on a specified table or view more restrictive by holding it until the completion of a transaction (instead of releasing the shared lock as soon as the required data page is no longer needed, whether or not the transaction has been completed). 使用時機 : 如計算庫存總量時, 限制計算當時之入/出庫資料交易. Example Transcat-SQL : begin declare @total_QTY float begin tran select @total_QTY=sum(QTY) from Inventory holdlock ... commit tran end |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |