mmt sql
This commit is contained in:
@@ -7,7 +7,8 @@ CREATE OR REPLACE FUNCTION fw_core.fn_run_trx_rollback(p_client_id int,p_functio
|
||||
|
||||
for f in select file_syspk,file_mnemonic
|
||||
from fw_core.fw_jobctl_file_runschedule where latest_runschedule_flag = '1' and end_status = 'error'
|
||||
and end_status_note in ('stg2_failed','TRX_failed')
|
||||
and end_status_note in ('stg2_failed','TRX_failed','ODS_failed','trx_post_validation_failed')
|
||||
|
||||
order by file_syspk
|
||||
loop
|
||||
if f.file_mnemonic = 'FTDRY' then
|
||||
@@ -162,9 +163,16 @@ CREATE OR REPLACE FUNCTION fw_core.fn_run_trx_rollback(p_client_id int,p_functio
|
||||
delete from transactional.iht_steering_effort_raw_data where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_hot_air_mapping_results where file_syspk = f.file_syspk;
|
||||
end if;
|
||||
|
||||
delete from fw_ods.fw_ods where test_file_id =f.file_syspk;
|
||||
delete from fw_ods.fw_ods_comments where test_file_id = f.file_syspk;
|
||||
delete from fw_ods.fw_ods_detailed where test_file_id =f.file_syspk;
|
||||
delete from fw_ods.fw_ods_drawbar_performance where test_file_id = f.file_syspk;
|
||||
delete from fw_ods.fw_ods_observations where test_file_id = f.file_syspk;
|
||||
|
||||
end loop;
|
||||
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'rollback completed', end_status='success', end_time=now() where job_id = p_job_id and step_id = p_step_id and latest_runschedule_flag = '1';
|
||||
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
Reference in New Issue
Block a user