Maximum Recursive SQL Levels Exceeded
Meaning Oracle has hit the hard limit of 255 recursive SQL call levels, preventing any further nesting of SQL or PL/SQL calls.
Possible causes Mutually recursive PL/SQL procedures calling each other indefinitely; a trigger on a table firing another trigger on the same or related table in a circular chain; recursive view definitions without a proper termination condition.
Troubleshooting Trace the call chain with DBMS_UTILITY.FORMAT_CALL_STACK inside the top-level handler; redesign recursive PL/SQL with an explicit depth counter and EXIT WHEN depth > N; flatten circular trigger chains using conditional logic: IF INSERTING AND :NEW.source != 'TRIGGER' THEN ... END IF.
Recursive SQL β Trigger Chain Loop
Meaning An AFTER INSERT trigger on TABLE_A inserts into TABLE_B, which has an AFTER INSERT trigger that inserts back into TABLE_A, creating an infinite recursive call chain.
Possible causes Bidirectional trigger logic between two or more tables forming a closed loop; audit or replication triggers that themselves perform DML on monitored tables; missing guard conditions to detect trigger-initiated DML.
Troubleshooting Use a package-level boolean flag: IF NOT pkg_guard.in_trigger THEN pkg_guard.in_trigger := TRUE; ... pkg_guard.in_trigger := FALSE; END IF; alternatively redesign the data model to eliminate circular triggers.
Recursive SQL β Unbounded PL/SQL Recursion
Meaning A PL/SQL procedure calls itself recursively without a valid base case, consuming all 255 available recursive SQL levels.
Possible causes Tree-traversal or hierarchical data processing procedure missing the EXIT WHEN leaf-node condition; incorrect termination logic allowing infinite self-invocation; always add a maximum depth parameter: PROCEDURE traverse(p_id IN NUMBER, p_depth IN NUMBER DEFAULT 0) and EXIT WHEN p_depth > 50.
Troubleshooting Rewrite deep tree traversals using iterative loops with an explicit stack collection (DBMS_SQL or a PL/SQL TABLE) instead of recursive calls; verify base case logic covers all possible leaf values including NULL.