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 transaction control language (tcl)?
Define sql delete statement.
How do you bind variables in pl sql?
what is dbms? : Sql dba
What are the usages of sql?
What is dml with example?
What are the three pl sql block types?
How do I remove duplicates in two columns?
how to create a new table in mysql? : Sql dba
explain commit and rollback in mysql : sql dba
What has stored procedures in sql and how we can use it?
how to include character strings in sql statements? : Sql dba
What are the commands used in sql?
Does a user_objects view have an entry for a trigger?
How do I debug a stored procedure?