Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is mutating table?

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


Please Help Members By Posting Answers For Below Questions

How do you concatenate in sql?

970


How do I start sql profiler?

937


What are types of indexes in sql?

1005


How to revise and re-run the last sql command?

1098


What is difference between table and view?

972


Mention what is the use of function "module procedure" in pl/sql?

1005


How can we solve sql error: ora-00904: invalid identifier?

1161


What is dbo in sql?

918


What's the difference between a primary key and a clustered index?

946


What is rename command in sql?

950


Is join an inner join?

893


What is where clause in sql?

979


What is constant in pl sql?

965


what is 'mysqlcheck'? : Sql dba

958


Describe different types of general function used in sql?

976