スニペットが役立ちます。
--Table to create dummy insertion
CREATE TABLE TEST_SO_TAB
(
COL1 NUMBER
);
--Procedure to replicate scenario
CREATE OR REPLACE
PROCEDURE TEST_SO_SCHEDULER(
p_in IN NUMBER)
AS
lv sys.odcinumberlist;
BEGIN
SELECT LEVEL BULK COLLECT INTO lv FROM dual CONNECT BY level < 100;
DBMS_SCHEDULER.create_job (job_name => 'DELTA_REFRESH_JOB',
job_type => 'PLSQL_BLOCK',
job_action => 'DECLARE
lv1 sys.odcinumberlist;
BEGIN
SELECT LEVEL BULK COLLECT INTO lv1 FROM dual CONNECT BY level < 100;
IF lv1.EXISTS(1) THEN
FORALL i IN lv1.FIRST..lv1.LAST
INSERT INTO TEST_SO_TAB VALUES
(lv1(i)
);
END IF;
END',
start_date => SYSTIMESTAMP+ INTERVAL '20' MINUTE,
end_date => NULL,
enabled => TRUE,
comments => 'Job defined entirely by the CREATE JOB procedure.');
END;
/
DBMS_SCHEDULERを参照してください –
20分後にサブプログラムを実行する特別な理由はありますか? – Himanshujaggi