Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle trigger inserting duplicate records

DBA112Aug 19 2019 — edited Aug 20 2019

Dear SQL Experts,

Oracle DB version - 11.2.0.4

I have a trigger that's inserting multiple records per update.

Can you please help me understand why a single update in the base table is causing the trigger fired more than once? It looks like trigger is getting fired 20-30 times per update.

CREATE OR REPLACE

TRIGGER FNM.DFLT_TRIGGER

AFTER INSERT OR UPDATE

OF UPD_DTTM

ON FNM.BIN_DFLT_TAB

FOR EACH ROW

BEGIN

-- Insert new values

INSERT INTO FNM.SHIPPING_INFO (SHIPMENT_ID, DESTINATION, PROCESS_DTTM, CREATE_DTTM, CREATE_USER, UPDATE_DTTM, UPDATE_USER) VALUES

( :NEW.LD_ID,'RATEUPD', sysdate, :NEW.CRE_DTTM, :NEW.CRE_USR_ID, :NEW.UPD_DTTM, :NEW.UPD_USR_ID);

END;

Comments
Post Details
Added on Aug 19 2019
5 comments
2,018 views