我对此触发器有错误
create or replace trigger eliminar_serie
before delete on series
for each row
declare
xfecha date;
begin
select fechaVencimiento into xfecha from series x join licencias y on x.licencia=y.idlicencia;
if(trunc(xfecha)-trunc(sysdate)>0)then
raise_application_error(-20004,'No se puede eliminar la serie si no ha vencido la licencia de esta');
end if;
end;
错误是
Error SQL: ORA-04091: la tabla BD2090938.SERIES está mutando, puede que el disparador/la función no puedan verla ORA-06512: en "BD2090938.ELIMINAR_SERIE", línea 4 ORA-04088: error durante la ejecución del disparador 'BD2090938.ELIMINAR_SERIE' 04091. 00000 - "table %s.%s is mutating, trigger/function may not see it" *Cause: A trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it. *Action: Rewrite the trigger (or function) so it does not read that table.