I need to keep two tables in a syc so when row inserted in Table A and one of column has certain condition then record should be added in table B. Also when row inserted in Table B then record should be added in Table A. How can this accomplish using Triggers. I had triggers for both tables After Insert but gives ORA-04091 error.
ORA-04091 Error Keep two tables in sync using triggers
153 Views Asked by mbk At
2
There are 2 best solutions below
Related Questions in ORACLE
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Oracle setting up on k8s cluster using helm charts enterprise edition
- Oracle Managed Data Access Client can't work from IIS but work for local debug environment
- If composite indexing created - indexing is called?
- Oracle Http server ISNT-07551
- why here not creating table?
- Data migration from Oracle Database Clob to GCP Bucket
- SQL Alchemy custom type, forcing blob bind parameter
- How to send message to syslog agent in plsql
- Whatever the data available in previous record it should add to the new record
- I have an Oracle SQL query that is giving me a "ORA-00918: column ambiguously defined" error on a line that is a comment line
- 'ORA-12170: TNS:Connect timeout occurredORA-12170: TNS:Connect timeout occurred' ERROR while working on oracle with laravel
- Is their any way i can open parallel query tabs
- VSCode Libraries not showing for New Java Project
- I can't ssh to my instance, Connection refused
Related Questions in TRIGGERS
- Delete trigger run for each deleted row when delete multi row on edit tab
- Have a script work multiple times with the same class
- Trigger when viewing a certain sheet in google apps script
- trouble to trigger Jenkins job
- Postgresql Auto Update Column
- PowerAutomate Flow not behaving as intended for SharePoint List Modifications; Issue may be Trigger formulas
- Safely using TRUNCATE with active AFTER INSERT triggers in PostgreSQL?
- While-loop in Python script not working when a record is added in MySQL table from triggers
- Installable Trigger not being installed in published Google Forms Editor Add-On
- Error: pq: at or near "update_assignee_columns_trigger": syntax error: unimplemented: this syntax
- Why does the trigger execution log for a sendEmail function of my google script project says it's completed, and yet no actual emails are being sent?
- SQL Server trigger is blocking data to the table
- Logic app blob trigger retry policy not working for 503 error
- Data Factory triggers two releases on Azure DevOps after Pull Request
- Trying to run a procedure inside After insert trigger , even though procedure run for 10 mins last row updated time is same as 1st row
Related Questions in ORA-04091
- ORA-04091 on Create or Replace Trigger xxx Before Insert of Update on xxx
- ORA-04091 table is Mutating
- "ORA-04091 - Table "b" is mutating, trigger/function may not see it" when updating table "a" based on inserts, updates, and deletes from table "b"
- ORA-04091 tableT is mutating, trigger/function may not see it
- ORACLE TRIGGER WITH JOIN
- Oracle Trigger error - ORA-04091: table is mutating, trigger/function may not see it
- problem with trigger in oracle
- Simple oracle triggers
- Oracle After Delete Trigger... How to avoid Mutating Table (ORA-04091)?
- Oracle calculate average using a trigger
- Translation of DB2 Trigger to Oracle triggers ORA-04091 Error
- BEFORE TRIGGER causes ORA-04091
- Delete rows matching substring with LIKE?
- Automatically Update Field in Database
- How to use data from the updated table in a trigger?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Table is mutating, which means that you are selecting from it at the same time it is being affected by insert (or update). Since 11g, a compound trigger is the way out of it. In earlier Oracle versions (10g and lower) package has been used to deal with it.
However, mutating table frequently raises a question: are you doing it correctly? Maybe code you use can be rewritten so that error is avoided.
Finally, if those two tables contain the same data, why do you have two tables instead of one?