CREATE OR REPLACE PACKAGE BODY is
procedure joblog(v_job varchar2,
v_starttime timestamp,
v_endtime timestamp,
v_comments varchar2) is
pragma autonomous_transaction;
begin
insert into tbjoblog
(job_name, starttime, endtime, comments)
values
(v_job, v_starttime, v_endtime, v_comments);
commit;
end;
procedure pr_sync_tbscoretop is
v_starttime timestamp := systimestamp;
begin
execute immediate 'create table ';
execute immediate 'create index ';
execute immediate 'truncate table ';
execute immediate 'insert into ';
commit;
execute immediate 'drop table ';
joblog('pr_, v_starttime, systimestamp, null);
commit;
end;