【发布时间】:2016-08-03 01:57:57
【问题描述】:
我正在使用具有确定性用户定义函数的虚拟列(oracle 11g),该函数将行的主键作为参数并返回一个简单的标量值。虚拟列更新没有任何问题,但是当我更新表时,它会抛出错误:- ora-00054 资源繁忙并在指定 nowait 的情况下获取或在 oracle 中超时。我的表结构和功能如下:-
-----------------------------------------------------------------------
id employee_name employee_dept employee_leaves (vir column)
-----------------------------------------------------------------------
2 patrick mgmt getEmpLeaves(id)
3 jack sales "
-----------------------------------------------------------------------
create or replace function getEmpLeaves(empId number)
return number
DETERMINISTIC
is
emp_leaves number;
begin
select leaves into emp_leaves from tbl_emp_leaves
where tbl_emp_leaves.id = empId;
return emp_leaves;
end ;
-------------------------------------------------------------
如何克服这个错误?
【问题讨论】:
-
您能否显示两个表的表创建语句,以及您为获得该异常而发出的语句?说出您所在的版本(版本 1 或版本 2)和补丁级别可能会有所帮助。我无法立即在 11.2.0.4.7 中复制,但我正在做一些假设。是否也涉及索引?
标签: oracle oracle11g calculated-columns virtual-column