I have a trigger which runs when on an insert in to my keyword table. The key word is taken in as a string and separated by a comma. I have separated each value and then try insert them in each value into the table. But when I run the insert I get an error.
My trigger
create or replace TRIGGER trg_INSERTKEYWORDS
BEFORE INSERT ON Keyword
FOR EACH ROW
DECLARE
varKeyWordsStr VARCHAR2 (255) := 'Hello,How,are,you,keeping';
BEGIN
FOR k IN (SELECT REGEXP_SUBSTR (varKeyWordsStr,'[^,]+',1,LEVEL) keyWord
FROM DUAL
CONNECT BY REGEXP_SUBSTR (varKeyWordsStr,'[^,]+',1,LEVEL)IS NOT NULL)
LOOP
INSERT INTO KEYWORD VALUES(seqKeyWord.NEXTVAL,k.keyWord,1000);
END LOOP;
END;
But i get the error
Error starting at line : 2 in command - INSERT INTO KEYWORD VALUES(75,'SDFSDF',1000) Error report - SQL Error: ORA-00036: maximum number of recursive SQL levels (50) exceeded ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 4 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 ORA-04088: error during execution of trigger 'SW3.TRG_INSERTKEYWORDS' ORA-06512: at "SW3.TRG_INSERTKEYWORDS", line 8 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.