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

11
onetime/commonfunctions/fn_run_post_trx_validation.sql Normal file → Executable file
View File

@@ -16,19 +16,16 @@ CREATE OR REPLACE FUNCTION fw_core.fn_run_trx_post_validation(p_client_id int,p_
loop
select count(*) from transactional.test_instance where file_syspk = f.file_syspk into trx_record_count;
if (trx_record_count = 0) then
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'trx_post_validation_failed', end_status='error', end_time= now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1';
--update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'trx_post_validation_failed', end_status='success', end_time= now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1';
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'trx_post_validation_failed', end_status='error', end_time= now() where file_syspk=f.file_syspk;
update fw_core.fw_jobctl_file_runschedule set end_status_note = 'trx_post_validation_failed', end_status='error', end_time= now() where file_syspk=f.file_syspk;
else
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'TRX_completed', end_status='success' , end_time= now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1';
--update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'TRX_completed', end_status='success' , end_time= now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1';
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'TRX_completed', end_status='success', end_time= now() where file_syspk=f.file_syspk;
update fw_core.fw_jobctl_file_runschedule set end_status_note = 'TRX_completed', end_status='success', end_time= now() where file_syspk=f.file_syspk;
end if;
end loop;
/*
--insert into fw_core.track_jobstep select *,'trx_validation' from fw_core.fw_jobctl_runschedule_jobstep;
--insert into fw_core.track_file select *,'trx_validation' from fw_core.fw_jobctl_file_runschedule;
--insert into fw_core.track_file_sheet select *,'trx_validation' from fw_core.fw_jobctl_file_sheet_runschedule;
*/
update fw_core.fw_jobctl_runschedule_jobstep set end_status='success', end_status_note = 'TRX_post_validation_completed', end_time= now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1';
end;
$$ LANGUAGE plpgsql;