//==============================
//单条记录锁定
//==============================
create or replace procedure scott.getdh(newdh out number)
as
no number;
begin
--select加锁
select serial into no from h_table where id=10 for update; ---//对表单条记录上锁
--号表更新
update h_table set serial = serial + 1;
commit; --//提交事务,解除表单条记录锁
newdh:=no;
end;
---//调用
declare dh int;
begin
scott.getdh(dh);
end;