Trigger call delay after inserting oracle

Is there any way to do this? I found an add-on,

DBMS_LOCK.sleep() 

to the start of the startup code using googling, but it blocks the insert itself. I would like to insert data, but the trigger should only be started after an arbitrary delay. Thank.

+3
source share
1 answer

This would help if we knew why you needed this delay, and what the trigger should do after the delay. However, one possibility is to use the DBMS_JOB package in a trigger to create a job that runs at a time after insertion. For instance:

create trigger trg
after insert on tab
for each row
declare
  jl_ob number;
begin
  dbms_job.submit
    ( job => l_job
    , what => 'myproc(:new.id);'
    , next_date => sysdate+1/24/60 -- One minute later
    );
end;

DBMS_JOB, , . 10 , , X .

+7

Source: https://habr.com/ru/post/1756127/


All Articles