Oracle PL/SQL: Table is mutating ERROR

You have TABLE_A which has a trigger AFTER SOMETHING which actually does something, in the body of the trigger or through calling a PL/SQL function. Anyways, the PL/SQL code in some way interacts with TABLE_A, the same one which triggers the trigger. When you test the trigger by INSERTING/UPDATING/DELETING a record, you get the next error:

Which causes this?

The problem is the next: TABLE_A is mutating, as error message indicates it. trigger AFTER INSERT on TABLE_A. The problem is, that you can’t have a trigger, nor BEFORE neither AFTER, which queries or does something with the table which has the trigger associate. The table is still mutating even if the trigger triggers AFTER doing something, and that’s why you get that error.

I discovered this in a bad way. I had a trigger like this for my TABLE_A:

At the end, i had to move my code to a procedure and create an autonomous transaction:

Those sites helped me to find and understand the issue:

https://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936

https://community.oracle.com/thread/2511087