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...


which will fire first ? Trigger or Constraint

Answers were Sorted based on User's Feedback



which will fire first ? Trigger or Constraint..

Answer / pradeep

TRigger fires fist, it dose not matter is it befor or
after, please see the below trigger. Even i am not entering
not a valid DEPTNO, still trigger fires first and then
constraint error comes


CREATE OR REPLACE TRIGGER EMPTRIGGER after INSERT ON EMP
FOR EACH ROW
BEGIN
--- RAISE_APPLICATION_ERROR(-20201,'INVALID NUMBER');
dbms_output.put_line(
'in triggeerssssssssssssssssssssssssssssssssssssssssss');
END;
SQL> /

Trigger created.

SQL> INSERT INTO EMP(EMPNO,DEPTNO) VALUES(3333,50);
in triggeerssssssssssssssssssssssssssssssssssssssssss
INSERT INTO EMP(EMPNO,DEPTNO) VALUES(3333,50)
*
ERROR at line 1:
ORA-02291: integrity constraint (SCOTT.FK_DEPTNO) violated -
parent key not
found

Is This Answer Correct ?    0 Yes 2 No

which will fire first ? Trigger or Constraint..

Answer / dhananjay kumar singh

I am know trigger is fire firstly because trigger are
automatically fired and constraint are not fired
automatically.

Is This Answer Correct ?    0 Yes 2 No

which will fire first ? Trigger or Constraint..

Answer / dhanashree

Trigger will fire first because the trigger fires at the
table level and the constraint fires at column level

Is This Answer Correct ?    3 Yes 7 No

which will fire first ? Trigger or Constraint..

Answer / roopa

trigger fires first.

Is This Answer Correct ?    1 Yes 29 No

Post New Answer

More SQL PLSQL Interview Questions

What is a procedure in pl sql?

0 Answers  


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

0 Answers  


how to get a list of columns in an existing table? : Sql dba

0 Answers  


Can we create table inside stored procedure?

0 Answers  


what are the drivers in mysql? : Sql dba

0 Answers  


What are tuples in sql?

0 Answers  


What is structural independence and why is it important?

0 Answers  


What are triggers and its types?

0 Answers  


What is a trigger in pl/sql?

1 Answers  


what is myisam? : Sql dba

0 Answers  


what is pragma ?

1 Answers   Polaris,


What is the difference between nvl function, ifnull function, and isnull function?

0 Answers  


Categories