added deployment folder with latest code
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
drop function if exists mmt_staging2.fn_BUDNI_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select distinct a.file_syspk
|
||||
from mmt_staging1.mmt_staging_generic_table a
|
||||
where file_format = 'BUDNI' order by file_syspk
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_BUDNI_ARC_Block(20,1,'BUDNI','BUDNI_ARC',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_ARC' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_ARC_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_BRK_Block (20,1,'BUDNI','BUDNI_BRK',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_BRK' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_BRK_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_DBP_Block(20,1,'BUDNI','BUDNI_DBP',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_DBP' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_DBP_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_FLD_Block(20,1,'BUDNI','BUDNI_FLD',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_FLD' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_FLD_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_HDL_Block(20,1,'BUDNI','BUDNI_HDL',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_HDL' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_HDL_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_HLG_Block(20,1,'BUDNI','BUDNI_HLG',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_HLG' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_HLG_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_LCG_Block(20,1,'BUDNI','BUDNI_LCG',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_LCG' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_LCG_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_NMT_Block(20,1,'BUDNI','BUDNI_NMT',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_NMT' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_NMT_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_PTO_Block(20,1,'BUDNI','BUDNI_PTO',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_PTO' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_PTO_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_BUDNI_VMT_Block(20,1,'BUDNI','BUDNI_VMT',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_VMT' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_BUDNI_VMT_ODS(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
select mmt_staging2.fn_BUDNI_RUN();
|
||||
|
||||
|
||||
delete from mmt_staging2.mmt_DB_Run_Status where file_format = 'BUDNI';
|
||||
select count(distinct file_syspk) from mmt_staging2.mmt_DB_Run_Status
|
||||
select file_syspk,sheet_mnemonic from mmt_staging2.mmt_DB_Run_Status where status = 'error';
|
||||
select * from mmt_staging2.mmt_DB_Run_Status where file_format = 'BUDNI' and status = 'error';
|
||||
select distinct file_syspk from mmt_staging2.mmt_DB_Run_Status where file_format = 'BUDNI';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
drop function if exists mmt_staging2.fn_DBOECD_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_DBOECD_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select distinct a.file_syspk
|
||||
from mmt_staging1.mmt_staging_generic_table a
|
||||
where file_format = 'DBOECD' order by file_syspk
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_dboecd_test_block(1,2,'DBOECD','DBOECD_TEST',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='DBOECD_TEST' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_ods.fn_dboecd_test_ods(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
--select mmt_staging2.fn_DBOECD_RUN()
|
||||
@@ -0,0 +1,23 @@
|
||||
drop function if exists mmt_staging2.fn_DBSTD_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_DBSTD_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select distinct a.file_syspk
|
||||
from mmt_staging1.mmt_staging_generic_table a
|
||||
where file_format = 'DBSTD' order by file_syspk
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_dbstd_test_block(1,2,'DBSTD','DBSTD_TEST',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='DBSTD_TEST' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_ods.fn_dbstd_test_ods(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
--select mmt_staging2.fn_DBSTD_RUN()
|
||||
@@ -0,0 +1,29 @@
|
||||
drop function if exists mmt_staging2.fn_FTDRY_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select distinct a.file_syspk
|
||||
from mmt_staging1.mmt_staging_generic_table a
|
||||
where file_format = 'FTDRY' order by file_syspk
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_TRS' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTDRY_TRS_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_FTDRY_SUM_Block (20,1,'FTDRY','FTDRY_SUM',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_SUM' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTDRY_SUM_ODS(w_file_syspk);
|
||||
perform mmt_staging2.fn_test_output_FTDRY(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
--select mmt_staging2.fn_FTDRY_RUN()
|
||||
@@ -0,0 +1,26 @@
|
||||
drop function if exists mmt_staging2.fn_FTDRY_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select file_syspk from mmt_ods.fw_jobctl_file_runschedule
|
||||
where end_status like 'Staging1 Completed' and file_format='FTDRY'
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_TRS' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTDRY_TRS_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_FTDRY_SUM_Block (20,1,'FTDRY','FTDRY_SUM',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_SUM' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTDRY_SUM_ODS(w_file_syspk);
|
||||
perform mmt_staging2.fn_test_output_FTDRY(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
@@ -0,0 +1,29 @@
|
||||
drop function if exists mmt_staging2.fn_FTHLG_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTHLG_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select distinct a.file_syspk
|
||||
from mmt_staging1.mmt_staging_generic_table a
|
||||
where file_format = 'FTHLG' order by file_syspk
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_FTHLG_TRS_Block(20,1,'FTHLG','FTHLG_TRS',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTHLG_TRS' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTHLG_TRS_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_FTHLG_SUM_Block (20,1,'FTHLG','FTHLG_SUM',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTHLG_SUM' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTHLG_SUM_ODS(w_file_syspk);
|
||||
perform mmt_staging2.fn_test_output_FTHLG(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
--select mmt_staging2.fn_FTHLG_RUN()
|
||||
@@ -0,0 +1,29 @@
|
||||
drop function if exists mmt_staging2.fn_FTWET_RUN;
|
||||
CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_RUN()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
w_file_syspk int;
|
||||
status text;
|
||||
begin
|
||||
for f in select distinct a.file_syspk
|
||||
from mmt_staging1.mmt_staging_generic_table a
|
||||
where file_format = 'FTWET' order by file_syspk
|
||||
loop
|
||||
select f.file_syspk into w_file_syspk;
|
||||
perform mmt_staging2.fn_ftwet_trs_block(20,1,'FTWET','FTWET_TRS',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTWET_TRS' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTWET_TRS_ODS(w_file_syspk);
|
||||
end if;
|
||||
perform mmt_staging2.fn_ftwet_sum_block (20,1,'FTWET','FTWET_SUM',w_file_syspk);
|
||||
select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTWET_SUM' into status;
|
||||
if status = 'success' then
|
||||
perform mmt_staging2.fn_FTWET_SUM_ODS(w_file_syspk);
|
||||
perform mmt_staging2.fn_test_output_FTWET(w_file_syspk);
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
--select mmt_staging2.fn_FTWET_RUN()
|
||||
Reference in New Issue
Block a user