1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

ORA-0001 unique constraint schema.XXXX violated ORA-06512 at SYS_TRIGGER

Discussion in 'SQL PL/SQL' started by dimpleboy, Jun 15, 2011.

  1. dimpleboy

    dimpleboy Active Member

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Makati, Philippines
    Hi, I have this scenarion. I created table1 with id, prod_id and lang_id field, (id is the primary key). then I created table2 with field id and date. (again id is primary key). I created a trigger which will populate table2 upon insert on table1. May method on insert for table1 is via script, the id will be populated by the output of a sequence i created then the prod_id and lang_id field is lets say data from other table. Upon execution of the insert script I always encounter this error.

    ORA-0001 unique constraint schema.XXXX violated
    ORA-06512 at SYS_TRIGGER
    ORA-04088 error during execution of trigger SYS_TRIGGER

    pls help me with this problem thanks!

    here are my trigger script and insert script:



    THANK YOU! you help is really appreciated.
     

    Attached Files:

  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Re: Trigger issue

    Code (SQL):
    CREATE TRIGGER test_trigger
    after INSERT ON table1
    FOR each ROW
    BEGIN
    INSERT INTO table2 (id, DATE) VALUES (:NEW.id, sysdate);
    END;
    /
     
  3. dimpleboy

    dimpleboy Active Member

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Makati, Philippines
    Re: Trigger issue

    Thank you so much for the reply it fixed the problem! thanks!