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 to create a duplicate record in the table

user8564931Jan 31 2019 — edited Feb 1 2019

Hello,

I am inserting a data into the table through SQL LOADER , during insertion time i have a requirement to insert a duplicate record on the sametable.

I have written the below trigger but its failing with the below error.  Please advise.

CREATE OR REPLACE TRIGGER DUP_DATA

    AFTER INSERT

    ON XX_USER_DATA

    FOR EACH ROW

BEGIN  

    INSERT INTO XX_USER_DATA

    (

VNAME

,v_site

    )  

    VALUES  

    (:NEW.V_NAME,:NEW.v_site);

END;

ERROR

ORA-04091: table XX_USER_DATA is mutating, trigger/function may not see it

ORA-06512: at "APPS.DUP_DATA", line 3

ORA-04088: error during execution of trigger 'APPS.DUP_DATA'

This post has been answered by Hans Steijntjes on Feb 1 2019
Jump to Answer
Comments
Post Details
Added on Jan 31 2019
34 comments
3,421 views