Oracle pl sql trigger updating

DEPTNO; 11 EXCEPTION 12 WHEN NO_DATA_FOUND THEN 13 INSERT INTO DEPT_TEST VALUES (Dept_Sequence. Department) 14 RETURNING DEPTNO INTO V_ID; 15 END; 16 INSERT INTO EMP_TEST (ID, NAME, DEPTNO) VALUES (Emp_Sequence. NAME, V_ID); 17 END Updte Emp Dept; 18 / Trigger created.

SELECT * FROM EMP_DEPT_INFO; DEPTNO DEPARTMENT NAME ---------- -------------------- ---------- 70 Communication Akhil 20 Insurance Ankit 10 ENU Nikhil 20 Insurance Rajan 20 Insurance Karan 10 ENU Sajal 30 Security Ravi 30 Security Surya 20 Insurance Sam 10 ENU Jack 10 rows selected.

When the table 'xyz' is updated, trigger B fires and will insert a row in table 'abc'.

This cyclic situation continues and will enter into a infinite loop, which will crash the database.

4)If you ROLLBACK the transaction before committing to the database, the data inserted to the table is also rolled back.

1) Create the 'product' table and 'product_price_history' table Once the above update query is executed, the trigger fires and updates the 'product_price_history' table.DEPTNO; EXCEPTION WHEN NO_DATA_FOUND THEN INSERT INTO DEPT_TEST VALUES (Dept_Sequence. Department) RETURNING DEPTNO INTO V_ID; END; INSERT INTO EMP_TEST (ID, NAME, DEPTNO) VALUES (Emp_Sequence. NAME, V_ID); END Updte Emp Dept; CREATE OR REPLACE TRIGGER Updte Emp Dept 2 INSTEAD OF INSERT ON EMP_DEPT_INFO 3 DECLARE 4 V_ID 5 DEPT_TEST.DEPTNO%TYPE; 6 BEGIN 7 BEGIN 8 SELECT DEPTNO INTO V_ID 9 FROM DEPT_TEST WHERE DEPTNO= 10 :new.This events will alternates between BEFORE and AFTER row level triggers.4) Finally the AFTER statement level trigger fires.

Search for oracle pl sql trigger updating:

oracle pl sql trigger updating-29

CREATE SEQUENCE EMP_SEQUENCE MINVALUE 101 MAXVALUE 1000 START WITH 101 INCREMENT BY 1 CACHE 20; CREATE SEQUENCE DEPT_SEQUENCE MINVALUE 10 MAXVALUE 500 START WITH 10 INCREMENT BY 10 CACHE 20; CREATE OR REPLACE TRIGGER Updte Emp Dept INSTEAD OF INSERT ON EMP_DEPT_INFO DECLARE V_ID DEPT_TEST.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “oracle pl sql trigger updating”

  1. Find the top online dating sites that offer free personals and online personal ads for singles seeking love, sex, and romance on the web Fuck Buddy Sexy Women from USA Adult Dating Are you looking for an Adult Swinger Party? They are the largest dating site on the web catering to adults interested in sexual encounters.