Oracle PL SQL interview question | How to Solve Mutating Trigger Using Compound trigger

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 62

  • @Gocpp
    @Gocpp 2 ปีที่แล้ว +1

    The best teacher ever. Your explanation is awesome thank you sir

    • @SivaAcademy
      @SivaAcademy  2 ปีที่แล้ว

      Not sure whether I deserve this comment, however thank you so much 🙏🙏💐💐

  • @markippo
    @markippo ปีที่แล้ว +1

    Or by making the trigger autonomous... But it has some consequences - 1) rollback of the main transaction (in this scenario insert into emp_t) will not apply on changes committed in the trigger body 2) Deadlock may occur (won't happen in this case) if trigger transaction tries to apply some changes on the records blocked by the triggering transaction.

  • @adeelpaki
    @adeelpaki 2 ปีที่แล้ว

    you are a very good teacher Salam Teacher you had a new student that respect you like a teacher.

    • @SivaAcademy
      @SivaAcademy  2 ปีที่แล้ว

      My pleasure bro, thank you 🙏🙏🙏💐💐

  • @MrKhalidhamid07
    @MrKhalidhamid07 ปีที่แล้ว

    So nice May you live log with good health with ur family

    • @SivaAcademy
      @SivaAcademy  ปีที่แล้ว

      Thank you 🙏🙏🙏

  • @computerlearningbyargusaca5217
    @computerlearningbyargusaca5217 4 ปีที่แล้ว +1

    🙏🙏Exactly what I was searching for . 👍👍. extremely helpful 😍😍

  • @mukeshims09
    @mukeshims09 3 ปีที่แล้ว

    Very good explanation of mutating trigger error.. thanks for sharing the video.

    • @SivaAcademy
      @SivaAcademy  3 ปีที่แล้ว

      My pleasure, welcome

  • @swamivivekananda-cyclonicm8781
    @swamivivekananda-cyclonicm8781 2 ปีที่แล้ว

    🙏🏼🙏🏼 True blessing and learning.

    • @SivaAcademy
      @SivaAcademy  2 ปีที่แล้ว

      🙏🙏🙏Thank you

  • @karthikeyankarthik4752
    @karthikeyankarthik4752 4 ปีที่แล้ว

    NICE ji.Thanks for your help to understand the mutating error and compund trigger

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว +1

      Welcome 🙏 karthik

  • @yogiacooldude
    @yogiacooldude 4 ปีที่แล้ว

    thank you very much sir, for all the videos.
    by putting pragma autonomous transaction in our row level trigger, we can avoid mutating error also.

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Welcome bro

    • @pappu2405
      @pappu2405 4 ปีที่แล้ว

      Do not fall into the trap of believing that autonomous transactions have removed
      mutating triggers as an issue!

    • @sdonram
      @sdonram 2 ปีที่แล้ว

      If u do so it would break the data integrity

  • @rtrkings1173
    @rtrkings1173 4 ปีที่แล้ว

    nice value explanation its very help thank u shiva

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Welcome 🙏🙏🙏

  • @shashank2004
    @shashank2004 4 ปีที่แล้ว

    Awsome explanation bro..very helpful...Pls make a video on advanced topics like pipeline and deterministic function, nocopy hint, pragma serially reusable, pragma restrict reference, partition, explain plan and performance tuning

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Sure, Pragma serially reusable i have already posted, rest of the topics i will add itto upcoming lists. You can watch the serially reusable video here
      th-cam.com/video/LwW0k7AN4Bk/w-d-xo.html

  • @techgrenade4016
    @techgrenade4016 2 ปีที่แล้ว

    Sir ,When u updating 150000 the log inserted as failure but it inserted in the emp table

  • @computerlearningbyargusaca5217
    @computerlearningbyargusaca5217 4 ปีที่แล้ว

    🙏🙏Well very good and 👍👍practical 😍😍approach . nice video

  • @amitkumar-ev8im
    @amitkumar-ev8im 4 ปีที่แล้ว

    Very useful video,Thanks Lot

  • @sairamsubramaniam8316
    @sairamsubramaniam8316 3 ปีที่แล้ว

    instead of using a package variable can we use a binding variable? is that possible?

  • @chandrababubollu4508
    @chandrababubollu4508 4 ปีที่แล้ว

    Very useful,thanks for sharing!

  • @devanaidu9406
    @devanaidu9406 4 ปีที่แล้ว

    Hi sir thank you for sharing valueble content frequently,please keep sharing its very helpful us thank you somuch sir,please make some performance tuning concepts step by step asap,and what is parse and dense in collections?

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว +1

      Sure, Please stay tuned for more videos,
      dense collection will have all the datas continuously in the nested table., incase any element is deleted in between then its sparse.

    • @devanaidu9406
      @devanaidu9406 4 ปีที่แล้ว

      @@SivaAcademy thank you sir..i am writing for next video sir,pls make performance tuning videos asap sir..now a days interviewers aking that frequently..how to analyse,identify the query,check the cause like that..how to reduce cost of the query and make a video debugging concept

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Sure, please stay tuned for performing tuning videos

  • @dineshkumar-vp9dm
    @dineshkumar-vp9dm 4 ปีที่แล้ว

    What is different between forall and for clause plsql
    What is different between forall and bulk bind

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      for is used to iterate one by one value
      forall is used as part of bulkbinding to load all the values from collection into table in single context switch.
      For more details, please look into this video
      th-cam.com/video/qH47MCoWoNU/w-d-xo.html

  • @richierich2357
    @richierich2357 3 ปีที่แล้ว

    Hi! I have a table named empp and columns (id, name, salary, old_salary, new_salary). I created a trigger in such a way that if I update the salary, :old.salary, :new.salary gets inserted into the same table in the columns old_salary, new_salary. But I get mutating trigger error. can you please help me to solve it? below is my program,
    create or replace trigger sal
    before delete or insert or update on empp
    for each row

    begin
    insert into empp(old_salary, new_salary) values(:old.salary, :new.salary);
    end;
    /

    begin
    update empp
    set salary = salary + 1000;
    end;
    /
    and I get this error
    ORA-04091: table HR.EMPP is mutating, trigger/function may not see it
    ORA-06512: at "HR.SAL", line 3
    ORA-04088: error during execution of trigger 'HR.SAL'

  • @Luismrv315
    @Luismrv315 4 ปีที่แล้ว

    thank you very much!!!!!!!

  • @satvinderbhangu361
    @satvinderbhangu361 4 ปีที่แล้ว

    Could tell me please why we use pragma autonomous transaction . And where we use in plsql . Please

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      sure, will post a separate video on autonomous transaction

    • @satvinderbhangu361
      @satvinderbhangu361 4 ปีที่แล้ว

      Siva Academy thanks

  • @SriLife2
    @SriLife2 4 ปีที่แล้ว

    How to commit that log record intrigger

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      use autonomous transaction

  • @manoharanmalathi3041
    @manoharanmalathi3041 4 ปีที่แล้ว

    Hi sir,
    Can you please explain reguexp related topic plz

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Sure, please stay tuned.

  • @faqihuddinsiddique7287
    @faqihuddinsiddique7287 4 ปีที่แล้ว

    Have giving trainings also

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Yes, please drop mail to siva.k.academy@gmail.com

    • @SriLife2
      @SriLife2 4 ปีที่แล้ว

      medarametlasrikanth2@gmail.com

    • @faqihuddinsiddique7287
      @faqihuddinsiddique7287 4 ปีที่แล้ว

      @@SivaAcademy thanks sir

  • @dineshkumar-vp9dm
    @dineshkumar-vp9dm 4 ปีที่แล้ว

    Pls send for and forall clause in plsql

  • @madakasai7152
    @madakasai7152 10 หลายเดือนก่อน

    Sir , BY using PRAGMA AUTONOMOUS_TRANSACTION + TCL Command we can resolve mutating error.
    CREATE OR REPLACE TRIGGER TRG_MUTATION
    BEFORE UPDATE OF SAL ON EMP
    FOR EACH ROW
    DECLARE
    LV_MAX_SAL NUMBER;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    SELECT MAX(SAL) INTO LV_MAX_SAL FROM EMP;
    IF :NEW.SAL

  • @dineshkumar-vp9dm
    @dineshkumar-vp9dm 4 ปีที่แล้ว

    Pls send answer s

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Detailed answer i will post in separate video, however this video will answer most of your doubts
      th-cam.com/video/qH47MCoWoNU/w-d-xo.html

  • @shubhamtathe943
    @shubhamtathe943 3 ปีที่แล้ว

    Very useful video,Thanks Lot