drop function if exists transactional.fn_run_updates;
CREATE OR REPLACE FUNCTION transactional.fn_run_updates(p_client_id int,p_function_id int,p_file_mnemonic text,p_file_sheet_mnemonic text,p_file_syspk int)
   RETURNS void AS $$
declare
    __file_syspk int := p_file_syspk;
   begin
-- Update location at test_insstance table:
update transactional.test_instance 
set test_location_name = 'BUDNI'
where file_mnemonic = 'BUDNI' 
and file_syspk = p_file_syspk;

update transactional.test_instance 
set test_location_name = 'MRV FD Test Track'
where file_mnemonic in ('DBSTD', 'DBOECD')
and file_syspk = p_file_syspk;

update transactional.test_instance 
set test_location_name = 'MRV FD Test Track'
where file_mnemonic like 'IHT%'
and file_syspk = p_file_syspk;

update transactional.test_instance 
set test_location_name = 'PTO Lab'
where file_mnemonic like 'PTO%'
and file_syspk = p_file_syspk;


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')
and file_syspk = p_file_syspk;

update transactional.test_instance 
set date_of_test = test_report_date
where date_of_test is null
and file_mnemonic like 'IHT%'
and file_syspk = p_file_syspk;



update transactional.test_instance 
set date_of_test = test_end_date
where date_of_test is null
and file_mnemonic like 'IHT%'
and file_syspk = p_file_syspk;


update transactional.test_instance_images a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_tractor_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_engine_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_implement_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_trailer_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_gear_speed_chart a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_equipment_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.field_perf_summary_trailer_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.drawbar_perf_results_summary a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.drawbar_perf_oecd_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.drawbar_perf_observations a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.pto_perf_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.pto_key_perf_parameters a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.pto_smoke_test a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.pto_engine_oil_consumption a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.pto_multipoint_mapping a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.pto_perf_governing_graph a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_pto_perf_results_details a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_drawbar_perf_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_hydraulic_power_test_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_hydraulic_lifting_capacity_test_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_hydraulic_maint_of_lift_load_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_brake_perf_service_brake_test_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_brake_perf_parking_brake_test_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_noise_atmospheric_conditions a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_noise_measurement_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_vibration_measurement a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_centre_of_gravity_location a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_haulage_perf_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_air_cleaner_perf_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_test_observations a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_cgm_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_steering_effort a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_steering_effort_raw_data a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_pedal_effort a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_gear_effort a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_brake_pedal_effort a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_hyd_lift_sensitivity a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_speed_lead_lag_measurement a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_gear_max_speed a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_brake_perf_test_condition a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_brake_perf_test_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_hot_air_mapping_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_noise_measurement_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_noise_measurement_test a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_tyre_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.field_perf_summary_tractor_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_pto_perf_results_summary a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.budni_field_perf_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_cgm_lifting_angle_load_details a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.iht_clutch_pedal_effort a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_tractor_info_misc a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_wheels_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_fuel_lubricant_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_measurement_uncertainty a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_atmospheric_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_drawbar_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.test_instance_weight_reaction a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.field_perf_summary a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.field_perf_summary_implement_info a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;
update transactional.drawbar_perf_results a set test_instance_id= b.syspk from transactional.test_instance b where a.file_syspk=b.file_syspk and a.file_mnemonic =b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = p_file_syspk;



update transactional.test_instance_engine_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_gear_speed_chart a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_equipment_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.drawbar_perf_results_summary a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.drawbar_perf_oecd_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.drawbar_perf_observations a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.pto_perf_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.pto_key_perf_parameters a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.pto_smoke_test a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.pto_engine_oil_consumption a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.pto_multipoint_mapping a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.pto_perf_governing_graph a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_pto_perf_results_details a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_drawbar_perf_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_hydraulic_power_test_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_hydraulic_lifting_capacity_test_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_hydraulic_maint_of_lift_load_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_brake_perf_service_brake_test_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_brake_perf_parking_brake_test_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_noise_atmospheric_conditions a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_noise_measurement_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_vibration_measurement a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_centre_of_gravity_location a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_haulage_perf_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_air_cleaner_perf_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_test_observations a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_cgm_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_steering_effort a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_steering_effort_raw_data a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_pedal_effort a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_gear_effort a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_brake_pedal_effort a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_hyd_lift_sensitivity a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_speed_lead_lag_measurement a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_gear_max_speed a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_brake_perf_test_condition a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_brake_perf_test_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_hot_air_mapping_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_noise_measurement_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_noise_measurement_test a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_tyre_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.field_perf_summary_tractor_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_pto_perf_results_summary a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.budni_field_perf_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_cgm_lifting_angle_load_details a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.iht_clutch_pedal_effort a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_tractor_info_misc a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_wheels_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_fuel_lubricant_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_measurement_uncertainty a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_atmospheric_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_drawbar_info a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.test_instance_weight_reaction a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.field_perf_summary a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;
update transactional.drawbar_perf_results a set test_instance_tractor_id = b.syspk from transactional.test_instance_tractor_info b where a.file_syspk = b.file_syspk and a.file_mnemonic = b.file_mnemonic and a.file_sheet_mnemonic = b.file_sheet_mnemonic and a.file_syspk = __file_syspk;



end;
$$  LANGUAGE plpgsql;
