title: ORA-04088: error during execution of trigger
body: <p>Errors:</p>
  
  <pre><code>ORA-00036: maximum number of recursive SQL levels (50) exceeded
  ORA-00036: maximum number of recursive SQL levels (50) exceeded
  ORA-06512: at "SYS.STANDARD", line 180
  ORA-06512: at "ETRACKER.R_TRACKER_TRI", line 7
  ORA-04088: error during execution of trigger 'ETRACKER.R_TRACKER_TRI'
  ORA-06512: at "ETRACKER.R_TRACKER_TRI", line 24
  ORA-04088: error during execution of trigger 'ETRACKER.R_TRACKER_TRI'
  ORA-06512: at "ETRACKER.R_TRACKER_TRI", line 24 ORA-04088: error during execution of trigger 'ETRACKER.R_TRACK
  </code></pre>
  
  <p>Trigger code:</p>
  
  <pre><code>create or replace TRIGGER  R_TRACKER_TRI
     before insert on R_TRACKER
     for each row
     declare
     v_number varchar2(15);
     begin
        if inserting then 
           :NEW.PROJECT_ID := 1;--PROJECT_ID(1);
           :NEW.PRO_CREATED := LOCALTIMESTAMP;
           :NEW.PRO_CREATED_BY := nvl(v('APP_USER'),USER);
  
           IF :NEW.RECRUITMENT_TYPE= 'New' THEN
              SELECT ('NEW/'||TO_CHAR(SYSDATE,'YY') || '/' || (NVL(MAX(SUBSTRB(PROJECT_ID,8)),10000)+1)) into v_number 
              FROM R_TRACKER
              WHERE SUBSTRB(PROJECT_ID,1,3) = 'NEW';
  
              :NEW.PROJECT_ID := v_number;
           elsif :NEW.RECRUITMENT_TYPE= 'Replacement' THEN
              SELECT ('REP/'||TO_CHAR(SYSDATE,'YY') || '/' || (NVL(MAX(SUBSTRB(PROJECT_ID,8)),10000)+1)) into v_number 
              FROM R_TRACKER
              WHERE SUBSTRB(PROJECT_ID,1,3) = 'REP';
  
              :NEW.PROJECT_ID := v_number;      
           end if;
  
        INSERT INTO R_TRACKER (
           PROJECT_ID,
           PRO_LOC,
           DESIGNATION,
           NO_OF_POSITION,
  </code></pre>