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 8489063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:43:15+00:00 2026-06-10T21:43:15+00:00

If i update ACK or ReJ column it should update all the other columns

  • 0

If i update ACK or ReJ column it should update all the other columns with the same GlobalID.

create table t_emp(
    empid varchar2(10) not null,
    empname varchar2(50),
    Dep varchar2(50),
    ACk number(5),
    REJ number(5),
    globalID varchar2(10) default '0'
);

insert into t_emp t values ( 'TM01' , 'Logu','Java',null,null,'01');
insert into t_emp t values ( 'BT01' , 'Logu','Java' ,null,null,'01');
insert into t_emp t values ( 'Oracle01' , 'Logu','DBA' ,null,null,'01');
insert into t_emp t values ( 'Google01' , 'Logu','Design' ,null,null,'0');
insert into t_emp t values ( 'AR02' , 'Uthaya','CRM' ,null,null,'02');
insert into t_emp t values ( 'RIL02' , 'Uthaya','Java' ,null,null,'02');
insert into t_emp t values ( 'EA02' , 'Uthaya','DBA' ,null,null,'02');
insert into t_emp t values ( 'TCS02' , 'Uthaya','Java' ,null,null,null);
insert into t_emp t values ( 'P05' , 'Krish','.Net' ,null,null,'05');
insert into t_emp t values ( 'TCS06' , 'Krish','.Net' ,null,null,'06');
insert into t_emp t values ( 'IBM06' , 'Krish','.Net' ,null,null,'06');

CREATE OR REPLACE TRIGGER t_emp_update
AFTER UPDATE
    ON t_emp
    FOR EACH ROW
DECLARE
    t_Ack varchar2(15);
    t_Rej varchar2(15);
    t_globalID varchar2(10);
    t_empid varchar2(10);
BEGIN
    t_globalID := :new.globalID;
    t_Ack := :new.ACk;
    t_Rej := :new.REJ;
    t_empid := :new.empid;
    IF t_Ack is not null then
        DBMS_OUTPUT.PUT_LINE('t_Ack := ' || t_Ack || ',  t_globalID := '|| t_globalID ||', t_empid := '||t_empid);
        update t_emp set ACk = t_Ack where globalID = t_globalID and empid != t_empid;
    end if;
    IF t_Rej is not null then
        DBMS_OUTPUT.PUT_LINE('t_REJ := ' || t_Rej || ',  t_globalID := '|| t_globalID ||', t_empid := '||t_empid);
        update t_emp set Rej = t_Rej where globalID = t_globalID and empid != t_empid;
    end if;
END;

update t_emp v set Rej = 1 where empid = 'TCS06';

If I Update empid = 'TCS06' it should Update Internally all rows with same globalID (06).

select * from t_emp order by empname,globalID;

I am getting some errors in this trigger.

ORA-04091: table TEST1.T_EMP is mutating, trigger/function may not see it
ORA-06512: at "TEST1.T_EMP_UPDATE", line 17
ORA-04088: error during execution of trigger 'TEST1.T_EMP_UPDATE'

Kindly Help me …

  • 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-06-10T21:43:17+00:00Added an answer on June 10, 2026 at 9:43 pm

    This link and this other one should be helpfull to understand the error and how to correct it. Also check sample of an AFTER UPDATE trigger.

    Check a similar question here at SO with a detailed answer.

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

Sidebar

Related Questions

Update: I reported this as a bug to Apple and they fixed it! All
I am creating a self-related table: Table Item columns: ItemId int - PK; Amount
UPDATE: Setting foreign_key_checks to 1 does not trigger a scan of the existing table
UPDATE: This question and its answers should no longer be recommended to anyone reading
I tried something like this: <p:commandButton type=push value=Ack disabled=false oncomplete=bean.method2() update=:form:alarmTable action=#{bean.method1()} But method2
Update: Is there a way to achieve what I'm trying to do in an
update: I mistyped 2 variables...so embarrassing. thanks everyone for the effort! sorry i find
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
Update : This is no longer an issue from C# 6, which has introduced
UPDATE UPI_ATTRIBUTE SET SITE_INC ='0' WHERE USER_PROFILING_NAME IN ('CAR_IMPLICIT','CAR_EXPLICIT') Above is my query that

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.