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

@@ -0,0 +1,44 @@
drop function if exists transactional.fn_run_updates;
CREATE OR REPLACE FUNCTION transactional.fn_run_updates(p_client_id int,p_function_id int)
RETURNS void AS $$
begin
-- Update location at test_insstance table:
update transactional.test_instance
set test_location_name = 'BUDNI'
where file_mnemonic = 'BUDNI' ;
update transactional.test_instance
set test_location_name = 'MRV Test Track'
where file_mnemonic in ('DBSTD', 'DBOECD');
update transactional.test_instance
set test_location_name = 'MRV Test Track'
where file_mnemonic like 'IHT%';
update transactional.test_instance
set test_location_name = 'MRV'
where file_mnemonic like 'PTO%';
update transactional.test_instance
set season = TO_CHAR(
TO_DATE (extract( month from date_of_test)::text, 'MM'), 'Month'
)
where season is null
and file_mnemonic in ('FTDRY','FTWET');
update transactional.test_instance
set date_of_test = test_report_date
where date_of_test is null
and file_mnemonic like 'IHT%';
update transactional.test_instance
set date_of_test = test_end_date
where date_of_test is null
and file_mnemonic like 'IHT%';
end;
$$ LANGUAGE plpgsql;