create or replace procedure pro_cursor_delete
(
inpit_taid number
)
as
v_taid number;
cursor c_delete is select taid from table3 where taid=inpit_taid
for update of taid; --鎖定taid列的單行值,防止所有的數(shù)據(jù)被刪除了
begin
open c_delete;
loop
fetch c_delete into v_taid;
exit when c_delete%notfound;
delete table3 where taid=inpit_taid;
end loop;
commit;
dbms_output.put_line('taid=:' ||inpit_taid);
close c_delete;
end pro_cursor_delete;
本文出自:億恩科技【www.artduck.net】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|