0

I am creating a trigger for inserting incremental ID's in my table. But while creating I am getting below error

An error occurred while processing a recursive SQL statement (a statement applying to internal dictionary tables).

ORA-00604: error occurred at recursive SQL level 1
ORA-01654: unable to extend index SYS.I_TRIGGERCOL1 by 64 in tablespace SYSTEM

Here is my trigger query.

create or replace TRIGGER TGR_IPCOLO_BIL
        BEFORE INSERT ON ipcolo_ipfee_calc_bil
    for each row 
begin  
       IF INSERTING THEN 
          IF :NEW."ID" IS NULL THEN 
     select SEQ_IPCOLO_IPFEE_BIL.nextval into :NEW."ID" from dual; 
  end if; 
 END IF; 
end;
2
  • error code is something ORA-00604: error occurred at recursive SQL level 1 ORA-01654: unable to extend index SYS.I_TRIGGERCOL1 by 64 in tablespace SYSTEM Commented Jun 16, 2022 at 15:01
  • 1
    Looks like your SYSTEM tablespace has run out of space then; nothing to do with the trigger really, that's just what you happen to be doing when it needs space it can't find. You might be able to do some clean-up but in the short term you can increase the size. Not really a programming issue though. Commented Jun 16, 2022 at 15:04

1 Answer 1

1

That error sounds pretty bad (I never saw it before) ... internal dictionary tables?! What is error code? ORA-xxxxx?


Meanwhile, trigger can be simplified to this:

create or replace trigger trg_ipcolo_bil
  before insert on ipcolo_ipfee_calc_bil
  for each row
begin
  :new.id := nvl(:new.id, seq_ipolo_ipfee_bil.nextval);
end;
/

You don't have to check if inserting; what else could it be, if it fires before insert? Also, you don't need select ... into - use sequence directly. nvl makes sure you won't overwrite id if you provided it.


Also, consider using identity column instead, if your database version supports it.

Sign up to request clarification or add additional context in comments.

4 Comments

error code is something ORA-00604: error occurred at recursive SQL level 1 ORA-01654: unable to extend index SYS.I_TRIGGERCOL1 by 64 in tablespace SYSTEM
Right; just Googled it. Is there any schema-level trigger which does something it shouldn't? Owned by SYS (or SYSTEM)? Check select * from dba_triggers.
getting error as ORA-00942: table or view does not exist. Yes I have one trigger on another column. is it due to that
I'd rather say that user - you're currently connected to - doesn't have privileges to query DBA_TRIGGERS. But never mind that; as you commented below the question, you ran out of space so you'll have to talk to DBA.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.