git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@50874 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
121
Data/BulkLoad/EFT/Nominations/plsql/cama_job_submission.bdy
Normal file
121
Data/BulkLoad/EFT/Nominations/plsql/cama_job_submission.bdy
Normal file
@@ -0,0 +1,121 @@
|
||||
CREATE OR REPLACE PACKAGE BODY EFT_NOM.cama_job_submission IS
|
||||
--
|
||||
-- ---------------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
-- Package: cama_job_submission
|
||||
--
|
||||
-- Application: LNG Importation
|
||||
--
|
||||
-- Creation Date: 23/11/2004
|
||||
--
|
||||
-- ---------------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
-- Header Information
|
||||
--
|
||||
g_header CONSTANT VARCHAR2(160) := '$Header: /Isle Of Grain/database/PLSQL/cama_job_submission.pck 8 16/08/05 16:05 Gilberta $';
|
||||
g_revision CONSTANT VARCHAR2(160) := '$Revision: 8 $';
|
||||
--
|
||||
/*
|
||||
* $History: cama_job_submission.pck $
|
||||
*
|
||||
* ***************** Version 8 *****************
|
||||
* User: Gilberta Date: 16/08/05 Time: 16:05
|
||||
* Updated in $/Isle Of Grain/database/PLSQL
|
||||
* Modified to add space into second submission of dfn
|
||||
*
|
||||
* ***************** Version 7 *****************
|
||||
* User: Gilberta Date: 28/07/05 Time: 16:45
|
||||
* Updated in $/Isle Of Grain/database/PLSQL
|
||||
* Modified to add 1 to the next date
|
||||
*
|
||||
* ***************** Version 4 *****************
|
||||
* User: Gilberta Date: 30/06/05 Time: 15:33
|
||||
* Updated in $/Isle Of Grain/database/PLSQL
|
||||
* Modified to include scheduled faxes
|
||||
*
|
||||
* ***************** Version 3 *****************
|
||||
* User: Gilberta Date: 4/03/05 Time: 14:21
|
||||
* Updated in $/Isle Of Grain/database/PLSQL
|
||||
* Modified to include voice message components
|
||||
*
|
||||
* ***************** Version 2 *****************
|
||||
* User: Gilberta Date: 9/02/05 Time: 12:28
|
||||
* Updated in $/Isle Of Grain/database/PLSQL
|
||||
* Modified to include process routines after files have been loaded.
|
||||
*
|
||||
* ***************** Version 1 *****************
|
||||
* User: Gilberta Date: 7/01/05 Time: 12:54
|
||||
* Created in $/Isle Of Grain/database/PLSQL
|
||||
* Initial Version
|
||||
*
|
||||
*/
|
||||
--
|
||||
-- S U B M I T J O B
|
||||
--
|
||||
PROCEDURE submit_job ( p_what IN all_jobs.what%TYPE
|
||||
, p_next_date IN all_jobs.next_date%TYPE
|
||||
, p_interval IN all_jobs.interval%TYPE
|
||||
) IS
|
||||
--
|
||||
CURSOR c_allj ( p_what IN all_jobs.what%TYPE ) IS
|
||||
SELECT allj.job
|
||||
FROM all_jobs allj
|
||||
WHERE allj.what = p_what;
|
||||
--
|
||||
v_job all_jobs.job%TYPE;
|
||||
--
|
||||
BEGIN
|
||||
--
|
||||
-- Check for jobs of this type and remove them
|
||||
--
|
||||
FOR c_allj_rec IN c_allj ( p_what ) LOOP
|
||||
--
|
||||
dbms_job.remove ( c_allj_rec.job );
|
||||
--
|
||||
-- Commit following removal
|
||||
--
|
||||
COMMIT;
|
||||
--
|
||||
END LOOP;
|
||||
--
|
||||
-- Submit the job
|
||||
--
|
||||
dbms_job.submit ( v_job
|
||||
, p_what
|
||||
, p_next_date
|
||||
, p_interval
|
||||
);
|
||||
--
|
||||
-- Commit following submission
|
||||
--
|
||||
COMMIT;
|
||||
--
|
||||
END submit_job;
|
||||
--
|
||||
-- S U B M I T
|
||||
--
|
||||
PROCEDURE submit IS
|
||||
BEGIN
|
||||
--
|
||||
-- Call the submit job sub-procedure which will remove any existing jobs scheduled (not running) and resubmit them with
|
||||
-- the parameters specified below.
|
||||
--
|
||||
-- Parameters are: what : PL/SQL procedure to run
|
||||
-- next date : Next date when the job will be run
|
||||
-- interval : The next time the job is to be run
|
||||
--
|
||||
-- File load and process interface
|
||||
--
|
||||
submit_job ( 'BEGIN
|
||||
lisu_file_load.load_files;
|
||||
lisu_process_files.process_data;
|
||||
END;'
|
||||
, trunc(sysdate+1/24,'HH')
|
||||
, 'trunc(sysdate+1/24,''HH'')'
|
||||
);
|
||||
--
|
||||
END submit;
|
||||
--
|
||||
END cama_job_submission;
|
||||
/
|
||||
|
||||
Reference in New Issue
Block a user