1. Create a stored procedure
Create or Replace procedure p_dmi_agent is
begin
Delete dmi_agent;
INSERT INTO Dmi_agent SELECT * from Dmi_agent_v_sysdate;
INSERT INTO Dmi_agent SELECT * from dmi_agent_v_sysdate1;
INSERT INTO Dmi_agent SELECT * from Dmi_agent_v_sysdate2;
INSERT INTO Dmi_agent_log (dateid,taskno,successcnt) VALUES (To_number (To_char (sysdate, ' YYYYMMDD ')), ' Group Human Push interface ', ' 1 ');
exception when others then
INSERT INTO Dmi_agent_log (dateid,taskno,successcnt) VALUES (To_number (To_char (sysdate, ' YYYYMMDD ')), ' Group Human Push interface ', ' 0 ');
end;
2. Create an execution plan
Declare
Job integer;
Begin
Dbms_job.submit (Job, 'p_dmi_agent; ', Trunc (sysdate), ' Trunc (sysdate) +1 ');
Commit
End
3. Query plan
SELECT j.job,j.last_date,j.last_sec,j.next_date,j.next_sec,j.interval,j.what from dba_jobs j where J.WHAT = ' p_dmi_agent; ';
Oracle Create simple stored procedure sample