which will fire first ? Trigger or Constraint
Answer Posted / vijay kumar s
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(100);
INSERT INTO T_CHK VALUES(100)
*
ERROR at line 1:
ORA-02290: check constraint (SVR.SYS_C00301152) violated
ABOVE ONE CLEARLY TELLS
contraints will fire first.
Is This Answer Correct ? | 14 Yes | 7 No |
Post New Answer View All Answers
What is mutating trigger?
What is the difference between union and union all command?
what are properties of a transaction? : Sql dba
Is pl sql a scripting language?
What is a data manipulation language?
what is isam? : Sql dba
What is vector point function?
Does db2 use sql?
What does where 1 1 mean in sql?
What is varchar sql?
How many types of primary keys are there?
What are sql commands?
what are the types of join and explain each? : Sql dba
How exception handling is done in advance pl/sql?
What is the command used to fetch first 5 characters of the string?