Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trigger Error maximum number of recursive SQL levels

873006Aug 29 2012 — edited Aug 29 2012
Hi Team,

I have getting error will insert into table i.e

i have a trigger as below
create or replace trigger INS_ERRORS 
before insert on MIG_STG_ERRORS 
for each ROW 
declare 
V VARCHAR2(22);
  BEGIN
    select COUNT(*) into V from MIG_STG_ERRORS;
    
    IF V=0 THEN
      insert into MIG_STG_ERRORS
        (KEY_VALUE) VALUES(v);
    END IF;
  END;
Key_value is varchar data type.

when i insert into MIG_STG_ERRORS getting error message like
00036. 00000 - "maximum number of recursive SQL levels (%s) exceeded"
*Cause: An attempt was made to go more than the specified number
of recursive SQL levels.
*Action: Remove the recursive SQL, possibly a recursive trigger.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2012
Added on Aug 29 2012
4 comments
1,307 views