Answer Posted / purushottam
All the above suggested point is fine but addition on it is
when you are going to use the aggregate function for same
table then also be the mutating table error will occur.
example:
create table t(x numner);
/
create or replace trigger t_af_trigg
before insert into t
for each row
declare
n integer;
begin
select count(*) into n from t;
dbms_output.put_line('there are ' || n || ' rows in t');
end;
/
insert into t values(1);
error:
ORA-04091: table MISC.T is mutating, trigger/function may
not see it
ORA-06512: at "MISC.T_AF_TRIGG", line 5
ORA-04088: error during execution of trigger 'MISC.T_AF_TRIGG'
This example value addition of Vivek's suggession
"Mutating means that some one is trying to access the table
currently being held by some other non-committing
transaction(i.e. in Locked state)"
| Is This Answer Correct ? | 20 Yes | 9 No |
Post New Answer View All Answers
How do you concatenate in sql?
How do I start sql profiler?
What are types of indexes in sql?
How to revise and re-run the last sql command?
What is difference between table and view?
Mention what is the use of function "module procedure" in pl/sql?
How can we solve sql error: ora-00904: invalid identifier?
What is dbo in sql?
What's the difference between a primary key and a clustered index?
What is rename command in sql?
Is join an inner join?
What is where clause in sql?
What is constant in pl sql?
what is 'mysqlcheck'? : Sql dba
Describe different types of general function used in sql?