Create a procedure first!
Then create a job to execute her regularly!
(1) create or replace procedure droptable
Tmpname varchar2 (50); cursor ftmp is
Select table_name
From all_tables
Where table_name <= 'to _ date (to_char (sysdate,
''Yyymmdd')-7'
And table_name> = 'tmp '; begin open ftmp; Loop fetch ftmp
Into tmpname; exit when ftmp % notfound; if ftmp % found then
Execute immediate 'drop
Table' | tmpname; end if; end loop; close ftmp; end;
(2)
Declare v_jobnum
Begin
Dbms_job.submit (v_jobnum, proname, sysdate, interval );
End;
The first code is to create procedure.
Is the second generation interrupted? Is it a job?
Call the proname of the package to start the job: name of the procedure to be executed
Sysdate: Start Time of job execution
Interval: interval between job execution
**************************************** ******
DECLARE v_jobnum NUMBER;
BEGIN
Dbms_job.submit (v_jobnum, 'lqsh. GetDataFromTemp; ', SYSDATE, 'sysdate + 1 ');
END;
**************************************** *******