which will fire first ? Trigger or Constraint
Answer Posted / radha sri seshu.kolla
NOW I AM 100% SURE THAT TRIGGER WILL FIRE FIRST.
TRY THIS CODE YOU WILL UNDERSTAND
------------------------------------------------------------
CREATE OR REPLACE TRIGGER EMPTRIGGER BEFORE INSERT ON EMP
FOR EACH ROW
BEGIN
FOR I IN (SELECT EMPNO FROM EMP)
LOOP
IF I.EMPNO=:NEW.EMPNO THEN
RAISE_APPLICATION_ERROR(-20201,'INVALID NUMBER');
END IF;
END LOOP;
END;
/
INSERT INTO EMP(EMPNO,DEPTNO) VALUES(7788,10)
---------------------------------------------------------
FEEL FREE TO TALK WITH ME ON 9966409914. IF NOT RINGING
THEN TRY 9966112520
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is the difference between sql and isql*plus?
how to get a list of columns in an existing table? : Sql dba
What is sql and explain its components?
What are the different operators available in sql?
Is ms sql traffic encrypted?
How do you use a while loop in pl sql?
What is sql rowcount?
how to escape special characters in sql statements? : Sql dba
Can we perform dml on view?
Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?
what is sql in mysql? : Sql dba
How much does sqlite cost?
how does a local variable is defined using t-sql? : Transact sql
What is sql*loader and what is it used for? : aql loader
What is the purpose of primary key?