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
Write a sql query to find the names of employees that begin with ‘a’?
How to change sql*plus system settings?
Are stored procedures faster than dynamic sql?
What is the difference among union, minus and intersect?
Are stored procedures compiled?
describe mysql connection using mysql binary. : Sql dba
Explain the difference between cursor declared in procedures and cursors declared in the package specification?
What is the use of non clustered index?
what is table? : Sql dba
What are local and global Indexes and where they are useful.
Explain unique key in sql.
How do I remove sql plus from windows 10?
What is input buffer in sql*plus?
Does view store data in sql?
Why function is used in sql?