mmt sql
This commit is contained in:
@@ -23,11 +23,12 @@ CREATE OR REPLACE FUNCTION fw_core.fn_run_post_generic_validation(p_client_id in
|
||||
if trx_record_count > 0 then
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status_note ='generic_validation_failed', end_status='error', staging_type = 'stg1',end_time = now() where file_syspk = f.file_syspk;
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'file_syspk exists', end_status='error', staging_type = 'stg1',end_time = now() where file_syspk = f.file_syspk;
|
||||
end if;
|
||||
|
||||
else
|
||||
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status_note ='generic_validation_completed', end_status='success', staging_type = 'stg1',end_time = now() where file_syspk = f.file_syspk;
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'generic_validation_completed', end_status='success', staging_type = 'stg1',end_time = now() where file_syspk = f.file_syspk and file_sheet_mnemonic is not null;
|
||||
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
SELECT SUM (case WHEN end_status = 'success' THEN 1
|
||||
@@ -46,9 +47,11 @@ else
|
||||
|
||||
-- validate sheet names for a given file:
|
||||
|
||||
for f in select distinct file_syspk,file_mnemonic from fw_core.fw_jobctl_file_sheet_runschedule
|
||||
where file_sheet_mnemonic is not null
|
||||
and end_status != 'error' and end_status_note = 'generic_validation_completed' and latest_runschedule_flag = '1'
|
||||
for f in select distinct file_syspk,file_mnemonic from fw_core.fw_jobctl_file_runschedule
|
||||
where
|
||||
end_status != 'error' and
|
||||
end_status_note = 'generic_validation_completed' and
|
||||
latest_runschedule_flag = '1'
|
||||
loop
|
||||
|
||||
|
||||
@@ -95,6 +98,7 @@ end if;
|
||||
for f in select distinct file_syspk,file_mnemonic,file_sheet_mnemonic
|
||||
from fw_core.fw_jobctl_file_sheet_runschedule where file_sheet_mnemonic !=''
|
||||
and end_status != 'error' and end_status_note = 'generic_validation_completed'
|
||||
and latest_runschedule_flag = '1'
|
||||
order by file_syspk
|
||||
loop
|
||||
select case
|
||||
|
||||
Reference in New Issue
Block a user