Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:39:12+00:00 2026-05-31T22:39:12+00:00

I have 2 insert triggers, that fire on same table, they both try to

  • 0

I have 2 insert triggers, that fire on same table, they both try to alter table row content and then happens collision, or my sql developer starts endless execution of the commands, and then I need to restart DB. How to fix that? Should I merge those 2 triggers into 1 trigger? Or should try to control firing order with this command:

execute immediate 'alter trigger trigger_name disable';
execute immediate 'alter trigger trigger_name enable'; 

or should I use trigger inside of trigger.. please I want expert opinion about this one.. im in big dilema right now, since this is the first time I do PL/SQL coding.

EDIT: HERE ARE THE TRIGGERS WITH WHICH I WORK ON:

create or replace
TRIGGER TRG_PROCED_SN_INS_CENA
AFTER INSERT ON STAVKA_NARUDZBENICE
FOR EACH ROW
DECLARE
pragma autonomous_transaction;
sifra_narudzbenice NUMBER;
BEGIN
paket_sn_sifnar.sifra_narudzbenice := :NEW.sifra_narudzbenice;
pStavkaNarudzbeniceInsert(paket_sn_sifnar.sifra_narudzbenice); 
COMMIT;
END;
/

create or replace
TRIGGER TRG_SN_INS_UPD_NAZIV
AFTER INSERT ON Stavka_narudzbenice
FOR EACH ROW
FOLLOWS TRG_PROCED_SN_INS_CENA
DECLARE
v_naziv_proizvoda VARCHAR2(25);
v_cena NUMBER;
BEGIN  
SELECT naziv_proizvoda INTO v_naziv_proizvoda 
FROM proizvod 
WHERE sifra_proizvoda=:NEW.sifra_proizvoda;
SELECT cena INTO v_cena
FROM stavka_kataloga 
WHERE sifra_proizvoda=:NEW.sifra_proizvoda;
UPDATE stavka_narudzbenice
SET naziv_proizvoda = v_naziv_proizvoda, cena = v_cena WHERE sifra_proizvoda =:NEW.sifra_proizvoda;
END;
/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:39:13+00:00Added an answer on May 31, 2026 at 10:39 pm

    In 11G you can control the order of triggers using the FOLLOWS clause. For example:

    CREATE TRIGGER trg1
    AFTER INSERT ON EMP
    FOR EACH ROW
    BEGIN
    ...
    END;
    
    CREATE TRIGGER trg2 
    AFTER INSERT ON EMP
    FOR EACH ROW
    FOLLOWS trg1
    BEGIN
    ...
    END;
    

    i.e. There are 2 triggers trg1 and trg2 that both fire after insert on table EMP, and we have declared that trg2 should fire after (follow) trg1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single SQL Server table with 10 different triggers that fire on
I have a table that has an insert trigger on it. If I insert
MS SQL Server doesn't have row level triggers, correct? If I needed to insert
I have a trigger that is fire on inserting a new record in table
I have an INSERT trigger on a table that simply executes a job. Example:
Currently, I have bunch of triggers that do the same thing. This is copy-pasted
I have triggers that manipulate and insert a lot of data into a Change
I have two insert statements, almost exactly the same, which run in two different
I have an INSERT query that is pulling data from two tables and inserting
I have an insert query that gets generated like this INSERT INTO InvoiceDetail (LegacyId,InvoiceId,DetailTypeId,Fee,FeeTax,Investigatorid,SalespersonId,CreateDate,CreatedById,IsChargeBack,Expense,RepoAgentId,PayeeName,ExpensePaymentId,AdjustDetailId)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.