[英]How to call no argument stored procedure inside Trigger
I am trying to call stored procedure from trigger 我正在尝试从触发器调用存储过程
create or replace trigger trg_insert
after insert on dbuser_m1
for each row
begin
InsertData;
end;
but getting below erro 但低于错误
ORA-04088: error during execution of trigger 'OWS_GO_UAT_02.TRG_INSERT' 04091. 00000 - "table %s.%s is mutating, trigger/function may not see it" *Cause: A trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it.
ORA-04088:执行触发器'OWS_GO_UAT_02.TRG_INSERT'04091时出错。00000-“表%s。%s正在变异,触发器/函数可能看不到它” *原因:触发器(或用户定义的plsql函数在此语句中引用的语句)试图查看(或修改)一个表,该表正被触发它的语句修改。 *Action: Rewrite the trigger (or function) so it does not read that table.
*操作:重写触发器(或函数),使其不读取该表。
Anyone can help me on this please?Thanks, 有人可以帮我吗?谢谢,
Besides what @KaushikNayak told, it seems you have a select
from table dbuser_m1
while it's being processed by a DML( insert
in this case). 除了@KaushikNayak告诉的内容外,似乎您正在从表
dbuser_m1
进行select
,而该表正在由DML处理(在这种情况下为insert
)。
We don't know your code inside InsertData
, 我们不知道您在
InsertData
的代码,
but i guess , 但是我想
instead of using such a statement select col1, col2 into v_col1, v_col2 from dbuser_m1;
而不是使用这样的语句
select col1, col2 into v_col1, v_col2 from dbuser_m1;
, ,
you can apply some assignments with some arguments with column values of dbuser_m1
to your procedure like InsertData(:old.col1,:old.col2)
while calling, and inside called procedure there maybe assignments : 您可以在调用时将带有
dbuser_m1
列值的参数的某些赋值应用于过程,例如InsertData(:old.col1,:old.col2)
,在被调用过程中可能存在赋值:
v_col1 := :old.col1; v_col2 := :old.col2;
where v_col1
is of type dbuser_m1.col1%type
and v_col2
is of type dbuser_m1.col2%type
. 其中
v_col1
的类型为dbuser_m1.col1%type
而v_col2
的类型为dbuser_m1.col2%type
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.