Oracle as Workaround of Mutating Tables

The Oracle mutating trigger error occurs when a trigger references the table that owns the trigger, resulting in the “ORA-04091: table name is mutating, trigger/function may not see it” message.

Let’s have a look at the existing workarounds.

The first one, through the package, is ancient and seems to be effective, however, it takes much time to prepare and run it. The second one is simple and performed using compound triggers.

 

 

 

 

 

 

 

Read More

Oracle Regular Expressions. Dangerous Range

An Oracle developer who often uses regular expressions in code sooner or later can face a phenomenon that is indeed mystical. Long-term searches for the root of the problem can lead to weight loss, appetite and provoke various kinds of psychosomatic disorders – all this can be prevented with the help of the regexp_replace function. It can have up to 6 arguments:

REGEXP_REPLACE (

  1. source_string,
  2. template,
  3. substituting_string,
  4. the start position of the match search with a template (default 1),
  5. a position of occurrence of the template in a source string (by default 0 equals all occurrences),
  6. modifier (so far it is a dark horse)

)

Read More