I have created the following trigger to update the table "T1",
here the from_date and to_date are date columns
and the no_of_days is difference between the from_date and to_date columns,
the remaining date is default 18, and when the user enters the from_date and to_date value
the no_of_days has to be calculated and remaining days should be calculated like
(18- no_of_days) when i create the trigger its created but I cant insert the values,
it showing the following error,
ORA-00036: maximum number of recursive SQL levels (50) exceeded
ORA-06512: at "HR.INSERTTRIGG ER2", line 13
ORA-04088: error during execution of trigger 'HR.INSERTTRIGG ER2'
ORA-06512: at "HR.INSERTTRIGG ER2", line 13
Whats the error can anyone sugget me the result?
Thank you,
regards,
gurujothi
Code:
create or replace trigger inserttrigger2 before insert on t1 referencing old as old new as new for each row declare to_date date; from_date date; no_of_days number(2); remaining_days number(2); begin to_date := :new.to_date; from_date := :new.from_date; no_of_days := (:new.to_date - :new.from_date)+1; remaining_days := (18 -((:new.to_date - :new.from_date)+1)); insert into t1(to_date,from_date,no_of_days,remaining_days) values (:new.to_date,:new.from_date,:new.no_of_days,:new.remaining_days); end;
and the no_of_days is difference between the from_date and to_date columns,
the remaining date is default 18, and when the user enters the from_date and to_date value
the no_of_days has to be calculated and remaining days should be calculated like
(18- no_of_days) when i create the trigger its created but I cant insert the values,
it showing the following error,
ORA-00036: maximum number of recursive SQL levels (50) exceeded
ORA-06512: at "HR.INSERTTRIGG ER2", line 13
ORA-04088: error during execution of trigger 'HR.INSERTTRIGG ER2'
ORA-06512: at "HR.INSERTTRIGG ER2", line 13
Whats the error can anyone sugget me the result?
Thank you,
regards,
gurujothi
Comment