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

Answer Posted / vijay kumar s

Hi all,

leave th 9th answer ............

ignore 9 th answer....

see below one

create table T_CHK (a number check (A < 99))


CREATE TRIGGER CHKT BEFORE INSERT ON T_CHK
FOR EACH ROW
BEGIN
IF :NEW.A >100 THEN
RAISE_APPLICATION_ERROR(-20011,'VALUES SHOULD BE < 100');
END IF;
END;


SQL> INSERT INTO T_CHK VALUES(101);
INSERT INTO T_CHK VALUES(101)
*
ERROR at line 1:
ORA-20011: VALUES SHOULD BE < 100
ORA-06512: at "SVR.CHKT", line 3
ORA-04088: error during execution of trigger 'SVR.CHKT'




Trigger will fire Before insert trigger only
then constraints
then after insert trigger

Is This Answer Correct ?    12 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain commit and rollback in mysql : sql dba

1068


What is sql integrity?

1236


What are local and global Indexes and where they are useful.

1491


How do I turn a list into a table?

1007


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

1002


What is the difference between syntax error and runtime error?

1178


Difference between table function and pipelined function?

1078


Does sql*plus also have a pl/sql engine?

1130


Why is pl sql needed?

1000


How do you pronounce sql?

1057


What are sql data types?

1070


what is the difference between undefined value and null value? : Sql dba

1139


explain mysql aggregate functions. : Sql dba

1027


Explain how can you save or place your msg in a table?

1074


describe transaction-safe table types in mysql : sql dba

1051