This commit is contained in:
dheepa
2021-08-09 11:14:23 +00:00
parent a0d3257be0
commit f3cf5e1d2d
89 changed files with 4769 additions and 1508 deletions

View File

@@ -38,8 +38,8 @@ create table archive.budni_nmt_noise_at_bystander_position_block_archive( like s
create table archive.budni_nmt_noise_at_operator_ear_level_block_archive( like staging2.budni_nmt_noise_at_operator_ear_level_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_nmt_spec_h1_block_archive( like staging2.budni_nmt_spec_h1_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_nmt_test_obs_summary_block_archive( like staging2.budni_nmt_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_mmtkeyword1_block_archive( like staging2.budni_pto_mmtkeyword1_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_mmtkeyword2_block_archive( like staging2.budni_pto_mmtkeyword2_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_Parameter1_block_archive( like staging2.budni_pto_Parameter1_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_Parameter2_block_archive( like staging2.budni_pto_Parameter2_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_perf_report_block_archive( like staging2.budni_pto_perf_report_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_spec_h1_block_archive( like staging2.budni_pto_spec_h1_block including all, insert_time timestamp default current_timestamp);
create table archive.budni_pto_summary_block_archive( like staging2.budni_pto_summary_block including all, insert_time timestamp default current_timestamp);

View File

@@ -1,12 +1,10 @@
--drop function if exists fw_core.fn_run_block_archive;
--drop function if exists archive.fn_run_block_archive;
CREATE OR REPLACE FUNCTION fw_core.fn_run_block_archive(p_client_id int,p_function_id int,p_job_id int,p_step_id int)
CREATE OR REPLACE FUNCTION archive.fn_run_block_archive(p_client_id int ,p_function_id int)
RETURNS void AS $$
declare __client_id int :=p_client_id;
declare __function_id int :=p_function_id;
declare __jobid int := p_job_id;
declare __stepid int := p_step_id;
declare __file_mnemonic text :='ARCHIVE';
declare __file_sheet_mnemonic text :='ARCHIVE_SHEET';
declare __file_syspk int := null;
@@ -55,8 +53,8 @@ insert into archive.budni_nmt_noise_at_bystander_position_block_archive select *
insert into archive.budni_nmt_noise_at_operator_ear_level_block_archive select * from staging2.budni_nmt_noise_at_operator_ear_level_block;
insert into archive.budni_nmt_spec_h1_block_archive select * from staging2.budni_nmt_spec_h1_block;
insert into archive.budni_nmt_test_obs_summary_block_archive select * from staging2.budni_nmt_test_obs_summary_block;
insert into archive.budni_pto_mmtkeyword1_block_archive select * from staging2.budni_pto_mmtkeyword1_block;
insert into archive.budni_pto_mmtkeyword2_block_archive select * from staging2.budni_pto_mmtkeyword2_block;
insert into archive.budni_pto_Parameter1_block_archive select * from staging2.budni_pto_Parameter1_block;
insert into archive.budni_pto_Parameter2_block_archive select * from staging2.budni_pto_Parameter2_block;
insert into archive.budni_pto_perf_report_block_archive select * from staging2.budni_pto_perf_report_block;
insert into archive.budni_pto_spec_h1_block_archive select * from staging2.budni_pto_spec_h1_block;
insert into archive.budni_pto_summary_block_archive select * from staging2.budni_pto_summary_block;
@@ -229,12 +227,6 @@ insert into archive.ptoben_prf_varying_speed_test_high_ambient_block_archive sel
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'archive_function_completed', end_status='success',end_time= now() where job_id=__jobid and step_id=__stepid and latest_runschedule_flag='1';
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'Archive', 'fn_block_archive', err_state, err_msg, err_detail, err_hint, err_context,'success');
EXCEPTION when OTHERS then
GET STACKED DIAGNOSTICS
err_state = returned_sqlstate, /* P0002 */
@@ -243,9 +235,6 @@ GET STACKED DIAGNOSTICS
err_hint = pg_exception_hint, /* No data error capture */
err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'archive function failed', end_status='error' ,end_time= now() where job_id=6 and step_id=1 and latest_runschedule_flag='1';
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'archive', 'fn_block_archive', err_state, err_msg, err_detail, err_hint, err_context,'error');
end
$$ LANGUAGE plpgsql;