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 bulk compiling in pl/sql.?
What is the difference between row level and statement level trigger?
Inline the values in PL/SQL, what does it mean.?
What is dense_rank in sql?
explain the difference between myisam static and myisam dynamic. : Sql dba
What is the process of copying data from table a to table b?
What are the two types of periodical indexes?
What is sorting in sql?
What found sql?
Is a foreign key always unique?
How can you load microsoft excel data into oracle? : aql loader
Is sql a backend language?
What is user in sql?
define sql insert statement ? : Sql dba
What is an alias command?