Oracle Forms - 锁定过程属性
我有一个 oracle 表单,其中数据块的锁定过程属性设置为调用过程“lock_fn”。 过程“lock_fn”如下所示:
procedure lock_fn(outp IN OUT out_tab) IS
l_first BINARY_INTEGER := outp.first;
l_last BINARY_INTEGER := outp.last;
l_id a.id%type;
BEGIN
for i in l_first .. l_last loop
select id
into l_id
from a
where a.id=outp(i).id;
end loop;
END lock_fnl;
我的问题是,仅选择 ids 就能保证行级锁定吗?任何帮助将是非常受欢迎的。
编辑: 数据块的 LOCK-PROCEDURE 触发器自动生成代码,如下所示:
DECLARE
bk_data FRMPKG.OUT_TAB;
BEGIN
PLSQL_TABLE.POPULATE_TABLE(bk_data, 'LOCK_FN', PLSQL_TABLE.LOCK_RECORDS);
FRMPKG.LOCK_FN(bk_data);
END;
I have an oracle form, where the lock procedure property of a data block is set to call a procedure 'lock_fn'.
The procedure 'lock_fn' looks like below:
procedure lock_fn(outp IN OUT out_tab) IS
l_first BINARY_INTEGER := outp.first;
l_last BINARY_INTEGER := outp.last;
l_id a.id%type;
BEGIN
for i in l_first .. l_last loop
select id
into l_id
from a
where a.id=outp(i).id;
end loop;
END lock_fnl;
My question is, Would merely selecting the ids guarantee a row level lock?. Any help would be most welcome.
Edit:
The LOCK-PROCEDURE trigger of the data block has the code auto-generated that looks like below:
DECLARE
bk_data FRMPKG.OUT_TAB;
BEGIN
PLSQL_TABLE.POPULATE_TABLE(bk_data, 'LOCK_FN', PLSQL_TABLE.LOCK_RECORDS);
FRMPKG.LOCK_FN(bk_data);
END;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您需要一个 SELECT FOR UPDATE(但是只选择一个列就足够了)。
No. You'd need a SELECT FOR UPDATE (But then selecting just a single column would be sufficient).