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

What are triggers and its uses?

1046


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

959


Mention what does the hierarchical profiler does?

1088


How to find 3rd highest salary of an employee from the employee table in sql?

1080


Can you selectively load only those records that you need? : aql loader

1048


What are different clauses used in sql?

1115


What is difference between sql and mysql?

1131


Explain the the update statement in sql?

1036


What is the best free sql database?

1051


What is difference between db2 and sql?

997


What is loop in pl sql?

1037


how to use myisamchk to check or repair myisam tables? : Sql dba

970


Why are sql stored procedures used?

1054


In a distributed database system, can we execute two queries simultaneously?

1090


How to prepare for oracle pl sql certification?

1064