diff --git a/ReadMe.txt b/ReadMe.txt deleted file mode 100755 index 54265f9..0000000 --- a/ReadMe.txt +++ /dev/null @@ -1,42 +0,0 @@ -#For folder mmt: -pre requisite: -1. Table fw_core.fw_jobctl_runschedule has a column (end_time) , this column needs to be updated to current date - one can run following queries to update time: - update fw_core.fw_jobctl_runschedule set end_time=current_timestamp - -2. (optional): tables , , has column - the data for this column should be "stg1-completed". if this column has different value apart from the expected values then run the below queries: - update fw_core.fw_jobctl_runschedule set end_status =case when end_status <> '' then 'stg1-completed' end - update fw_core.fw_jobctl_file_sheet_runschedule set end_status =case when end_status <> '' then 'stg1-completed' end - update fw_core.fw_jobctl_file_runschedule set end_status =case when end_status <> '' then 'stg1-completed' end - -3. select fn_update_na() - -Now -1. compile: - In unix terminal, navigate to scripts folder ( home/jagadish/mmt/scripts) - In terminal type: ./run_onetime_compile.sh - In Terminal Type: ./run_onetime_compile.sh 1>/dev/null - this will only print errors on the screen. - - This will compile all applications by creating tables,inserting data etc. - - run_onetime_individual will run compile single folder (plz change the script as per needs) - -2. on linux : run wrappers: - wrapper : run_master_wrapper.sh is a wrapper that executes all wrapper function - it fails to execute if jobctl_runschedule table count is zero for the current date - else executes all the wrappers -running wrapper: - running run_master_wrapper.sh: - to run this wrapper just type in terminal: ./run_master_wrapper.sh - This will execute all the wrappers function. -Done - -one can test things by executing following queries in DBeaver:( - select * from fw_core.db_run_status where error_timestamp::date = date'2021-05-25%'; - select * from fw_core.fw_jobctl_file_runschedule where run_schedule_date::date = date'2021-05-25%'; - select * from fw_core.fw_jobctl_file_sheet_runschedule where run_schedule_date::date = date'2021-05-25%'; - select * from fw_core.check_model_count where create_timestamp::date = date'2021-05-25%; - select * from fw_core.check_mnemonic_count where create_time::date =date'2021-05-25%; - select * from fw_core.check_table_stg_trx_count where create_time::date =date'2021-05-25%; \ No newline at end of file diff --git a/onetime/archive/create/archive_create.sql b/onetime/archive/create/archive_create.sql index d39775a..6f9a343 100755 --- a/onetime/archive/create/archive_create.sql +++ b/onetime/archive/create/archive_create.sql @@ -1,4 +1,8 @@ -create schema archive; +--create schema archive; + + + + create table archive.budni_arc_perf_atmos_meas_test_block_archive( like staging2.budni_arc_perf_atmos_meas_test_block including all, insert_time timestamp default current_timestamp); create table archive.budni_arc_spec_h1_block_archive( like staging2.budni_arc_spec_h1_block including all, insert_time timestamp default current_timestamp); diff --git a/onetime/archive/function/fn_archive.sql b/onetime/archive/function/fn_archive.sql index 0df1c58..bd2c64f 100755 --- a/onetime/archive/function/fn_archive.sql +++ b/onetime/archive/function/fn_archive.sql @@ -1,11 +1,11 @@ --drop function if exists archive.fn_run_block_archive; -CREATE OR REPLACE FUNCTION archive.fn_run_block_archive(p_client_id int ,p_function_id int) +CREATE OR REPLACE FUNCTION archive.fn_run_block_archive(p_client_id int ,p_function_id int,p_file_mnemonic text) RETURNS void AS $$ declare __client_id int :=p_client_id; declare __function_id int :=p_function_id; - declare __file_mnemonic text :='ARCHIVE'; + declare __file_mnemonic text :=p_file_mnemonic; declare __file_sheet_mnemonic text :='ARCHIVE_SHEET'; declare __file_syspk int := null; declare err_state text; @@ -15,6 +15,10 @@ CREATE OR REPLACE FUNCTION archive.fn_run_block_archive(p_client_id int ,p_funct declare err_context text; begin + + +if __file_mnemonic = 'BUDNI' +then insert into archive.budni_arc_perf_atmos_meas_test_block_archive select * from staging2.budni_arc_perf_atmos_meas_test_block; insert into archive.budni_arc_spec_h1_block_archive select * from staging2.budni_arc_spec_h1_block; insert into archive.budni_arc_test_obs_summary_block_archive select * from staging2.budni_arc_test_obs_summary_block; @@ -61,6 +65,8 @@ insert into archive.budni_pto_summary_block_archive select * from staging2.budni insert into archive.budni_vmt_perf_meas_test_block_archive select * from staging2.budni_vmt_perf_meas_test_block; insert into archive.budni_vmt_spec_h1_block_archive select * from staging2.budni_vmt_spec_h1_block; insert into archive.budni_vmt_test_obs_summary_block_archive select * from staging2.budni_vmt_test_obs_summary_block; + +elsif __file_mnemonic = 'DBOECD_TEST' then insert into archive.dboecd_test_drawbar_performance_fuel_consumption_block_archive select * from staging2.dboecd_test_drawbar_performance_fuel_consumption_block; insert into archive.dboecd_test_drawbar_performance_gear_performance_block_archive select * from staging2.dboecd_test_drawbar_performance_gear_performance_block; insert into archive.dboecd_test_drawbar_performance_selected_summary_block_archive select * from staging2.dboecd_test_drawbar_performance_selected_summary_block; @@ -85,6 +91,8 @@ insert into archive.dboecd_test_transmission_fuel_lubricant_block_archive select insert into archive.dboecd_test_transmission_speed_chart_block_archive select * from staging2.dboecd_test_transmission_speed_chart_block; insert into archive.dboecd_test_transmission_speed_chart_desc_block_archive select * from staging2.dboecd_test_transmission_speed_chart_desc_block; insert into archive.dboecd_test_transmission_wheels_block_archive select * from staging2.dboecd_test_transmission_wheels_block; + +elsif __file_mnemonic = 'DBSTD_TEST' then insert into archive.dbstd_test_drawbar_performance_gear_performance_block_archive select * from staging2.dbstd_test_drawbar_performance_gear_performance_block; insert into archive.dbstd_test_drawbar_performance_selected_summary_block_archive select * from staging2.dbstd_test_drawbar_performance_selected_summary_block; insert into archive.dbstd_test_engine_rpm_engine_to_pto_block_archive select * from staging2.dbstd_test_engine_rpm_engine_to_pto_block; @@ -108,6 +116,8 @@ insert into archive.dbstd_test_transmission_fuel_lubricant_block_archive select insert into archive.dbstd_test_transmission_speed_chart_block_archive select * from staging2.dbstd_test_transmission_speed_chart_block; insert into archive.dbstd_test_transmission_speed_chart_desc_block_archive select * from staging2.dbstd_test_transmission_speed_chart_desc_block; insert into archive.dbstd_test_transmission_wheels_block_archive select * from staging2.dbstd_test_transmission_wheels_block; + +elsif __file_mnemonic = 'FTDRY' then insert into archive.ftdry_sum_comments_by_block_archive select * from staging2.ftdry_sum_comments_by_block; insert into archive.ftdry_sum_implement_block_archive select * from staging2.ftdry_sum_implement_block; insert into archive.ftdry_sum_test_condition_1_block_archive select * from staging2.ftdry_sum_test_condition_1_block; @@ -117,6 +127,8 @@ insert into archive.ftdry_trs_engine_rpm_block_archive select * from staging2.ft insert into archive.ftdry_trs_h1_block_archive select * from staging2.ftdry_trs_h1_block; insert into archive.ftdry_trs_implement_block_archive select * from staging2.ftdry_trs_implement_block; insert into archive.ftdry_trs_spec_block_archive select * from staging2.ftdry_trs_spec_block; + +elsif __file_mnemonic = 'FTHLG' then insert into archive.fthlg_sum_comments_by_block_archive select * from staging2.fthlg_sum_comments_by_block; insert into archive.fthlg_sum_test_condition_1_block_archive select * from staging2.fthlg_sum_test_condition_1_block; insert into archive.fthlg_sum_test_condition_2_block_archive select * from staging2.fthlg_sum_test_condition_2_block; @@ -126,6 +138,8 @@ insert into archive.fthlg_trs_engine_rpm_block_archive select * from staging2.ft insert into archive.fthlg_trs_h1_block_archive select * from staging2.fthlg_trs_h1_block; insert into archive.fthlg_trs_spec_block_archive select * from staging2.fthlg_trs_spec_block; insert into archive.fthlg_trs_trailer_block_archive select * from staging2.fthlg_trs_trailer_block; + +elsif __file_mnemonic = 'FTWET' then insert into archive.ftwet_sum_cage_wheel_block_archive select * from staging2.ftwet_sum_cage_wheel_block; insert into archive.ftwet_sum_comments_by_block_archive select * from staging2.ftwet_sum_comments_by_block; insert into archive.ftwet_sum_implement_block_archive select * from staging2.ftwet_sum_implement_block; @@ -135,6 +149,9 @@ insert into archive.ftwet_trs_engine_rpm_block_archive select * from staging2.ft insert into archive.ftwet_trs_h1_block_archive select * from staging2.ftwet_trs_h1_block; insert into archive.ftwet_trs_implement_block_archive select * from staging2.ftwet_trs_implement_block; insert into archive.ftwet_trs_spec_block_archive select * from staging2.ftwet_trs_spec_block; + + +elsif __file_mnemonic = 'IHTBT30' then insert into archive.ihtbt30_bt30_footer_block_archive select * from staging2.ihtbt30_bt30_footer_block; insert into archive.ihtbt30_bt30_h1_block_archive select * from staging2.ihtbt30_bt30_h1_block; insert into archive.ihtbt30_bt30_test_condition_block_archive select * from staging2.ihtbt30_bt30_test_condition_block; @@ -144,6 +161,8 @@ insert into archive.ihtbt30_bt30_test_res_3_block_archive select * from staging2 insert into archive.ihtbt30_bt30_test_res_4_block_archive select * from staging2.ihtbt30_bt30_test_res_4_block; insert into archive.ihtbt30_bt30_tyre_details_block_archive select * from staging2.ihtbt30_bt30_tyre_details_block; insert into archive.ihtbt30_bt30_weight_block_archive select * from staging2.ihtbt30_bt30_weight_block; + +elsif __file_mnemonic = 'IHTBT50' then insert into archive.ihtbt50_bt50_footer_block_archive select * from staging2.ihtbt50_bt50_footer_block; insert into archive.ihtbt50_bt50_h1_block_archive select * from staging2.ihtbt50_bt50_h1_block; insert into archive.ihtbt50_bt50_test_condition_block_archive select * from staging2.ihtbt50_bt50_test_condition_block; @@ -153,6 +172,9 @@ insert into archive.ihtbt50_bt50_test_res_3_block_archive select * from staging2 insert into archive.ihtbt50_bt50_test_res_4_block_archive select * from staging2.ihtbt50_bt50_test_res_4_block; insert into archive.ihtbt50_bt50_tyre_details_block_archive select * from staging2.ihtbt50_bt50_tyre_details_block; insert into archive.ihtbt50_bt50_weight_block_archive select * from staging2.ihtbt50_bt50_weight_block; + + +elsif __file_mnemonic = 'IHTBTD' then insert into archive.ihtbtd_btd_footer_block_archive select * from staging2.ihtbtd_btd_footer_block; insert into archive.ihtbtd_btd_h1_block_archive select * from staging2.ihtbtd_btd_h1_block; insert into archive.ihtbtd_btd_test_condition_block_archive select * from staging2.ihtbtd_btd_test_condition_block; @@ -164,6 +186,8 @@ insert into archive.ihtbtd_btd_test_res_5_block_archive select * from staging2.i insert into archive.ihtbtd_btd_test_res_6_block_archive select * from staging2.ihtbtd_btd_test_res_6_block; insert into archive.ihtbtd_btd_tyre_details_block_archive select * from staging2.ihtbtd_btd_tyre_details_block; insert into archive.ihtbtd_btd_weight_block_archive select * from staging2.ihtbtd_btd_weight_block; + +elsif __file_mnemonic = 'IHTCGM' then insert into archive.ihtcgm_cgm_footer_block_archive select * from staging2.ihtcgm_cgm_footer_block; insert into archive.ihtcgm_cgm_h1_block_archive select * from staging2.ihtcgm_cgm_h1_block; insert into archive.ihtcgm_cgm_lifting_block_archive select * from staging2.ihtcgm_cgm_lifting_block; @@ -171,6 +195,8 @@ insert into archive.ihtcgm_cgm_results_block_archive select * from staging2.ihtc insert into archive.ihtcgm_cgm_tyre_details_block_archive select * from staging2.ihtcgm_cgm_tyre_details_block; insert into archive.ihtcgm_cgm_weight_block_archive select * from staging2.ihtcgm_cgm_weight_block; insert into archive.ihtcgm_cgm_wheel_block_archive select * from staging2.ihtcgm_cgm_wheel_block; + +elsif __file_mnemonic = 'IHTEMT' then insert into archive.ihtemt_emt_brake_pedal_block_archive select * from staging2.ihtemt_emt_brake_pedal_block; insert into archive.ihtemt_emt_footer_block_archive select * from staging2.ihtemt_emt_footer_block; insert into archive.ihtemt_emt_h1_block_archive select * from staging2.ihtemt_emt_h1_block; @@ -180,6 +206,8 @@ insert into archive.ihtemt_emt_tyre_details_block_archive select * from staging2 insert into archive.ihtemt_emt_weight_block_archive select * from staging2.ihtemt_emt_weight_block; insert into archive.ihtemt_emt_wheel_block_archive select * from staging2.ihtemt_emt_wheel_block; insert into archive.ihtemt_std_raw_data_block_archive select * from staging2.ihtemt_std_raw_data_block; + +elsif __file_mnemonic = 'IHTHAM' then insert into archive.ihtham_ham_atmos_cond_block_archive select * from staging2.ihtham_ham_atmos_cond_block; insert into archive.ihtham_ham_drawbar_block_archive select * from staging2.ihtham_ham_drawbar_block; insert into archive.ihtham_ham_engine_rpm_block_archive select * from staging2.ihtham_ham_engine_rpm_block; @@ -189,12 +217,16 @@ insert into archive.ihtham_ham_results_block_archive select * from staging2.ihth insert into archive.ihtham_ham_tractor_block_archive select * from staging2.ihtham_ham_tractor_block; insert into archive.ihtham_ham_tyre_details_block_archive select * from staging2.ihtham_ham_tyre_details_block; insert into archive.ihtham_ham_weight_block_archive select * from staging2.ihtham_ham_weight_block; + +elsif __file_mnemonic = 'IHTHLS' then insert into archive.ihthls_hls_footer_block_archive select * from staging2.ihthls_hls_footer_block; insert into archive.ihthls_hls_h1_block_archive select * from staging2.ihthls_hls_h1_block; insert into archive.ihthls_hls_numeric_block_archive select * from staging2.ihthls_hls_numeric_block; insert into archive.ihthls_hls_tyre_details_block_archive select * from staging2.ihthls_hls_tyre_details_block; insert into archive.ihthls_hls_weight_block_archive select * from staging2.ihthls_hls_weight_block; insert into archive.ihthls_hls_wheel_block_archive select * from staging2.ihthls_hls_wheel_block; + +elsif __file_mnemonic = 'IHTNST' then insert into archive.ihtnst_nst_atmos_cond_block_archive select * from staging2.ihtnst_nst_atmos_cond_block; insert into archive.ihtnst_nst_engine_rpm_block_archive select * from staging2.ihtnst_nst_engine_rpm_block; insert into archive.ihtnst_nst_footer_block_archive select * from staging2.ihtnst_nst_footer_block; @@ -204,6 +236,8 @@ insert into archive.ihtnst_nst_oel_noise_load_block_archive select * from stagin insert into archive.ihtnst_nst_stand_noise_block_archive select * from staging2.ihtnst_nst_stand_noise_block; insert into archive.ihtnst_nst_tyre_details_block_archive select * from staging2.ihtnst_nst_tyre_details_block; insert into archive.ihtnst_nst_weight_block_archive select * from staging2.ihtnst_nst_weight_block; + +elsif __file_mnemonic = 'IHTSLL' then insert into archive.ihtsll_sll_footer_block_archive select * from staging2.ihtsll_sll_footer_block; insert into archive.ihtsll_sll_forward_block_archive select * from staging2.ihtsll_sll_forward_block; insert into archive.ihtsll_sll_h1_block_archive select * from staging2.ihtsll_sll_h1_block; @@ -212,6 +246,8 @@ insert into archive.ihtsll_sll_reverse_block_archive select * from staging2.ihts insert into archive.ihtsll_sll_tyre_details_block_archive select * from staging2.ihtsll_sll_tyre_details_block; insert into archive.ihtsll_sll_weight_block_archive select * from staging2.ihtsll_sll_weight_block; insert into archive.ihtsll_sll_wheel_block_archive select * from staging2.ihtsll_sll_wheel_block; + +elsif __file_mnemonic in ('PTOBEN','PTOSTD') then insert into archive.ptoben_gvg_performance_governing_trails_block_archive select * from staging2.ptoben_gvg_performance_governing_trails_block; insert into archive.ptoben_mpm_performance_boost_natural_block_archive select * from staging2.ptoben_mpm_performance_boost_natural_block; insert into archive.ptoben_prf_2hrs_max_power_natural_ambient_block_archive select * from staging2.ptoben_prf_2hrs_max_power_natural_ambient_block; @@ -226,7 +262,7 @@ insert into archive.ptoben_prf_varying_speed_natural_ambient_block_archive selec insert into archive.ptoben_prf_varying_speed_test_high_ambient_block_archive select * from staging2.ptoben_prf_varying_speed_test_high_ambient_block; - +end if; EXCEPTION when OTHERS then GET STACKED DIAGNOSTICS err_state = returned_sqlstate, /* P0002 */ diff --git a/onetime/archive/schema/drop.sql b/onetime/archive/schema/drop.sql deleted file mode 100755 index 70bd8f9..0000000 --- a/onetime/archive/schema/drop.sql +++ /dev/null @@ -1 +0,0 @@ -drop schema if exists archive cascade; diff --git a/onetime/commonfunctions/fn_db_exception.sql b/onetime/commonfunctions/fn_db_exception.sql index b043d4a..948f86d 100755 --- a/onetime/commonfunctions/fn_db_exception.sql +++ b/onetime/commonfunctions/fn_db_exception.sql @@ -53,9 +53,12 @@ SQL statement "select staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',100)" PL/pgSQL function trx.fn_get_function_exception(character varying) line 36 at EXECUTE */ if v_function_name like '%Block%' then -perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,v_function_name,'stg2', null, err_state, err_msg, err_detail, err_hint, err_context,'error'); +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', v_function_name, err_state, err_msg, err_detail, err_hint, err_context,'error'); +elsif v_function_name like '%ods%' then +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', v_function_name, err_state, err_msg, err_detail, err_hint, err_context,'error'); else -perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,v_function_name,'trx', null, err_state, err_msg, err_detail, err_hint, err_context,'error'); +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', v_function_name, err_state, err_msg, err_detail, err_hint, err_context,'error'); + end if; END; $function$ \ No newline at end of file diff --git a/onetime/commonfunctions/fn_fw_ods_misnomer_load.sql b/onetime/commonfunctions/fn_fw_ods_misnomer_load.sql old mode 100644 new mode 100755 diff --git a/onetime/commonfunctions/fn_fw_ods_tractor_info_load.sql b/onetime/commonfunctions/fn_fw_ods_tractor_info_load.sql old mode 100644 new mode 100755 index dd584c2..444fdb9 --- a/onetime/commonfunctions/fn_fw_ods_tractor_info_load.sql +++ b/onetime/commonfunctions/fn_fw_ods_tractor_info_load.sql @@ -1,208 +1,254 @@ -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(1, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Boost mode', 'M_Star', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(2, 'FTWET', 'Mahindra', 'BSIII A_MSTAR 57HP 4WD', 'M_Star', 57, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(3, 'FTHLG', 'Mahindra', 'MAM-Liecense', 'Small Tractors', 36, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(4, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev- A10)', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(5, 'DBSTD', 'Mahindra', 'Dhruv 575 4WD', 'Dhruv', 45, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(6, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Normal mode', 'M_Star', 57, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(7, 'BUDNI', 'John Deere', '3028EN', 'NA', 28, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(8, 'FTDRY', 'Mahindra', 'Yuvo Star 47 HP', 'Dhruv', 47, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(9, 'FTDRY', 'Mahindra', 'M-Star 65HP-2WD TremIV (Normal) -Rev-9', 'M_Star', 68, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(10, 'FTWET', 'Mahindra', 'Trem 4_MSTAR 55HP 2WD(Engine Dataset Rev. 7)Boost Mode', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(11, 'BUDNI', 'Mahindra', '605 DI i', 'PVE', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(12, 'FTHLG', 'Mahindra', 'NST REFRESH 45 HP/2WD/', 'H1', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(13, 'FTDRY', 'Mahindra', 'Dhruv CRDI 45 HP', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(14, 'FTHLG', 'Mahindra', 'Mstar 57 hp BSIII A', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(15, 'FTDRY', 'Mahindra', '265 XP Plus', 'H1', 33, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(16, 'FTDRY', 'Mahindra', 'NST Refresh 44HP 2WD', 'H1', 44, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(17, 'BUDNI', 'Mahindra', 'YUVO 415 DI', 'Dhruv', 39, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(18, 'DBSTD', 'Mahindra', '6075 4WD', 'M_Star', 73, '4WD', 'Cabin'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(19, 'FTDRY', 'Mahindra', 'M-Star 75HP-2WD (Boost) Rev 8', 'M_Star', 75, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(20, 'FTDRY', 'Mahindra', 'Dhruv 39hp Regular', 'Dhruv', 39, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(21, 'FTDRY', 'Mahindra', 'Mstar-BS-IIIA', 'M_Star', 65, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(22, 'FTHLG', 'Mahindra', 'Arjun 60HP-2WD TremIV (Boost) -Rev 8', 'H2', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(23, 'BUDNI', 'John Deere', '5050 D V7', 'NA', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(24, 'FTHLG', 'MAM', 'MAM CBU', 'Small Tractors', 36, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(25, 'DBSTD', 'Mahindra', 'Arjun 555 DI HBT', 'H2', 49, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(26, 'DBSTD', 'Mahindra', 'Mstar Trem 4 68 HP-4WD Normal mode', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(27, 'FTHLG', 'Mahindra', 'Yuvo 575', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(28, 'FTDRY', 'Mahindra', 'M-Star 75HP-4WD TremIV Rev 8 (Normal)', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(29, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Normal Mode)', 'M_Star', 65, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(30, 'FTDRY', 'Mahindra', '475DI NST-Refresh', 'H1', 44, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(31, 'FTWET', 'Mahindra', 'Trem 4_MSTAR 55HP 2WD(Engine Dataset Rev. 7) Normal Mode', 'M_Star', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(32, 'FTDRY', 'Mahindra', '475DI NST', 'M_Star', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(33, 'FTDRY', 'Mahindra', 'Arjun-BS-IIIA', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(34, 'FTDRY', 'Mahindra', 'Arjun 55HP-2WD TremIV (Normal) -Rev 7', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(35, 'DBSTD', 'Mahindra', 'H1 575DI XP Plus', 'H1', 47, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(36, 'FTDRY', 'Mahindra', 'M-Star 55HP-2WD (Normal) Rev 7', 'M_Star', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(37, 'FTDRY', 'Mahindra', '33 HP NSTR', 'H1', 33, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(38, 'DBSTD', 'Mahindra', 'Mstar 655 DI', 'M_Star', 65, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(39, 'BUDNI', 'Mahindra', 'YUVO 475 DI', 'Dhruv', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(40, 'FTDRY', 'Mahindra', 'B275 DI TU RCRPTO', 'H1', 39, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(41, 'FTWET', 'Mahindra', 'Trem 4_MSTAR 55HP 4WD(Engine Dataset Rev. 7) Normal Mode', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(42, 'FTDRY', 'Mahindra', 'Dhruv 42hp Regular', 'Dhruv', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(43, 'BUDNI', 'John Deere', '5105 V2', 'NA', 40, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(44, 'DBSTD', 'Mahindra', 'Dhruv 585 DI 4WD', 'Dhruv', 50, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(45, 'FTDRY', 'Mahindra', 'M-Star 60HP 4WD (Normal) REV 17B', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(46, 'FTDRY', 'Mahindra', 'Arjun 60HP-2WD TremIV (Normal) -Rev 8', 'H2', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(47, 'FTHLG', 'Mahindra', 'Yuvo Star', 'Dhruv', 47, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(48, 'FTDRY', 'Mahindra', 'Mstar-BS-IIIA', 'M_Star', 65, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(49, 'FTDRY', 'Mahindra', 'Yuvo 585', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(50, 'FTDRY', 'Mahindra', 'Arjun-Trem-IV (Rev- A10)', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(51, 'FTDRY', 'Mahindra', 'M-Star 55HP-4WD Inline', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(52, 'FTDRY', 'Mahindra', 'M-Star 75HP-4WD TremIV Rev 8 (Boost)', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(53, 'DBSTD', 'Mahindra', 'Arjun Trem 4 55 HP-2WD Boost', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(54, 'FTDRY', 'Mahindra', 'Dhruv 49.96HP P2', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(55, 'FTDRY', 'Mahindra', 'Mstar Alternate Approach', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(56, 'FTDRY', 'Mahindra', 'NOVO Add on Cabin', 'M_Star', 57, '2WD', 'Cabin'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(57, 'FTDRY', 'Mahindra', 'Arjun 60HP-2WD TremIV (Boost) -Rev 8', 'H2', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(58, 'FTHLG', 'Mahindra', 'Arjun 555 DI 49.9 HP HBTU Non CRPTO', 'H2', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(59, 'FTDRY', 'Mahindra', 'Arjun-Trem-IV (Rev- 7)', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(60, 'FTDRY', 'Mahindra', 'Arjun 57HP-2WD Inline', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(61, 'FTWET', 'Mahindra', 'Yuvo STAR 42HP HCE', 'Dhruv', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(62, 'FTDRY', 'MAM', 'MAM-CBU', 'Small Tractors', 36, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(63, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev-D15T)', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(64, 'BUDNI', 'Mahindra', 'JIVO 365 DI P', 'Small Tractors', 36, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(65, 'FTWET', 'Mahindra', 'DHRUV 42HP', 'Dhruv', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(66, 'FTDRY', 'Mahindra', 'Dhruv 39hp HCE', 'Dhruv', 39, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(67, 'DBSTD', 'Mahindra', 'Mstar Trem 4 68 HP-4WD Boost mode', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(68, 'FTDRY', 'Mahindra', 'Yuvraj NXT 28 HP', 'Small Tractors', 28, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(69, 'IHTNST', 'Mahindra', '265 DI SP Plus(NST-33hp)', 'H1', 33, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(70, 'FTHLG', 'Mahindra', 'Arjun 605 DI 57 HP', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(71, 'PTOSTD', 'Mahindra', 'Dhruv 31 hp', 'Dhruv', 31, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(72, 'FTDRY', 'Mahindra', 'M-Star 60HP 4WD (Boost) REV 17B', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(73, 'BUDNI', 'New Holland', '5500 TS 12+3 UG', 'NA', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(74, 'DBSTD', 'Mahindra', 'Arjun Trem 4 55 HP-2WD Normal mode', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(75, 'IHTSLL', 'Mahindra', 'K2- 4WD HST ', 'K2', 26, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(76, 'FTDRY', 'Mahindra', 'NST Refresh 42HP 2WD', 'H1', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(77, 'DBSTD', 'Mahindra', 'Mstar Trem 4 55 HP-2WD', 'M_Star', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(78, 'FTDRY', 'John Deere', 'JD 5050D V7', 'NA', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(79, 'FTDRY', 'Mahindra', 'Mstar 57 hp BSIII A', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(80, 'DBSTD', 'Mahindra', 'Mstar Trem 4 68 HP-4WD Eco mode', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(81, 'FTDRY', 'John Deere', 'John Deere 3036EN', 'NA', 36, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(82, 'FTDRY', 'Mahindra', 'Arjun-Trem-IV (Rev-B17)', 'H2', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(83, 'FTHLG', 'Mahindra', 'Arjun 55HP-2WD TremIV (Boost) -Rev 7', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(84, 'FTDRY', 'Mahindra', 'Yuvo star 44HP/2WD', 'Dhruv', 44, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(85, 'FTDRY', 'Mahindra', 'M-Star 75HP-4WD Inline', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(86, 'FTHLG', 'Mahindra', 'Arjun 55HP-2WD TremIV (Normal) -Rev 7', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(87, 'FTDRY', 'Mahindra', 'Mstar-BS-IIIA', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(88, 'FTDRY', 'Mahindra', 'Arjun-Trem-IV (Rev-8)', 'H2', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(89, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Boost Mode)', 'M_Star', 65, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(90, 'FTWET', 'Mahindra', 'DHRUV P2', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(91, 'FTDRY', 'Mahindra', 'Y NXT 28 HP', 'Small Tractors', 28, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(92, 'IHTHAM', 'Mahindra', 'Mstar P2 75HP 4WD', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(93, 'FTDRY', 'Mahindra', 'Arjun 555 HBTU', 'H2', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(94, 'BUDNI', 'John Deere', '5310 V5', 'NA', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(95, 'FTDRY', 'Mahindra', 'NST Refresh 47HP 2WD', 'H1', 47, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(96, 'IHTHLS', 'Mahindra', 'Dhruv export 55hp', 'Dhruv', 55, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(97, 'FTDRY', 'Mahindra', 'Mstar-BS-IIIA', 'M_Star', 57, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(98, 'DBSTD', 'Mahindra', 'H1 275DI XP PLUS', 'H1', 44, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(99, 'FTHLG', 'Mahindra', 'Yuvo 585', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(100, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Boost mode', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(101, 'FTDRY', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Normal) Rev C12', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(102, 'FTDRY', 'Mahindra', 'Arjun 605 Trem 4 Alternate Approach', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(103, 'FTDRY', 'Mahindra', 'Yuvo Star 49.3 HP', 'Dhruv', 49, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(104, 'FTDRY', 'Mahindra', 'M-Star 55HP-2WD', 'M_Star', 52, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(105, 'BUDNI', 'Mahindra', 'ARJUN 605 DI V2', 'M_Star', 56, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(106, 'FTWET', 'Mahindra', 'DHRUV P2 49.96HP', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(107, 'FTDRY', 'Mahindra', 'Arjun 555 HBTU + RCRPTO', 'H2', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(108, 'FTDRY', 'Mahindra', 'M-Star 60HP 4WD (Boost ) REV 8', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(109, 'FTHLG', 'John Deere', '5050 D V7', 'NA', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(110, 'IHTBT50', 'Mahindra', 'Mstar 8100 CAB', 'M_Star', 95, NULL, 'Cabin'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(111, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Normal mode', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(112, 'FTDRY', 'Mahindra', 'M-Star 65HP-2WD Inline', 'M_Star', 65, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(113, 'DBSTD', 'Mahindra', 'Yuvo 585 DI 2WD SLIPTO', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(114, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Boost Mode)', 'M_Star', 65, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(115, 'FTHLG', 'Mahindra', 'Arjun Alternate Approach', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(116, 'IHTEMT', 'Mahindra', 'JIVO LOW PROFILE', 'Small Tractors', 24, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(117, 'BUDNI', 'Mahindra', '605 DI PS', 'PVE', 52, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(118, 'FTHLG', 'Kubota', 'Kubota L3408', 'NA', 34, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(119, 'FTDRY', 'Mahindra', 'Y-NXT E-Governing OFF', 'Small Tractors', 24, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(120, 'FTDRY', 'Mahindra', '415 DI RCRPTO', 'H1', 39, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(121, 'FTDRY', 'Mahindra', 'Dhruv 42hp HCE', 'Dhruv', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(122, 'FTHLG', 'Mahindra', 'Mstar 60Hp Trem IV +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 65HP-2WD TremIV (Normal) +Rev-9', 68, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', 'JD 5050D V7', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo 575 45 HP', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 60HP 4WD (Boost ) REV 8', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Normal Mode)', 65, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem 4 55 HP-2WD Normal mode', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev-D15T)', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'H1 575DI XP Plus', 47, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YuvoStar 33Hp', 33, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'TAFE', 'MF 241 DI Planetary Plus V1', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Boost Mode)', 65, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'PVE', 'Mahindra', '605 DI PS', 52, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'Y-NXT E-Governing ON', 24, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 60Hp Trem IV (Boost mode) -Rev 8', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(123, 'DBSTD', 'Mahindra', 'ARJUN 555 DI', 'H2', 50, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(124, 'BUDNI', 'TAFE', 'MF 241 DI Planetary Plus V1', 'NA', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(125, 'FTDRY', 'Kubota', 'Kubota L-3408', 'NA', 34, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(126, 'FTDRY', 'Mahindra', 'M Star 65HP 4WD Inline', 'M_Star', 65, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(127, 'FTDRY', 'Mahindra', '265 DI MKM', 'H1', 30, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(128, 'DBSTD', 'Mahindra', 'Arjun Trem 4 55 HP-2WD Eco mode', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(129, 'FTDRY', 'Mahindra', 'M-Star 55HP-4WD TremIV Rev 7 Data (Boost)', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(130, 'BUDNI', 'Mahindra', 'JIVO 245 DI', 'Small Tractors', 24, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(131, 'FTDRY', 'Mahindra', 'NOVO Non AC Add on Cabin', 'M_Star', 57, '2WD', 'Cabin'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(132, 'BUDNI', 'Mahindra', 'YUVO 575 DI', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(133, 'PTOSTD', 'Mahindra', 'Dhruv 31 hp', 'Dhruv', 31, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(134, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 7)', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(135, 'FTDRY', 'Mahindra', 'Arjun 55HP-2WD TremIV (Boost) -Rev 7', 'H2', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(136, 'FTDRY', 'Mahindra', 'Mstar-BS-IIIA', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(137, 'FTDRY', 'Kubota', 'Kubota B2741', 'NA', 27, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(138, 'FTHLG', 'Mahindra', 'Mstar 57Hp BSIII A', 'M_Star', 57, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(139, 'FTDRY', 'Mahindra', 'Arjun 605 DI 57 HP', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(140, 'FTDRY', 'Mahindra', 'Y-NXT E-Governing ON', 'Small Tractors', 24, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(141, 'DBSTD', 'Mahindra', 'YUVO 575 DI SLIPTO 2WD', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(142, 'BUDNI', 'John Deere', '5039C PC V3', 'NA', 39, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(143, 'FTDRY', 'Mahindra', 'M-Star 75HP-2WD', 'M_Star', 75, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(144, 'FTHLG', 'MAM', 'MAM license(Paddy variant)', 'Small Tractors', 36, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(145, 'FTHLG', 'Mahindra', 'NST REFRESH 47 HP/2WD/', 'H1', 47, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(146, 'FTDRY', 'Mahindra', 'M-Star 75HP-2WD (Normal) Rev 8', 'M_Star', 75, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(147, 'FTWET', 'Mahindra', 'Trem 4_MSTAR 55HP 4WD(Engine Dataset Rev. 7)Boost Mode', 'M_Star', 57, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(148, 'FTHLG', 'Mahindra', 'Mstar Alternate Approach', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(149, 'FTDRY', 'John Deere', 'John Deere 3028', 'NA', 28, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(150, 'BUDNI', 'Kubota', 'Kubota B2741', 'NA', 27, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(151, 'FTDRY', 'Mahindra', 'M-Star 55HP-2WD (Boost) Rev A10', 'M_Star', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(152, 'FTHLG', 'Mahindra', 'Arjun 555 DI 49.9 HP HBTU + RCRPTO', 'H2', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(153, 'FTDRY', 'Mahindra', 'M-Star 60HP 4WD (Normal ) REV 8', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(154, 'FTDRY', 'Mahindra', 'M-Star 75HP-2WD (Boost) Rev D15T', 'M_Star', 75, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(155, 'IHTBT30', 'Mahindra', 'K2 26 HP 4WD ', 'K2', 26, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(156, 'FTWET', 'John Deere', 'John Deere', 'NA', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(157, 'FTDRY', 'Mahindra', 'Yuvo 575 Regular - 45HP', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(158, 'FTDRY', 'Mahindra', 'Yuvo 575 45 HP', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(159, 'FTDRY', 'Mahindra', 'M Star 60HP Inline', 'M_Star', 57, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(160, 'FTWET', 'Mahindra', 'Yuvo STAR 49.96HP', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(161, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Normal Mode)', 'M_Star', 65, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(162, 'FTDRY', 'Mahindra', 'Dhruv INLINE 45HP', 'Dhruv', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(163, 'FTDRY', 'Mahindra', 'Yuvraj NXT regular', 'Small Tractors', 24, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(164, 'FTDRY', 'Mahindra', 'NST Refresh 45HP 2WD', 'H1', 45, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(165, 'FTDRY', 'Mahindra', 'Dhruv 585 Engine on Arjun 555 tractor 49.9 hp + NCRPTO', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(166, 'FTDRY', 'Mahindra', 'M-Star 55HP-2WD (Normal) Rev A10', 'M_Star', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(167, 'FTWET', 'Mahindra', 'BSIII A_MSTAR 57HP 2WD', 'M_Star', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(168, 'FTDRY', 'Mahindra', 'MAM-Liecense', 'Small Tractors', 36, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(169, 'FTDRY', 'Mahindra', 'Dhruv 49.96hp', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(170, 'FTDRY', 'Mahindra', 'M-Star 75HP-2WD (Normal) Rev D15T', 'M_Star', 75, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(171, 'FTDRY', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Boost ) Rev C12', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(172, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev-8)', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(173, 'FTDRY', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Normal) Rev 9', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(174, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV(Rev-17B)', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(175, 'FTDRY', 'Mahindra', 'Mstar-BS-IIIA', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(176, 'IHTBTD', 'Mahindra', 'Dhruv 575 DI MAT 45hp', 'Dhruv', 45, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(177, 'FTWET', 'Mahindra', 'Yuvo STAR 42HP HCE PS', 'Dhruv', 42, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(178, 'FTDRY', 'Mahindra', 'Arjun 555 49.96 HP + NCRPTO', 'H2', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(179, 'FTHLG', 'Mahindra', 'Dhruv 585 Engine on Arjun 555 tractor 49.9 hp + NCRPTO', 'Dhruv', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(180, 'FTDRY', 'Mahindra', 'M-Star 55HP-4WD TremIV Rev 7 Data (Normal)', 'M_Star', 55, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(181, 'FTDRY', 'Mahindra', 'Arjun 605 BS 3A', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(182, 'FTHLG', 'Mahindra', 'Arjun 555 49.96 HP + NCRPTO', 'H2', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(183, 'FTHLG', 'MAM', 'MAM-CBU', 'Small Tractors', 36, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(184, 'FTHLG', 'Mahindra', 'Arjun 60HP-2WD TremIV (Normal) -Rev 8', 'H2', 60, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(185, 'PTOBEN', 'Mahindra', 'M-Star 55 Hp', 'M_Star', 55, NULL, 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(186, 'FTDRY', 'Mahindra', 'M-Star 65HP-2WD TremIV (Boost) -Rev-9', 'M_Star', 68, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(187, 'FTDRY', 'John Deere', '5050 D V7', 'NA', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(188, 'FTWET', 'John Deere', 'JD5050D', 'NA', 50, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(189, 'FTHLG', 'Mahindra', 'Mstar 60Hp Trem IV (Normal Mode) Rev 8', 'M_Star', 60, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(190, 'BUDNI', 'John Deere', '5042 D V3', 'NA', 44, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(191, 'FTHLG', 'Mahindra', 'Arjun 57HP-2WD Inline', 'H2', 57, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(192, 'FTDRY', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Boost ) Rev 9', 'M_Star', 68, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(193, 'FTDRY', 'Mahindra', 'YuvoStar 33Hp', 'Dhruv', 33, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(194, 'FTDRY', 'Mahindra', 'M-Star 55HP-2WD (Boost) Rev 7', 'M_Star', 55, '2WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(195, 'FTDRY', 'Mahindra', 'Mstar-Trem-IV (Rev-8)', 'M_Star', 75, '4WD', 'Open station'); -INSERT INTO fw_ods.tractor_info ("#", test_file_mnemonic, tractor_make, tractor_model, platform, tractor_engine_hp, wheel_drive_type, "configuration") VALUES(196, 'FTDRY', 'Mahindra', 'Yuvo star 44HP', 'Dhruv', 44, '2WD', 'Open station'); +Rev 8', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem 4 55 HP-2WD Eco mode', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun-Trem-IV (Rev-B17)', 60, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar P2 75HP 4WD', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'NOVO Non AC Add on Cabin', 57, '2WD', 'Cabin', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 65HP-2WD TremIV (Boost) +Rev-9', 68, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-2WD', 52, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '265 DI SP Plus(NST-33hp)', 33, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv INLINE 45HP', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Normal) Rev C12', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Normal Mode)', 65, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'ARJUN 555 DI', 50, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', '5105 V2', 40, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', '5050 D V7', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV(Rev-17B)', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Boost ) Rev C12', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo star 44HP/2WD', 44, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 605 DI 57 HP', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Normal) Rev 9', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar Trem 4 55 HP-2WD', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 60HP 4WD (Normal ) REV 8', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 42hp Regular', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-2WD (Boost) Rev 7', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'Y NXT 28 HP', 28, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo STAR 42HP HCE PS', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo STAR 42HP HCE', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-BS-IIIA', 65, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', 'John Deere 3036EN', 36, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Trem 4_MSTAR 55HP 2WD(Engine Dataset Rev. 7) Normal Mode', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Trem 4_MSTAR 55HP 2WD(Engine Dataset Rev. 7)Boost Mode', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-BS-IIIA', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 585 DI 4WD', 50, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 575 4WD', 45, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 555 49.96 HP + NCRPTO', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'DHRUV 42HP', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-BS-IIIA', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 49.96hp', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '265 DI MKM', 30, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Normal mode', 57, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-BS-IIIA', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 57Hp BSIII A', 57, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun-Trem-IV (Rev- A10)', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 8100 CAB', 95, NULL, 'Cabin', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'H1 275DI XP PLUS', 44, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'Yuvraj NXT regular', 24, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star 60HP Inline', 57, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-2WD', 75, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', '5310 V5', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 31 hp', 31, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'Y-NXT E-Governing OFF', 24, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 65HP-2WD Inline', 65, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-4WD Inline', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'MAM', 'MAM-CBU', 36, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo star 44HP', 44, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'BSIII A_MSTAR 57HP 2WD', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'Kubota', 'Kubota L-3408', 34, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-2WD (Normal) Rev D15T', 75, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', '6075 4WD', 73, '4WD', 'Cabin', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo 585', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Alternate Approach', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv CRDI 45 HP', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 605 Trem 4 Alternate Approach', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'BSIII A_MSTAR 57HP 4WD', 57, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Boost mode', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo 575 Regular - 45HP', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO 415 DI', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'Yuvraj NXT 28 HP', 28, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 60HP-2WD TremIV (Boost) +Rev 8', 60, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', '5039C PC V3', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv export 55hp', 55, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-4WD TremIV Rev 7 Data (Boost)', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar Alternate Approach', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO 475 DI', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'NOVO Add on Cabin', 57, '2WD', 'Cabin', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-2WD (Boost) Rev A10', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star 65HP 4WD Inline', 65, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Boost mode', 60, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 55HP-2WD TremIV (Normal) +Rev 7', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 55HP-2WD TremIV (Boost) +Rev 7', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 60HP-2WD TremIV (Normal) +Rev 8', 60, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev-8)', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo 585 DI 2WD SLIPTO', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 49.96HP P2', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 8)- Normal mode', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 555 DI HBT', 49, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar Trem 4 68 HP-4WD Eco mode', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Trem 4_MSTAR 55HP 4WD(Engine Dataset Rev. 7)Boost Mode', 57, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO 365 DI P', 36, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'MAM', 'MAM license(Paddy variant)', 36, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 655 DI', 65, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 57 hp BSIII A', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'NST REFRESH 47 HP/2WD/', 47, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo Star 49.3 HP', 49, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev- A10)', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 31 hp', 31, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'NST Refresh 47HP 2WD', 47, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-BS-IIIA', 65, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-2WD (Normal) Rev 8', 75, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev-8)', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 60HP 4WD (Boost) REV 17B', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-4WD Inline', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-2WD (Boost) Rev 8', 75, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star Trem IV 65 HP 4 WD ( Boost ) Rev 9', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'Kubota', 'Kubota B2741', 27, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 57HP-2WD Inline', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 575 DI MAT 45hp', 45, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo STAR 49.96HP', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '415 DI RCRPTO', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'MAM-Liecense', 36, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 9) (Boost Mode)', 65, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 39hp Regular', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-2WD (Normal) Rev A10', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 39hp HCE', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-2WD (Normal) Rev 7', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-2WD (Boost) Rev D15T', 75, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun-BS-IIIA', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'ARJUN 605 DI V2', 56, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-4WD TremIV Rev 8 (Normal)', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar Trem 4 68 HP-4WD Boost mode', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 555 DI 49.9 HP HBTU Non CRPTO', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 585 Engine on Arjun 555 tractor 49.9 hp + NCRPTO', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo Star 47 HP', 47, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 60Hp Trem IV (Normal Mode) Rev 8', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', '5042 D V3', 44, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', 'John Deere', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 555 HBTU + RCRPTO', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', '475DI NST', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'PVE', 'Mahindra', '605 DI i', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55 Hp', 55, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'NST Refresh 45HP 2WD', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO 575 DI SLIPTO 2WD', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 75HP-4WD TremIV Rev 8 (Boost)', 75, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 605 BS 3A', 57, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar Trem 4 68 HP-4WD Normal mode', 68, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem 4 55 HP-2WD Boost', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'NST REFRESH 45 HP/2WD/', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Trem 4_MSTAR 55HP 4WD(Engine Dataset Rev. 7) Normal Mode', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO 245 DI', 24, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun-Trem-IV (Rev- 7)', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', '3028EN', 28, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'New Holland', '5500 TS 12+3 UG', 55, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'NST Refresh 44HP 2WD', 44, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'NST Refresh 42HP 2WD', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', 'John Deere 3028', 28, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '475DI NST-Refresh', 44, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 555 HBTU', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO LOW PROFILE', 24, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'B275 DI TU RCRPTO', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '33 HP NSTR', 33, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 55HP-4WD TremIV Rev 7 Data (Normal)', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'DHRUV P2', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun-Trem-IV (Rev-8)', 60, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 555 DI 49.9 HP HBTU + RCRPTO', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 7)', 55, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-BS-IIIA', 57, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO 575 DI', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'Kubota', 'Kubota L3408', 34, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'DHRUV P2 49.96HP', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo 575', 45, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 42hp HCE', 42, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 60HP 4WD (Normal) REV 17B', 60, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'NA', 'John Deere', 'JD5050D', 50, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo Star', 47, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'MAM', 'MAM CBU', 36, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '265 XP Plus', 33, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun BS3A_57HP', 57, '2WD', 'Open station', 'postgres', '2021-08-17 15:59:36.816', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv - 45Hp (TouroTransmission)', 45, '2WD', 'Open station', 'postgres', '2021-08-17 11:05:50.997', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 42 Hp (2WD)', 42, '2WD', 'Open station', 'postgres', '2021-08-17 15:58:04.678', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M-Star', 'Mahindra', 'M-Star 55 Hp Trem IV', 55, '2WD', 'Open station', 'postgres', '2021-08-17 15:55:41.229', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem IV_55HP(Engine Dataset -A10) Normal Mode', 55, '2WD', 'Open station', 'postgres', '2021-08-17 16:01:31.585', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star P-II 75HP 2WD', 75, '2WD', 'Open station', 'postgres', '2021-08-17 16:02:25.785', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem IV_60HP(Engine Dataset -B17) Boost Mode', 60, '2WD', 'Open station', 'postgres', '2021-08-17 16:03:22.577', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'K2', 'Mahindra', 'K2- 4WD HST ', 26, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star Trem IV 71Hp', 71, '2WD', 'Open station', 'postgres', '2021-08-17 16:05:38.044', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 65HP-2WD TremIV (Normal)Rev-9', 65, '2WD', 'Open station', 'postgres', '2021-08-17 16:06:20.698', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 42 HP Power Steering', 42, '2WD', 'Open station', 'postgres', '2021-08-17 16:04:57.471', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 55HP-2WD TremIV (Normal)Rev 7', 55, '2WD', 'Open station', 'postgres', '2021-08-17 16:07:48.692', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_star', 'Mahindra', 'M-Star 60HP 4WD (Boost)REV 17B', 60, '4WD', 'Open station', 'postgres', '2021-08-17 16:08:31.978', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem IV_55HP(Engine Dataset -A10)Boost Mode', 55, '2WD', 'Open station', 'postgres', '2021-08-17 16:09:21.670', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 60HP-2WD TremIV (Boost)Rev 8', 60, '2WD', 'Open station', 'postgres', '2021-08-17 16:09:57.303', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun Trem IV_60HP(Engine Dataset -B17) Normal Mode', 60, '2WD', 'Open station', 'postgres', '2021-08-17 16:11:00.778', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 60HP 4WD (Normal)REV 17B', 60, '4WD', 'Open station', 'postgres', '2021-08-17 16:12:31.558', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 60Hp Trem IV (Boost mode)Rev 8', 60, '2WD', 'Open station', 'postgres', '2021-08-17 16:13:28.532', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M Star 65 hp PII 4WD', 65, '4WD', 'Open station', 'postgres', '2021-08-17 16:18:49.044', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 68 HP Trem-IV 4WD', 68, '4WD', 'Open station', 'postgres', '2021-08-17 16:29:08.077', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 60HP-2WD TremIV (Normal)Rev 8', 60, '2WD', 'Open station', 'postgres', '2021-08-17 16:29:42.949', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'M-Star 65HP-2WD TremIV (Boost)Rev-9', 65, '2WD', 'Open station', 'postgres', '2021-08-17 16:30:32.125', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 42 Hp', 42, '2WD', 'Open station', 'postgres', '2021-08-17 16:34:32.179', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 45hp ELS', 45, '2WD', 'Open station', 'postgres', '2021-08-17 16:34:32.208', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 39HP', 39, '2WD', 'Open station', 'postgres', '2021-08-17 16:34:32.235', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv CRDI 45 HP', 45, '2WD', 'Open station', 'postgres', '2021-08-17 16:34:32.322', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H2', 'Mahindra', 'Arjun 55HP-2WD TremIV (Boost)Rev 7', 55, '2WD', 'Open station', 'postgres', '2021-08-17 16:34:32.348', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 45 Hp ELS', 45, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.592', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 39 hp Domestic', 39, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.773', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 39 hp Ecoline', 39, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.953', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 45 hp ELS', 45, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.953', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv Ecoline 31 Hp-PS', 31, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.953', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 42hp', 42, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.953', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 35 hp', 35, '2WD', 'Open station', 'postgres', '2021-08-17 16:35:27.953', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YuvoStar 39hp HCE', 39, '2WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar-Trem-IV (Rev 9) ( Boost Mode)', 65, '2WD', 'Open station', 'postgres', '2021-08-17 16:34:32.153', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'K2', 'Mahindra', 'K2 26 HP 4WD ', 26, '4WD', 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'K2', 'Mahindra', 'K2', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'MAM', 'MAM license (Paddy variant)', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar 8100', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv P2', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 5055', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv 5055', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'DHRUV YUVO STAR', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO 305 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'Mstar', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'NOVO 605 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'M_Star', 'Mahindra', 'NOVO 655 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO245 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Dhruv Export', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO 585 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO STAR', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'YUVO 585 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Dhruv', 'Mahindra', 'Yuvo star', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'JIVO 255 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'Small Tractors', 'Mahindra', 'YNXT', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', 'H1 475DI XP PLUS', NULL, NULL, 'Open station', 'postgres', '2021-08-11 10:29:56.860', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, 'H1', 'Mahindra', '33hp NSTR', 33, '2WD', 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '265DI MKM', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '265 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '275 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '7580 2WD', NULL, '2WD', 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '585 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '555 DI Trem IV(Gen-1)', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '575 DI', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); +INSERT INTO fw_ods.fw_ods_tractor_model_info (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, "configuration", created_by, create_timestamp, updated_by, update_timestamp) VALUES(20, 1, NULL, NULL, '265DI XP Plus', NULL, NULL, 'Open station', 'postgres', '2021-08-17 17:20:57.903', NULL, NULL); + diff --git a/onetime/commonfunctions/fn_jobctl_block_begin.sql b/onetime/commonfunctions/fn_jobctl_block_begin.sql index 30f66bf..55bebf4 100755 --- a/onetime/commonfunctions/fn_jobctl_block_begin.sql +++ b/onetime/commonfunctions/fn_jobctl_block_begin.sql @@ -1,14 +1,15 @@ -drop function if exists fw_core.fn_jobctl_block_begin; -CREATE OR REPLACE FUNCTION fw_core.fn_jobctl_block_begin(p_client_id int,p_function_id int,p_file_syspk int,p_block_table_name text,p_file_mnemonic text,p_file_sheet_mnemonic text,p_block_seq int) - RETURNS void AS $$ -begin - -/************************* -select staging2.fn_jobctrl_block_begin(1,2,255,'block1','file','sheet',1) -***********************/ - -execute 'insert into fw_core.fw_jobctl_file_sheet_block_run_schedule -(client_id,function_id,file_syspk,block_table_name,file_mnemonic,file_sheet_mnemonic,begin_status,block_table_load_seq,start_time) - select '||p_client_id||', '||p_function_id||', '''||p_file_syspk||''','''||p_block_table_name||''','''||p_file_mnemonic||''','''||p_file_sheet_mnemonic||''',1,'||p_block_seq||',current_timestamp'; -end -$$ LANGUAGE plpgsql; +drop function if exists fw_core.fn_jobctl_block_begin; +CREATE OR REPLACE FUNCTION fw_core.fn_jobctl_block_begin(p_client_id int,p_function_id int,p_file_syspk int,p_block_table_name text,p_file_mnemonic text,p_file_sheet_mnemonic text,p_block_seq int) + RETURNS void AS $$ +begin + +/************************* +select staging2.fn_jobctrl_block_begin(1,2,255,'block1','file','sheet',1) +***********************/ + +execute 'insert into fw_core.fw_jobctl_file_sheet_block_run_schedule +(client_id,function_id,file_syspk,block_table_name,file_mnemonic,file_sheet_mnemonic,begin_status,block_table_load_seq,start_time) + select '||p_client_id||', '||p_function_id||', '''||p_file_syspk||''','''||p_block_table_name||''','''||p_file_mnemonic||''','''||p_file_sheet_mnemonic||''',''success'','||p_block_seq||',current_timestamp'; + +end +$$ LANGUAGE plpgsql; diff --git a/onetime/commonfunctions/fn_jobctl_block_end.sql b/onetime/commonfunctions/fn_jobctl_block_end.sql index eeb6d6f..ba48dfd 100755 --- a/onetime/commonfunctions/fn_jobctl_block_end.sql +++ b/onetime/commonfunctions/fn_jobctl_block_end.sql @@ -7,7 +7,7 @@ begin select staging2.fn_jobctrl_block_end(255,'block1') *********************************/ -execute 'update fw_core.fw_jobctl_file_sheet_block_run_schedule set end_status=1 , end_time=now(), end_status_note=''completed'' +execute 'update fw_core.fw_jobctl_file_sheet_block_run_schedule set end_status=''success'' , end_time=now(), end_status_note=''completed'' where file_syspk='''||p_file_syspk||'''and block_table_name='''||p_block_table_name||''''; end diff --git a/onetime/commonfunctions/fn_run_post_generic_validation.sql b/onetime/commonfunctions/fn_run_post_generic_validation.sql index 7f7c629..a731305 100755 --- a/onetime/commonfunctions/fn_run_post_generic_validation.sql +++ b/onetime/commonfunctions/fn_run_post_generic_validation.sql @@ -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 diff --git a/onetime/commonfunctions/fn_run_trx_rollback.sql b/onetime/commonfunctions/fn_run_trx_rollback.sql index a456c69..185ca86 100755 --- a/onetime/commonfunctions/fn_run_trx_rollback.sql +++ b/onetime/commonfunctions/fn_run_trx_rollback.sql @@ -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; \ No newline at end of file +$$ LANGUAGE plpgsql; diff --git a/onetime/commonfunctions/fn_run_updates.sql b/onetime/commonfunctions/fn_run_updates.sql old mode 100644 new mode 100755 index 5a5045b..9141044 --- a/onetime/commonfunctions/fn_run_updates.sql +++ b/onetime/commonfunctions/fn_run_updates.sql @@ -1,42 +1,173 @@ drop function if exists transactional.fn_run_updates; -CREATE OR REPLACE FUNCTION transactional.fn_run_updates(p_client_id int,p_function_id int) +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' ; +where file_mnemonic = 'BUDNI' +and file_syspk = p_file_syspk; update transactional.test_instance -set test_location_name = 'MRV Test Track' -where file_mnemonic in ('DBSTD', 'DBOECD'); +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 Test Track' -where file_mnemonic like 'IHT%'; +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 = 'MRV' -where file_mnemonic like 'PTO%'; +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_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_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_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; diff --git a/onetime/configentries/control-master.sql b/onetime/configentries/control-master.sql index 7e81f70..5c021a3 100755 --- a/onetime/configentries/control-master.sql +++ b/onetime/configentries/control-master.sql @@ -3,14 +3,14 @@ INSERT INTO fw_core.fw_jobctl_jobstep_master (client_id, function_id, run_frequency, job_scheduling_day, sch_day_of_month, sch_day_of_week, sch_hour_of_day, sch_minute_of_hour, job_id, step_id, job_step_run_dependency_seuqence, active_flag, job_name, step_name, job_script_type, job_step_script_name, job_fun_param_array, job_scope, job_scope_qualifier_array, sme_entering, extract_field_name, job_step_description, job_step_objective, created_by, updated_by, create_timestamp, update_timestamp) values -(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 1, 1, 9001, true, 'file_check', 'check_duplicate_files', 'shell_script', '/home/compegence/customer/MMT/sql/scripts/check_duplicate_file.sh', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 2, 1, 9002, true, 'stg1_load', 'stg1_load_to_generic_table', 'java', '/home/compegence/customer/MMT/java/generic_table/target/ex1-1.0-SNAPSHOT-shaded.jar', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 2, 2, 9003, true, 'stg1_load', 'post_stg1_load_validation', 'sql_fn', 'fw_core.fn_run_post_generic_validation', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 1, 9004, true, 'txn_load', 'run_wrapper_txn', 'sql_fn', 'fw_core.fn_run_master_wrapper', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 2, 9005, true, 'txn_load', 'txn_load_validations', 'sql_fn', 'fw_core.fn_run_trx_post_validation', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 3, 9006, true, 'roll_back', 'roll_back', 'sql_fn', 'fw_core.fn_run_trx_rollback', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 4, 1, 9007, true, 'reporting_ods_load', 'reporting_ods_load', 'sql_fn', 'fw_ods.fn_fw_ods_load', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 5, 1, 9008, true, 'file_cleanup', 'move_the_files', 'shell_script', '/home/compegence/customer/MMT/sql/scripts/file_move.sh', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) -,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 6, 1, 9009, true, 'check counts', 'check count in fw_core schema', 'sql_fn', 'fw_core.fn_run_check_count', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 1, 1, 9001, true, 'file_check', 'check_duplicate_files', 'shell_script', '/home/tdmsadmin/customer/MMT/sql/scripts/check_duplicate_file.sh', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 2, 1, 9002, true, 'stg1_load', 'stg1_load_to_generic_table', 'java', '/home/tdmsadmin/customer/MMT/java/generic_table/target/ex1-1.0-SNAPSHOT-shaded.jar', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 2, 2, 9003, true, 'stg1_load', 'post_stg1_load_validation', 'sql_fn', 'fw_core.fn_run_post_generic_validation', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 1, 9004, true, 'txn_load', 'run_wrapper_txn', 'sql_fn', 'fw_core.fn_run_master_wrapper', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 2, 9005, true, 'txn_load', 'txn_load_validations', 'sql_fn', 'fw_core.fn_run_trx_post_validation', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 4, 2, 9007, true, 'roll_back', 'roll_back', 'sql_fn', 'fw_core.fn_run_trx_rollback', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 4, 1, 9006, true, 'reporting_ods_load', 'reporting_ods_load', 'sql_fn', 'fw_ods.fn_fw_ods_load', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 5, 1, 9008, true, 'file_cleanup', 'move_the_files', 'shell_script', '/home/tdmsadmin/customer/MMT/sql/scripts/file_move.sh', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) +,(20, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 6, 1, 9009, true, 'check counts', 'check count in fw_core schema', 'sql_fn', 'fw_core.fn_run_check_count', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now()) ; diff --git a/onetime/createtables/control/control_tables.sql b/onetime/createtables/control/control_tables.sql index 93d9cf8..eb93728 100755 --- a/onetime/createtables/control/control_tables.sql +++ b/onetime/createtables/control/control_tables.sql @@ -16,6 +16,8 @@ CREATE DOMAIN fw_num_metric AS DECIMAL(12,4); CREATE DOMAIN fw_num_array AS INTEGER ARRAY; CREATE DOMAIN fw_alphnum AS TEXT; + +CREATE DOMAIN fw_alphanum AS TEXT; CREATE DOMAIN fw_text_array AS TEXT ARRAY; @@ -35,29 +37,29 @@ CREATE TABLE fw_core.fw_jobctl_jobstep_master ( syspk bigserial NOT NULL, client_id fw_core.fw_num_dimid NOT NULL, function_id fw_core.fw_num_dimid NOT NULL, - run_frequency fw_core.fw_alphnum NOT NULL, - job_scheduling_day fw_core.fw_alphnum NOT NULL, - sch_day_of_month fw_core.fw_alphnum NOT NULL, - sch_day_of_week fw_core.fw_alphnum NOT NULL, + run_frequency fw_core.fw_alphanum NOT NULL, + job_scheduling_day fw_core.fw_alphanum NOT NULL, + sch_day_of_month fw_core.fw_alphanum NOT NULL, + sch_day_of_week fw_core.fw_alphanum NOT NULL, sch_hour_of_day fw_core.fw_time NOT NULL, sch_minute_of_hour fw_core.fw_time NOT NULL, job_id fw_core.fw_num_dimid NOT NULL, step_id fw_core.fw_num_dimid NOT NULL, job_step_run_dependency_seuqence fw_core.fw_num_dimid NOT NULL, active_flag fw_core.fw_flag_bool NOT NULL DEFAULT true, - job_name fw_core.fw_alphnum NULL, - step_name fw_core.fw_alphnum NULL, - job_script_type fw_core.fw_alphnum NOT NULL, - job_step_script_name fw_core.fw_alphnum NOT NULL, + job_name fw_core.fw_alphanum NULL, + step_name fw_core.fw_alphanum NULL, + job_script_type fw_core.fw_alphanum NOT NULL, + job_step_script_name fw_core.fw_alphanum NOT NULL, job_fun_param_array fw_core.fw_text_array NULL, - job_scope fw_core.fw_alphnum NULL, + job_scope fw_core.fw_alphanum NULL, job_scope_qualifier_array fw_core.fw_text_array NULL, - sme_entering fw_core.fw_alphnum NULL, - extract_field_name fw_core.fw_alphnum NULL, - job_step_description fw_core.fw_alphnum NULL, - job_step_objective fw_core.fw_alphnum NULL, - created_by fw_core.fw_alphnum NOT NULL, - updated_by fw_core.fw_alphnum NOT NULL, + sme_entering fw_core.fw_alphanum NULL, + extract_field_name fw_core.fw_alphanum NULL, + job_step_description fw_core.fw_alphanum NULL, + job_step_objective fw_core.fw_alphanum NULL, + created_by fw_core.fw_alphanum NOT NULL, + updated_by fw_core.fw_alphanum NOT NULL, create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), CONSTRAINT fw_jobctl_jobstep_master_pkey PRIMARY KEY (syspk), @@ -72,29 +74,29 @@ CREATE TABLE fw_core.fw_jobctl_jobstep_master ( syspk bigserial NOT NULL, client_id fw_core.fw_num_dimid NOT NULL, function_id fw_core.fw_num_dimid NOT NULL, - run_frequency fw_core.fw_alphnum NOT NULL, - job_scheduling_day fw_core.fw_alphnum NOT NULL, - sch_day_of_month fw_core.fw_alphnum NOT NULL, - sch_day_of_week fw_core.fw_alphnum NOT NULL, + run_frequency fw_core.fw_alphanum NOT NULL, + job_scheduling_day fw_core.fw_alphanum NOT NULL, + sch_day_of_month fw_core.fw_alphanum NOT NULL, + sch_day_of_week fw_core.fw_alphanum NOT NULL, sch_hour_of_day fw_core.fw_time NOT NULL, sch_minute_of_hour fw_core.fw_time NOT NULL, job_id fw_core.fw_num_dimid NOT NULL, step_id fw_core.fw_num_dimid NOT NULL, job_step_run_dependency_seuqence fw_core.fw_num_dimid NOT NULL, active_flag fw_core.fw_flag_bool NOT NULL DEFAULT true, - job_name fw_core.fw_alphnum NULL, - step_name fw_core.fw_alphnum NULL, - job_script_type fw_core.fw_alphnum NOT NULL, - job_step_script_name fw_core.fw_alphnum NOT NULL, + job_name fw_core.fw_alphanum NULL, + step_name fw_core.fw_alphanum NULL, + job_script_type fw_core.fw_alphanum NOT NULL, + job_step_script_name fw_core.fw_alphanum NOT NULL, job_fun_param_array fw_core.fw_text_array NULL, - job_scope fw_core.fw_alphnum NULL, + job_scope fw_core.fw_alphanum NULL, job_scope_qualifier_array fw_core.fw_text_array NULL, - sme_entering fw_core.fw_alphnum NULL, - extract_field_name fw_core.fw_alphnum NULL, - job_step_description fw_core.fw_alphnum NULL, - job_step_objective fw_core.fw_alphnum NULL, - created_by fw_core.fw_alphnum NOT NULL, - updated_by fw_core.fw_alphnum NOT NULL, + sme_entering fw_core.fw_alphanum NULL, + extract_field_name fw_core.fw_alphanum NULL, + job_step_description fw_core.fw_alphanum NULL, + job_step_objective fw_core.fw_alphanum NULL, + created_by fw_core.fw_alphanum NOT NULL, + updated_by fw_core.fw_alphanum NOT NULL, create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), CONSTRAINT fw_jobctl_jobstep_master_pkey PRIMARY KEY (syspk), @@ -197,18 +199,18 @@ CREATE TABLE fw_core.fw_jobctl_file_sheet_runschedule ( step_id fw_core.fw_num_dimid NULL, file_syspk fw_core.fw_num_dimid NOT NULL, sheet_id fw_core.fw_num_dimid NOT NULL, - sheet_name fw_core.fw_alphnum NOT NULL, - file_mnemonic fw_core.fw_alphnum NOT NULL, - sheet_format_mnemonic fw_core.fw_alphnum NULL, - file_sheet_mnemonic fw_core.fw_alphnum NULL, + sheet_name fw_core.fw_alphanum NOT NULL, + file_mnemonic fw_core.fw_alphanum NOT NULL, + sheet_format_mnemonic fw_core.fw_alphanum NULL, + file_sheet_mnemonic fw_core.fw_alphanum NULL, staging_type fw_alphnum NULL, - begin_status fw_core.fw_alphnum NULL DEFAULT NULL, - end_status fw_core.fw_alphnum NULL DEFAULT NULL, - end_status_note fw_core.fw_alphnum NULL DEFAULT NULL, + begin_status fw_core.fw_alphanum NULL DEFAULT NULL, + end_status fw_core.fw_alphanum NULL DEFAULT NULL, + end_status_note fw_core.fw_alphanum NULL DEFAULT NULL, start_time fw_core.fw_timestamp NULL, end_time fw_core.fw_timestamp NULL, - created_by fw_core.fw_alphnum NULL, - updated_by fw_core.fw_alphnum NULL, + created_by fw_core.fw_alphanum NULL, + updated_by fw_core.fw_alphanum NULL, create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), CONSTRAINT fw_jobctrl_file_sheet_runschedule_pkey PRIMARY KEY (syspk), @@ -228,16 +230,16 @@ CREATE TABLE fw_core.fw_jobctl_file_sheet_block_run_schedule ( sheet_id fw_core.fw_num_dimid NULL, block_table_load_seq fw_core.fw_num_dimid NULL, block_table_name text NULL, - file_mnemonic fw_core.fw_alphnum NOT NULL, - sheet_format_mnemonic fw_core.fw_alphnum NULL, - file_sheet_mnemonic fw_core.fw_alphnum NOT NULL, - begin_status fw_core.fw_alphnum NULL DEFAULT NULL, - end_status fw_core.fw_alphnum NULL DEFAULT NULL, - end_status_note fw_core.fw_alphnum NULL DEFAULT NULL, + file_mnemonic fw_core.fw_alphanum NOT NULL, + sheet_format_mnemonic fw_core.fw_alphanum NULL, + file_sheet_mnemonic fw_core.fw_alphanum NOT NULL, + begin_status fw_core.fw_alphanum NULL DEFAULT NULL, + end_status fw_core.fw_alphanum NULL DEFAULT NULL, + end_status_note fw_core.fw_alphanum NULL DEFAULT NULL, start_time fw_core.fw_timestamp NULL, end_time fw_core.fw_timestamp NULL, - created_by fw_core.fw_alphnum NULL, - updated_by fw_core.fw_alphnum NULL, + created_by fw_core.fw_alphanum NULL, + updated_by fw_core.fw_alphanum NULL, create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(), CONSTRAINT fw_jobctl_file_sheet_block_run_schedule_pkey PRIMARY KEY (syspk), @@ -314,4 +316,9 @@ CREATE TABLE staging1.staging_generic_table ( column53 varchar(1024) NULL ); +CREATE INDEX i_file_syspk ON staging1.staging_generic_table USING btree (file_syspk); +CREATE INDEX i_sheet_name ON staging1.staging_generic_table USING btree (sheet_name); +CREATE INDEX i_file_mnemonic ON staging1.staging_generic_table USING btree (file_mnemonic); +CREATE INDEX i_file_sheet_mnemonic ON staging1.staging_generic_table USING btree (file_sheet_mnemonic); +CREATE INDEX i_sheet_format_mnemonic ON staging1.staging_generic_table USING btree (sheet_format_mnemonic); diff --git a/onetime/createtables/ods/create_table_fw_ods.sql b/onetime/createtables/ods/create_table_fw_ods.sql index a42f031..9d005e5 100755 --- a/onetime/createtables/ods/create_table_fw_ods.sql +++ b/onetime/createtables/ods/create_table_fw_ods.sql @@ -396,66 +396,75 @@ CREATE TABLE fw_ods.fw_ods_drawbar_performance ( drop table if exists fw_ods.fw_ods_observations; +-- fw_ods.fw_ods_observations definition + +-- Drop table + +-- DROP TABLE fw_ods.fw_ods_observations; + CREATE TABLE fw_ods.fw_ods_observations ( -syspk bigserial NOT NULL, -client_id fw_ods.fw_num_dimid NULL, -function_id fw_ods.fw_num_dimid NULL, -test_file_mnemonic fw_ods.fw_text NULL, -test_sheet_mnemonic fw_ods.fw_text NULL, -test_file_id fw_ods.fw_num_dimid NULL, -test_file_name fw_ods.fw_text NULL, -test_iteration_number fw_ods.fw_num_dimid NULL, -platform fw_ods.fw_text NULL, -benchmark_yn fw_ods.fw_text NULL, -tractor_make fw_ods.fw_text NULL, -tractor_model fw_ods.fw_text NULL, -tractor_engine_hp fw_ods.fw_num_dimid NULL, -wheel_drive_type fw_ods.fw_text NULL, -name_of_implement fw_ods.fw_text NULL, -type_of_implement fw_ods.fw_text NULL, -season fw_ods.fw_text NULL, -"configuration" fw_ods.fw_text NULL, -engine_smoke_on_load fw_ods.fw_text NULL, -engine_acceleration_smoke fw_ods.fw_text NULL, -range_gear_shifting fw_ods.fw_text NULL, -speed_gear_shifting fw_ods.fw_text NULL, -draft_response fw_ods.fw_text NULL, -tractor_steer_ability fw_ods.fw_text NULL, -tractor_braking_performance fw_ods.fw_text NULL, -front_visibility fw_ods.fw_text NULL, -implement_accessibility fw_ods.fw_text NULL, -front_wheel_dragging_at_turning fw_ods.fw_text NULL, -front_end_lifting_during_operation fw_ods.fw_text NULL, -rpm_recovery_time fw_ods.fw_text NULL, -engine_vibration fw_ods.fw_text NULL, -engine_sound fw_ods.fw_text NULL, -implement_lifing_lowering_response fw_ods.fw_text NULL, -pulverization_quality fw_ods.fw_text NULL, -pulverization_index fw_ods.fw_text NULL, -created_by fw_ods.fw_text NULL DEFAULT CURRENT_USER, -create_timestamp fw_ods.fw_timestamp NULL DEFAULT now(), -updated_by fw_ods.fw_text NULL , -update_timestamp fw_ods.fw_timestamp null -); + syspk bigserial NOT NULL, + client_id fw_ods."fw_num_dimid" NULL, + function_id fw_ods."fw_num_dimid" NULL, + test_file_mnemonic fw_ods."fw_text" NULL, + test_sheet_mnemonic fw_ods."fw_text" NULL, + test_file_id fw_ods."fw_num_dimid" NULL, + test_file_name fw_ods."fw_text" NULL, + test_iteration_number fw_ods."fw_num_dimid" NULL, + platform fw_ods."fw_text" NULL, + benchmark_yn fw_ods."fw_text" NULL, + tractor_make fw_ods."fw_text" NULL, + tractor_model fw_ods."fw_text" NULL, + tractor_engine_hp fw_ods."fw_num_dimid" NULL, + wheel_drive_type fw_ods."fw_text" NULL, + name_of_implement fw_ods."fw_text" NULL, + type_of_implement fw_ods."fw_text" NULL, + season fw_ods."fw_text" NULL, + configuration fw_ods."fw_text" NULL, + parameters fw_ods."fw_text" NULL, + "sequence" fw_ods."fw_num_dimid" NULL, + value1 fw_ods."fw_text" NULL, + value2 fw_ods."fw_text" NULL, + value3 fw_ods."fw_text" NULL, +value4 fw_ods."fw_text" NULL, + value5 fw_ods."fw_text" NULL, + display_yn fw_ods."fw_text" NULL, + created_by fw_ods."fw_text" NULL, + updated_by fw_ods."fw_text" NULL, + create_timestamp fw_ods."fw_timestamp" NULL, + update_timestamp fw_ods."fw_timestamp" NULL, + old_test_file_name fw_ods."fw_text" NULL +); +-- fw_ods.fw_ods_tractor_model_info definition --- fw_ods.tractor_info definition - DROP table if exists fw_ods.tractor_info; -CREATE TABLE fw_ods.tractor_info ( - "#" int4 NULL, - test_file_mnemonic varchar(7) NULL, - tractor_make varchar(11) NULL, - tractor_model varchar(56) NULL, - platform varchar(14) NULL, - tractor_engine_hp int4 NULL, - wheel_drive_type varchar(6) NULL, - "configuration" varchar(12) NULL +-- Drop table + +DROP TABLE if exists fw_ods.fw_ods_tractor_model_info; + +CREATE TABLE fw_ods.fw_ods_tractor_model_info ( + syspk serial NOT NULL, + client_id fw_ods."fw_num_dimid" NOT NULL, + function_id fw_ods."fw_num_dimid" NOT NULL, + platform fw_ods."fw_text" NULL, + tractor_make fw_ods."fw_text" NULL, + tractor_model fw_ods."fw_text" NULL, + tractor_engine_hp fw_ods."fw_num_dimid" NULL, + wheel_drive_type fw_ods."fw_text" NULL, + "configuration" fw_ods."fw_text" NULL, + created_by fw_ods."fw_text" NULL DEFAULT CURRENT_USER, + create_timestamp fw_ods."fw_timestamp" NULL DEFAULT now(), + updated_by fw_ods."fw_text" NULL, + update_timestamp fw_ods."fw_timestamp" NULL, + CONSTRAINT fw_ods_tractor_model_info_unique_key UNIQUE (client_id, function_id, platform, tractor_make, tractor_model, tractor_engine_hp, wheel_drive_type, configuration) ); -- fw_ods.fw_ods_misnomer definition - DROP table if exists fw_ods.fw_ods_misnomer; +-- Drop table + + DROP TABLE if exists fw_ods.fw_ods_misnomer; CREATE TABLE fw_ods.fw_ods_misnomer ( syspk int4 NOT NULL, @@ -472,6 +481,20 @@ CREATE TABLE fw_ods.fw_ods_misnomer ( ); +alter table fw_ods.fw_ods_comments +add column test_date_year fw_ods.fw_num_dimid, +add column gear_used fw_ods.fw_text , +add column speed_rpm fw_ods.fw_num_dimid; + + +alter table fw_ods.fw_ods add column fuel_consumption_ml_per_km_per_tonne fw_ods.fw_num_metric; +alter table fw_ods.fw_ods add column coordinates fw_ods.fw_num_metric; + +alter table fw_ods.fw_ods +add column vb_no_load_vd_microns fw_ods.fw_num_dimid, +add column vb_no_load_hd_microns fw_ods.fw_num_dimid, +add column vb_load_85_pct_max_pto_power_vd_microns fw_ods.fw_num_dimid, +add column vb_load_85_pct_max_pto_power_hd_microns fw_ods.fw_num_dimid; -- FTWET / FTDRY: field_perfm_ @@ -520,3 +543,29 @@ alter table fw_ods.fw_ods add column fuel_consumption_var_pct_lit_per_acr fw_ods +alter table fw_ods.fw_ods +add column tractor_hitch_ht_mm fw_ods.fw_num_metric, +add column tractor_hitch_type fw_ods.fw_text; + + + +alter table fw_ods.fw_ods add column no_of_revolution_front fw_ods.fw_num_metric; + +alter table fw_ods.fw_ods add column Lead_lag_ratio fw_ods.fw_num_metric; + +alter table fw_ods.fw_ods add column Lead_lag_pct fw_ods.fw_num_metric; + +alter table fw_ods.fw_ods add column Lead_lag_type fw_ods.fw_text; + + +alter table fw_ods.fw_ods_observations +add column test_date_year fw_ods.fw_num_dimid, +add column gear_used fw_ods.fw_text, +add column speed_rpm fw_ods.fw_num_dimid, +add column group_category fw_ods.fw_text; + + +alter table fw_ods.fw_ods_observations add column acceptance_criteria fw_ods.fw_text; +alter table fw_ods.fw_ods_observations add column remarks fw_ods.fw_text; + + diff --git a/onetime/createtables/ods/fw_ods_config_parameters.sql b/onetime/createtables/ods/fw_ods_config_parameters.sql new file mode 100755 index 0000000..19f639b --- /dev/null +++ b/onetime/createtables/ods/fw_ods_config_parameters.sql @@ -0,0 +1,79 @@ + /* the table for storing the configuration for + 1) implement operarting range details + 2) gear ordder details */ + + drop table IF exists fw_ods.fw_ods_config_parameters ; + + create table fw_ods.fw_ods_config_parameters + ( syspk serial not null, + client_id fw_ods.fw_num_dimid not null, + function_id fw_ods.fw_num_dimid not null, + param_group fw_ods.fw_text, + param_name fw_ods.fw_text, + vn1 fw_ods.fw_num_dimid, + vn2 fw_ods.fw_num_dimid, + vn3 fw_ods.fw_num_dimid, + vm1 fw_ods.fw_num_metric, + vm2 fw_ods.fw_num_metric, + vm3 fw_ods.fw_num_metric, + vt1 fw_ods.fw_text, + vt2 fw_ods.fw_text, + vt3 fw_ods.fw_text, + comments fw_ods.fw_text, + created_by fw_ods.fw_text default session_user, + create_timestamp fw_ods.fw_timestamp default now(), + updated_by fw_ods.fw_text null, + update_timestamp fw_ods.fw_timestamp null); + + + INSERT INTO fw_ods.fw_ods_config_parameters (client_id,function_id,param_group,param_name,vn1,vn2,vn3,vm1,vm2,vm3,vt1,vt2,vt3,"comments",created_by,create_timestamp,updated_by,update_timestamp) VALUES +(20,1,'Gear Order','A1',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','A2',2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','A3',3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','A4',4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','A5',5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','B1',6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','B2',7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','B3',8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','B4',9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','B5',10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +; +INSERT INTO fw_ods.fw_ods_config_parameters (client_id,function_id,param_group,param_name,vn1,vn2,vn3,vm1,vm2,vm3,vt1,vt2,vt3,"comments",created_by,create_timestamp,updated_by,update_timestamp) VALUES +(20,1,'Gear Order','C1',11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','C2',12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','C3',13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','C4',14,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','C5',15,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','D1',16,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','D2',17,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','D3',18,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','D4',19,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','D5',20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +; +INSERT INTO fw_ods.fw_ods_config_parameters (client_id,function_id,param_group,param_name,vn1,vn2,vn3,vm1,vm2,vm3,vt1,vt2,vt3,"comments",created_by,create_timestamp,updated_by,update_timestamp) VALUES +(20,1,'Gear Order','L1',21,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','L2',22,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','L3',23,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','L4',24,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','L5',25,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','M1',26,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','M2',27,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','M3',28,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','M4',29,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','M5',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +; +INSERT INTO fw_ods.fw_ods_config_parameters (client_id,function_id,param_group,param_name,vn1,vn2,vn3,vm1,vm2,vm3,vt1,vt2,vt3,"comments",created_by,create_timestamp,updated_by,update_timestamp) VALUES +(20,1,'Gear Order','H1',31,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','H2',32,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','H3',33,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','H4',34,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Gear Order','H5',35,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:09:21.695',NULL,NULL) +,(20,1,'Implement RPM Range','Plough',1300,1800,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:12:36.945',NULL,NULL) +,(20,1,'Implement RPM Range','Cultivator',1700,2100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:12:36.945',NULL,NULL) +,(20,1,'Implement RPM Range','Harrow',1700,2100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:12:36.945',NULL,NULL) +,(20,1,'Implement RPM Range','Rotavator',2000,2100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:12:36.945',NULL,NULL) +,(20,1,'Implement RPM Range','Haulage',2000,2300,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'postgres','2021-08-22 10:12:36.945',NULL,NULL) +; + + + \ No newline at end of file diff --git a/onetime/dataloadfunctions/IHT/.IHTBT50_BT50_ODS.sql.swp b/onetime/dataloadfunctions/IHT/.IHTBT50_BT50_ODS.sql.swp old mode 100644 new mode 100755 diff --git a/onetime/dataloadfunctions/IHT/IHT_EMT_STD_STG2.sql b/onetime/dataloadfunctions/IHT/IHT_EMT_STD_STG2.sql index 83052db..63b7af0 100755 --- a/onetime/dataloadfunctions/IHT/IHT_EMT_STD_STG2.sql +++ b/onetime/dataloadfunctions/IHT/IHT_EMT_STD_STG2.sql @@ -125,8 +125,8 @@ perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk, 'IHTEMT_STD_RAW_Data_Block',__file_mnemonic,__file_sheet_mnemonic,1); err_block:='IHTEMT_STD_RAW_Data_Block'; -insert into staging2.IHTEMT_STD_RAW_Data_Block (Steering_Angle,Effort,block_row_number) -select a.column1,column2,block_row_number from staging2.stg_process_table_IHTEMT_STD a +insert into staging2.IHTEMT_STD_RAW_Data_Block (time_s,Steering_Angle,Effort,block_row_number) +select a.column1,column2,column3,block_row_number from staging2.stg_process_table_IHTEMT_STD a where block_tag='IHTEMT_STD_RAW_Data'; diff --git a/onetime/dataloadfunctions/IHT/IHT_HLS_STG2.sql b/onetime/dataloadfunctions/IHT/IHT_HLS_STG2.sql index d7a3bf7..df4bca5 100755 --- a/onetime/dataloadfunctions/IHT/IHT_HLS_STG2.sql +++ b/onetime/dataloadfunctions/IHT/IHT_HLS_STG2.sql @@ -272,7 +272,7 @@ file_syspk='||p_file_syspk||', file_mnemonic='''||p_file_mnemonic||''', file_sheet_mnemonic='''||p_file_sheet_mnemonic||''''; -perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_H1_Block'); +perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_H1_BLOCK'); insert into staging2.IHTHLS_HLS_Weight_Tyre_Int diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_budni_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_budni_load.sql index c82b52c..3a0b4ae 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_budni_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_budni_load.sql @@ -1,7 +1,7 @@ -CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_budni_load(p_client_id int,p_function_id int, p_file_mnemonic text, -p_file_sheet_mnemonic text, p_file_syspk int) +CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_budni_load(p_client_id integer, p_function_id integer, p_file_mnemonic text, p_file_sheet_mnemonic text, p_file_syspk integer) RETURNS void -AS $$ + LANGUAGE plpgsql +AS $function$ declare f record; @@ -20,7 +20,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk = __file_syspk loop if f.file_mnemonic = 'BUDNI' then @@ -54,6 +54,8 @@ then test_type, --subtype, condition hierarchy location_name, + test_sub_type, + gear_used, test_condition, -- location name engine_speed_var, @@ -107,9 +109,11 @@ then b.test_tractor_yn, d.test_type, d.test_location_name , + a.test_condtion, + a.gear_used, case split_part(a.test_condtion,' ',6) - when 'ballasted)' then 'ballasted' - when 'Unballasted)' then 'Unballasted' + when 'ballasted)' then 'Ballasted' + when 'Unballasted)' then 'Un-ballasted' end, -- test specific dimensions -- test specific measures @@ -223,6 +227,594 @@ then AND a.file_syspk = __file_syspk and b.tractor_model = a.tractor_model and b.file_sheet_mnemonic in ('BUDNI_PTO') and d.file_mnemonic =('BUDNI') and d.file_sheet_mnemonic in ('BUDNI_PTO'); + + +insert into fw_ods.fw_ods + ( + -- File Identifier: Test_Mnemonic, Sheet_Mnemonic, file_syspk(id), test_instance_id, test_file_name, + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_name, + test_file_id, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + season, + --test specific: condition + --test specific: location + location_name, + ----test specific: Implement details(name, type and Weight_kg) + name_of_implement, + type_of_implement, + implement_weight_kg, + trailer_gross_weight_kg, + -- test specific measures: Speed and gear + -- test specific measures: fuel, area, speed,wheel-slip, productivity,rpm and depth-of-operation + fuel_consumption_lit_per_hr, + gear_used, + speed_kmph, + mileage_kmpl, + fuel_consumption_ml_per_km_per_tonne, + trailer_hitch_height_above_ground_level_mm, + created_by, + updated_by, + create_timestamp, + update_timestamp + --created_by, updated_by, create_timestamp, update_timestamp + ) + select + -- File Identifier: Test_Mnemonic, Sheet_Mnemonic, file_syspk(id), test_instance_id, test_file_name, + a.client_id, + a.function_id, + a.file_mnemonic, + a.file_sheet_mnemonic, + a.test_name, + a.file_syspk, + a.test_file_name, + a.syspk, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + b.tractor_make, + b.tractor_model, + b.mahindra_model_yn, + b.test_tractor_yn, + b.tractor_engine_hp, + b.wheel_drive_type, + b.configuration, + b.syspk, + --test specific: date & test dimensions + a.date_of_test, + extract( year from a.date_of_test), + extract( quarter from a.date_of_test), + extract( month from a.date_of_test), + extract( day from a.date_of_test), + extract( dow from a.date_of_test), + concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", + + a.test_location_name, + 'Trailer', + c.trailer_type, + c.gross_mass_of_trailer_tonne *1000, + c.gross_mass_of_trailer_tonne *1000, + -- test specific measures: Speed and gear + -- test specific measures: fuel, area, speed,wheel-slip, productivity,rpm and depth-of-operation + ((trim(split_part(c.avg_fuel_consumption_ltr_per_hr,'to',1))::numeric) + (case trim(split_part(c.avg_fuel_consumption_ltr_per_hr,'to',2)) when '' then trim(split_part(c.avg_fuel_consumption_ltr_per_hr,'to',1))::numeric else trim(split_part(c.avg_fuel_consumption_ltr_per_hr,'to',2))::numeric end ))/2::numeric, + c.gear_used_negotiating_slopes_up_to_8pct, + ((trim(split_part(c.avg_travel_speed_kmph,'to',1))::numeric) + (case trim(split_part(c.avg_travel_speed_kmph,'to',2)) when '' then trim(split_part(c.avg_travel_speed_kmph,'to',1))::numeric else trim(split_part(c.avg_travel_speed_kmph,'to',2))::numeric end ))/2::numeric, + (((trim(split_part(avg_dist_traveled_per_litre_of_fuel_consumption_km,'to',1))::numeric) + (case trim(split_part(avg_dist_traveled_per_litre_of_fuel_consumption_km,'to',2)) when '' then trim(split_part(avg_dist_traveled_per_litre_of_fuel_consumption_km,'to',1))::numeric else trim(split_part(avg_dist_traveled_per_litre_of_fuel_consumption_km,'to',2))::numeric end ))/2::numeric), + (((trim(split_part(c.avg_fuel_consumption_ml_per_km_per_tonne,'to',1))::numeric) + (case trim(split_part(c.avg_fuel_consumption_ml_per_km_per_tonne,'to',2)) when '' then trim(split_part(c.avg_fuel_consumption_ml_per_km_per_tonne,'to',1))::numeric else trim(split_part(c.avg_fuel_consumption_ml_per_km_per_tonne,'to',2))::numeric end ))/2::numeric) , + c.height_of_trailer_hitch_above_ground_level_mm, + current_user, + current_user, + current_timestamp, + current_timestamp + -- add user and timestamp fields +from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.budni_haulage_perf_results c + where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk + and c.tractor_model = b.tractor_model + and c.test_instance_tractor_id = b.syspk + and a.file_sheet_mnemonic = 'BUDNI_HLG' + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and a.file_sheet_mnemonic = c.file_sheet_mnemonic + AND a.file_syspk = __file_syspk; + + + + +insert into fw_ods.fw_ods +( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_name, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + season, + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + --test specific: condition + --test specific: location + location_name, + test_condition, + test_sub_type, + test_type, + coordinates, + created_by, + updated_by, + create_timestamp, + update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_name, +a.test_file_name, +a.syspk, +b.tractor_make, +b.tractor_model, +b.test_tractor_yn, +b.mahindra_model_yn, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +b.syspk, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +a.date_of_test, +extract( year from a.date_of_test), +extract( quarter from a.date_of_test), +extract( month from a.date_of_test), +extract( day from a.date_of_test), +extract( dow from a.date_of_test), +a.test_location_name, +c.condition, +(case when c.particulars like '%Height%' then 'z' when c.particulars like '%vertical%' then 'x' when c.particulars like '%median%' then 'y' else null end), +(case split_part(coordinates,'(',2) when '' then c.particulars else concat(c.particulars,'-(',split_part(coordinates,'(',2)) end), +split_part(coordinates,'(',1)::numeric, +current_user, +current_user, +current_timestamp, +current_timestamp +from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.budni_centre_of_gravity_location c + where + a.file_syspk = b.file_syspk + and a.file_syspk = c.file_syspk + and c.test_instance_id = a.syspk + and c.test_instance_tractor_id =b.syspk + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and a.file_sheet_mnemonic = c.file_sheet_mnemonic + and a.file_sheet_mnemonic = 'BUDNI_LCG' + AND a.file_syspk = __file_syspk; + + + + + +insert into fw_ods.fw_ods( + -- File Identifier: Test_Mnemonic, Sheet_Mnemonic, file_syspk(id), test_instance_id, test_file_name, + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_name, + test_file_id, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,""""configuration"""",Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + season, + --test specific: location and test purpose +-- test_mode, + test_type, +-- test_purpose, + location_name, + --Test Specific: + gear_used, + speed_kmph, + noise_dba, + pull_kn, + created_by, + updated_by, + create_timestamp, + update_timestamp + ) + select + -- File Identifier: Test_Mnemonic, Sheet_Mnemonic, file_syspk(id), test_instance_id, test_file_name, + a.client_id, + a.function_id, + a.file_mnemonic, + a.file_sheet_mnemonic, + a.test_name, + a.file_syspk, + a.test_file_name, + a.syspk, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,""""configuration"""",Test insance tractor id + b.tractor_make, + b.tractor_model, + b.mahindra_model_yn, + b.test_tractor_yn, + b.tractor_engine_hp, + b.wheel_drive_type, + b."configuration", + b.syspk, + --test specific: date & test dimensions + a.date_of_test, + extract( year from a.date_of_test), + extract( quarter from a.date_of_test), + extract( month from a.date_of_test), + extract( day from a.date_of_test), + extract( dow from a.date_of_test), + concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", + --test specific: location +-- c.test_mode, + c.noise_position as test_type, +-- a.test_purpose, + a.test_location_name, + -- Test Specific: + c.gear, + ((trim(split_part(c.travel_speed_km_per_hr,'to',1))::numeric) + (case trim(split_part(c.travel_speed_km_per_hr,'to',2)) when '' then trim(split_part(c.travel_speed_km_per_hr,'to',1))::numeric else trim(split_part(c.travel_speed_km_per_hr,'to',2))::numeric end ))/2::numeric, + c.noise_level_db_a, + ((trim(split_part(c.drawbar_pull_max_noise_kn,'to',1))::numeric) + (case trim(split_part(c.drawbar_pull_max_noise_kn,'to',2)) when '' then trim(split_part(c.drawbar_pull_max_noise_kn,'to',1))::numeric else trim(split_part(c.drawbar_pull_max_noise_kn,'to',2))::numeric end ))/2::numeric, + current_user, + current_user, + current_timestamp, + current_timestamp + from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.Budni_noise_measurement_results c + where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk + and c.tractor_model = b.tractor_model + and b.syspk = c.test_instance_tractor_id + and a.file_sheet_mnemonic in ('BUDNI_NMT') + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and b.file_sheet_mnemonic = c.file_sheet_mnemonic + and a.file_syspk = __file_syspk; + + + + + +insert into fw_ods.fw_ods +( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_name, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + season, + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + --test specific: condition + --test specific: location + location_name, + test_iteration_number, + sensor_body_location, + vb_no_load_vd_microns, + vb_no_load_hd_microns, + vb_load_85_pct_max_pto_power_vd_microns, + vb_load_85_pct_max_pto_power_hd_microns, + created_by, + updated_by, + create_timestamp, + update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_name, +a.test_file_name, +a.syspk, +b.tractor_make, +b.tractor_model, +b.test_tractor_yn, +b.mahindra_model_yn, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +b.syspk, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +a.date_of_test, +extract( year from a.date_of_test), +extract( quarter from a.date_of_test), +extract( month from a.date_of_test), +extract( day from a.date_of_test), +extract( dow from a.date_of_test), +a.test_location_name, +c.srl_no,measuring_points, +c.vibration_at_no_load_vd_microns, +c.vibration_at_no_load_hd_microns, +c.vibration_at_load_85_pct_of_max_pto_power_vd_microns, +c.vibration_at_load_85_pct_of_max_pto_power_hd_microns, +current_user, +current_user, +current_timestamp, +current_timestamp +from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.budni_vibration_measurement c + where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk +-- and trim(c.tractor_model) = trim(b.tractor_model) +-- and trim(c.tractor_model) = trim(a.tractor_model) + and a.file_sheet_mnemonic = 'BUDNI_VMT' + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and b.file_sheet_mnemonic = c.file_sheet_mnemonic + and c.test_instance_id = a.syspk + and c.test_instance_tractor_id =b.syspk + and a.file_syspk = __file_syspk; + + + +update transactional.budni_field_perf_results +set avg_wheel_slip_pct = regexp_replace(avg_wheel_slip_pct ,'\s','', 'g') +where file_syspk = __file_syspk; + +insert into fw_ods.fw_ods +( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_name, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + season, + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + --test specific: condition + --test specific: location + location_name, + type_of_soil, + ----test specific: Implement details(name, type and Weight_kg) + name_of_implement, + type_of_implement, + test_type , + gear_used, + fuel_consumption_lit_per_hr, + fuel_consumption_lit_per_acr, + area_covered_acr_per_hr, + speed_kmph, + wheel_slippage_pct, + depth_of_cut_cm_low, + depth_of_cut_cm_high, + pull_kn, + cage_wheel_width_mm, + cage_wheel_weight, + soil_moisture_content_pct, + soil_bulk_density_g_per_cc, + soil_cone_index, + created_by, + updated_by, + create_timestamp, + update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_name, +a.test_file_name, +a.syspk, +b.tractor_make, +b.tractor_model, +b.test_tractor_yn, +b.mahindra_model_yn, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +b.syspk, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +a.date_of_test, +extract( year from a.date_of_test), +extract( quarter from a.date_of_test), +extract( month from a.date_of_test), +extract( day from a.date_of_test), +extract( dow from a.date_of_test), +a.test_location_name, +c.type_of_soil, +case d.name_of_implement when 'Specifications' then d.type_of_implement else d.name_of_implement end, +d.type_of_implement, +c.operation_type, +c.gear_used, +((trim(split_part(c.fuel_consumption_ltr_per_hr,'to',1))::numeric) + (case trim(split_part(c.fuel_consumption_ltr_per_hr,'to',2)) when '' then trim(split_part(c.fuel_consumption_ltr_per_hr,'to',1))::numeric else trim(split_part(c.fuel_consumption_ltr_per_hr,'to',2))::numeric end ))/2::numeric, +(((trim(split_part(c.fuel_consumption_ltr_per_ha,'to',1))::numeric) + (case trim(split_part(c.fuel_consumption_ltr_per_ha,'to',2)) when '' then trim(split_part(c.fuel_consumption_ltr_per_ha,'to',1))::numeric else trim(split_part(c.fuel_consumption_ltr_per_ha,'to',2))::numeric end ))/2::numeric)/2.47105, +(((trim(split_part(c.area_covered_ha_per_hr,'to',1))::numeric) + (case trim(split_part(c.area_covered_ha_per_hr,'to',2)) when '' then trim(split_part(c.area_covered_ha_per_hr,'to',1))::numeric else trim(split_part(c.area_covered_ha_per_hr,'to',2))::numeric end ))/2::numeric)*2.47105, +((trim(split_part(c.avg_speed_of_operation_kmph,'to',1))::numeric) + (case trim(split_part(c.avg_speed_of_operation_kmph,'to',2)) when '' then trim(split_part(c.avg_speed_of_operation_kmph,'to',1))::numeric else trim(split_part(c.avg_speed_of_operation_kmph,'to',2))::numeric end ))/2::numeric, +(case c.operation_type when 'Puddling' then +(case +(trim(split_part(c.avg_travel_reduction_pct,'Rear:',2))) +when + '' +then +((cast(trim(split_part(c.avg_travel_reduction_pct,'to',1))as numeric)) + ((case ((trim(split_part(c.avg_travel_reduction_pct,'to',2)))) when '' then cast(trim(split_part(c.avg_travel_reduction_pct,'to',1)) as numeric) else (cast(trim(split_part(c.avg_travel_reduction_pct,'to',2)) as numeric)) end )::numeric)/2)::numeric +else +((trim(split_part((trim(split_part(c.avg_travel_reduction_pct,'Rear:',2))),'to',1))::numeric) + (case trim(split_part((trim(split_part(c.avg_travel_reduction_pct,'Rear:',2))),'to',2)) when '' then trim(split_part((trim(split_part(c.avg_travel_reduction_pct,'Rear:',2))),'to',1))::numeric else trim(split_part((trim(split_part(c.avg_travel_reduction_pct,'Rear:',2))),'to',2))::numeric end ))/2::numeric +end) +else ( +case +(trim(split_part(c.avg_wheel_slip_pct,'Rear:',2))) +when + '' +then +((cast(trim(split_part(c.avg_wheel_slip_pct,'to',1))as numeric)) + ((case ((trim(split_part(c.avg_wheel_slip_pct,'to',2)))) when '' then cast(trim(split_part(c.avg_wheel_slip_pct,'to',1)) as numeric) else (cast(trim(split_part(c.avg_wheel_slip_pct,'to',2)) as numeric)) end )::numeric)/2)::numeric +else +((trim(split_part((trim(split_part(c.avg_wheel_slip_pct,'Rear:',2))),'to',1))::numeric) + (case trim(split_part((trim(split_part(c.avg_wheel_slip_pct,'Rear:',2))),'to',2)) when '' then trim(split_part((trim(split_part(c.avg_wheel_slip_pct,'Rear:',2))),'to',1))::numeric else trim(split_part((trim(split_part(c.avg_wheel_slip_pct,'Rear:',2))),'to',2))::numeric end ))/2::numeric +end) +end) +, +( case c.operation_type when 'Puddling' then trim(split_part(c.avg_depth_of_puddle_cm,'to',1))::numeric else trim(split_part(c.avg_depth_of_cut_cm,'to',1))::numeric end), +(case c.operation_type when 'Puddling' then (case trim(split_part(c.avg_depth_of_puddle_cm ,'to',2)) when '' then null else trim(split_part(c.avg_depth_of_puddle_cm ,'to',2))::numeric end) else (case trim(split_part(c.avg_depth_of_cut_cm,'to',2)) when '' then null else trim(split_part(c.avg_depth_of_cut_cm,'to',2))::numeric end)end), +((trim(split_part(c.avg_draft_of_implement_kn,'to',1))::numeric) + (case trim(split_part(c.avg_draft_of_implement_kn,'to',2)) when '' then trim(split_part(c.avg_draft_of_implement_kn,'to',1))::numeric else trim(split_part(c.avg_draft_of_implement_kn,'to',2))::numeric end ))/2::numeric, +d.cage_wheel_width_mm, +d.cage_wheel_weight_kg, +((trim(split_part(c.avg_soil_moisture_pct_,'to',1))::numeric) + (case trim(split_part(c.avg_soil_moisture_pct_,'to',2)) when '' then trim(split_part(c.avg_soil_moisture_pct_,'to',1))::numeric else trim(split_part(c.avg_soil_moisture_pct_,'to',2))::numeric end ))/2::numeric, +((trim(split_part(c.bulk_density_of_soil_g_per_cc,'to',1))::numeric) + (case trim(split_part(c.bulk_density_of_soil_g_per_cc,'to',2)) when '' then trim(split_part(c.bulk_density_of_soil_g_per_cc,'to',1))::numeric else trim(split_part(c.bulk_density_of_soil_g_per_cc,'to',2))::numeric end ))/2::numeric, +((trim(split_part(c.cone_index_kgf_per_sq_cm,'to',1))::numeric) + (case trim(split_part(c.cone_index_kgf_per_sq_cm,'to',2)) when '' then trim(split_part(c.cone_index_kgf_per_sq_cm,'to',1))::numeric else trim(split_part(c.cone_index_kgf_per_sq_cm,'to',2))::numeric end ))/2::numeric, + current_user, + current_user, + current_timestamp, + current_timestamp +from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.budni_field_perf_results c, + transactional.test_instance_implement_info d + where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk + and c.file_syspk = d.file_syspk + and c.test_instance_id = d.test_instance_id + and c.test_instance_tractor_id =b.syspk + and ((c.operation_type like '%lough%' and d.name_of_implement like '%lough%') or (c.operation_type like '%Rotava%' and d.name_of_implement like '%Rotava%') or (c.operation_type like '%uddling%' and d.name_of_implement like '%pecification%')) + and a.file_sheet_mnemonic = 'BUDNI_FLD' + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and a.file_sheet_mnemonic = c.file_sheet_mnemonic + and a.file_syspk = __file_syspk; + + + + + + + + + + + + + + + + + + + + + + + + + + + END if; end loop; @@ -230,6 +822,8 @@ then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_budni_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); + +/* EXCEPTION when OTHERS then err_state = returned_sqlstate, /* P0002 */ @@ -244,10 +838,9 @@ perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compege - +*/ end -$$ -LANGUAGE plpgsql; - +$function$ +; diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_comments_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_comments_load.sql index b5a3115..c2d07d3 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_comments_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_comments_load.sql @@ -21,7 +21,7 @@ begin CREATE SEQUENCE if not exists mysequence INCREMENT 1 START 1; -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk= __file_syspk loop if f.file_mnemonic in('FTDRY','FTWET') then @@ -43,6 +43,9 @@ wheel_drive_type, tractor_engine_hp, name_of_implement, type_of_implement, +gear_used, +speed_rpm, +test_date_year, season, users, "role", @@ -72,6 +75,9 @@ create_timestamp c.tractor_engine_hp, d.name_of_implement, d.Type_of_implement, + b.gear_used, + b.engine_rpm_set, + extract( year from a.date_of_test) , concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' ))) AS "Month Name", @@ -101,6 +107,8 @@ create_timestamp and b.file_syspk = c.file_syspk and c.file_syspk = d.file_syspk and c.tractor_model = b.tractor_model + and b.test_instance_tractor_id = c.syspk + and b.test_instance_id = d.test_instance_id and a.file_syspk = __file_syspk; ALTER SEQUENCE mysequence RESTART WITH 1; @@ -128,6 +136,8 @@ wheel_drive_type, tractor_engine_hp, name_of_implement, type_of_implement, +test_date_year , +gear_used, season, users, "role", @@ -157,6 +167,8 @@ create_timestamp c.tractor_engine_hp, 'Trailer', d.trailer_type, + extract( year from a.date_of_test) , + gear_used_on_straight_road, concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' ))) AS "Month Name", @@ -191,14 +203,8 @@ create_timestamp ALTER SEQUENCE mysequence RESTART WITH 1; END IF; end loop; - - - perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); - - - - +/* EXCEPTION when OTHERS then @@ -210,8 +216,8 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ end $$ -LANGUAGE plpgsql; +LANGUAGE plpgsql; \ No newline at end of file diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_detailed_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_detailed_load.sql index ff1b825..348a8c2 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_detailed_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_detailed_load.sql @@ -20,7 +20,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk = __file_syspk loop if f.file_mnemonic = 'IHTEMT' then @@ -125,7 +125,7 @@ and a.file_mnemonic like 'IHT%'; perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_detailed_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); - +/* EXCEPTION when OTHERS then @@ -139,7 +139,7 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_detailed_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_comments_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_comments_load.sql new file mode 100755 index 0000000..16d238e --- /dev/null +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_comments_load.sql @@ -0,0 +1,116 @@ +CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_drawbar_comments_load(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 + f record; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_mnemonic text :=p_file_mnemonic; + declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare err_state text; + declare err_msg text; + declare err_detail text; + declare err_hint text; + declare err_context text; + declare _error int; + +begin + + + + +insert into fw_ods.fw_ods_observations +( +client_id, +function_id, +test_file_mnemonic, +test_sheet_mnemonic, +test_file_id, +test_file_name, +--platform, +--benchmark_yn, +tractor_make, +tractor_model, +tractor_engine_hp, +wheel_drive_type, +configuration, +season, +test_date_year, +parameters, +sequence, +value1, +value2, +gear_used, +--display_yn, +acceptance_criteria, +remarks, +created_by, +updated_by, +create_timestamp, +update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_file_name, +b.tractor_make, +b.tractor_model, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +extract( year from a.date_of_test), +concat(split_part(c.test_parameter,' ',2) ,' ',split_part(c.test_parameter,' ',3)) as test_parameters, +case When split_part(trim(c.test_parameter),' ',2) like 'Pull%' then 1 else 2 end, +split_part(c.observation,' ',1), +split_Part( split_part(c.observation, ')',1), '(',2), +(select arr[array_length(arr,1)-1] FROM (SELECT string_to_array(c.remarks, ' ') AS arr) AS t) as gear_used, +--split_part(trim(split_part(c.remarks, 'in', 2)), ' ', 1 ) as gear_used, +c.acceptance_criteria, +c.remarks, +current_user, +current_user, +current_timestamp, +current_timestamp +from +transactional.test_instance a, +transactional.test_instance_tractor_info b, +transactional.drawbar_perf_observations c +where a.file_syspk = b.file_syspk +and a.file_syspk = c.file_syspk +and a.file_mnemonic = b.file_mnemonic +and a.file_mnemonic = c.file_mnemonic +and a.file_sheet_mnemonic = b.file_sheet_mnemonic +and a.file_sheet_mnemonic = c.file_sheet_mnemonic +and a.file_syspk =__file_syspk; + + + +err_context :=''; +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); +/* +EXCEPTION when OTHERS then + + err_state = returned_sqlstate, /* P0002 */ + err_msg = message_text, /* No Data in FTDRY */ + err_detail = pg_exception_detail, /* No data in table t_test_new */ + err_hint = pg_exception_hint, /* No data error capture */ + err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/ + +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); +*/ +end +$$ +LANGUAGE plpgsql; + + + + diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_load.sql index 8e79a8a..0f381dc 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_load.sql @@ -20,7 +20,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_mnemonic = 'DBSTD' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_mnemonic = 'DBSTD' and file_syspk = __file_syspk loop @@ -153,7 +153,7 @@ FROM staging1.staging_generic_table a where file_mnemonic = 'DBSTD' and test_fil perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_drawbar_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); - +/* EXCEPTION when OTHERS then @@ -167,7 +167,7 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_drawbar_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ end diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_observation_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_observation_load.sql new file mode 100755 index 0000000..86185e2 --- /dev/null +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_observation_load.sql @@ -0,0 +1,371 @@ + +CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_drawbar_observations_load(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 + f record; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_mnemonic text :=p_file_mnemonic; + declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare err_state text; + declare err_msg text; + declare err_detail text; + declare err_hint text; + declare err_context text; + declare _error int; + +begin + +CREATE SEQUENCE if not exists obssequence INCREMENT 1 START 1; + +insert into fw_ods.fw_ods_observations +( +client_id, +function_id, +test_file_mnemonic, +test_sheet_mnemonic, +test_file_id, +test_file_name, +--platform, +--benchmark_yn, +tractor_make, +tractor_model, +tractor_engine_hp, +wheel_drive_type, +configuration, +season, +test_date_year, +group_category, +sequence, +parameters, +value1, +value2, +--display_yn, +created_by, +updated_by, +create_timestamp, +update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_file_name, +b.tractor_make, +b.tractor_model, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +extract( year from a.date_of_test), +'Engine-RPM' as group_category, +nextval('obssequence'), +unnest(Array +[ +'Low Idle RPM', +'High Idle RPM', +'Rated Speed', +'Engine to PTO Ratio', +'Wheel Base (mm)', +'Engine Power hp', +'PTO Power hp' +] +) as parameters, +unnest(Array[ +c.low_idle_declared::text, +c.high_idle_declared::text, +c.rated_rpm::text, +c.engine_to_pto_ratio_540_pto::text, +b.wheel_base_mm::text, +c.engine_power_hp::text, +c.pto_power_hp::text +]) as value1, +unnest(Array[ +c.low_idle_observed::text, +c.high_idle_observed::text, +c.rated_rpm_observed::text +]) as value2, +current_user, +current_user, +current_timestamp, +current_timestamp +from +transactional.test_instance a, +transactional.test_instance_tractor_info b, +transactional.test_instance_engine_info c +where a.file_syspk = b.file_syspk +and a.file_syspk = c.file_syspk +and a.file_mnemonic = b.file_mnemonic +and a.file_mnemonic = c.file_mnemonic +and a.file_sheet_mnemonic = b.file_sheet_mnemonic +and a.file_sheet_mnemonic = c.file_sheet_mnemonic +and a.file_syspk =__file_syspk; + +insert into fw_ods.fw_ods_observations +( +client_id, +function_id, +test_file_mnemonic, +test_sheet_mnemonic, +test_file_id, +test_file_name, +--platform, +--benchmark_yn, +tractor_make, +tractor_model, +tractor_engine_hp, +wheel_drive_type, +configuration, +season, +test_date_year, +group_category, +sequence, +parameters, +value1, +value2, +--display_yn, +created_by, +updated_by, +create_timestamp, +update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_file_name, +b.tractor_make, +b.tractor_model, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +extract( year from a.date_of_test), + 'Engine-RPM' as group_value, + nextval('obssequence'), + t.col as parameters, + t.value1, + t.value2, +current_user, +current_user, +current_timestamp, +current_timestamp +from +transactional.test_instance a, +transactional.test_instance_tractor_info b, +staging2.crosstab( + 'SELECT unnest(''{ +Drawbar Type, +Drawbar Type INFO, +Required Pull in kg, +Required Power in hp, +Actual Pull in kg, +Actual Power in hp, +Calculated hitch height (mm), +Actual hitch height (mm) +}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[ +drawbar_type_name::text, +drawbar_type_info::text, +concat(drawbar_type,''-'',required_pull_in_kg)::text, +concat(drawbar_type,''-'',required_power_in_hp)::text, +concat(drawbar_type,''-'',actual_pull_in_kg)::text, +concat(drawbar_type,''-'',actual_power_in_hp)::text, +concat(drawbar_type,''-'',calculated_hitch_height_mm)::text, +concat(drawbar_type,''-'',actual_hitch_height_mm)::text +]) AS val + FROM transactional.test_instance_drawbar_info + where + file_syspk = '''||__file_syspk||''' + ORDER BY generate_series(1,8), 2' + ) t (col text, value1 text,value2 text) +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; + +ALTER SEQUENCE obssequence RESTART WITH 1; + +insert into fw_ods.fw_ods_observations +( +client_id, +function_id, +test_file_mnemonic, +test_sheet_mnemonic, +test_file_id, +test_file_name, +--platform, +--benchmark_yn, +tractor_make, +tractor_model, +tractor_engine_hp, +wheel_drive_type, +configuration, +season, +test_date_year, +group_category, +sequence, +parameters, +value1, +value2, +--display_yn, +created_by, +updated_by, +create_timestamp, +update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_file_name, +b.tractor_make, +b.tractor_model, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +extract( year from a.date_of_test), + 'Weight-Kg' as group_name, + nextval('obssequence') as sequence_no, + t.col as parameters, + t.value1, + t.value2, +current_user, +current_user, +current_timestamp, +current_timestamp +from +transactional.test_instance a, +transactional.test_instance_tractor_info b, +staging2.crosstab( + 'SELECT unnest(''{ +Weight Front kg, +Weight Rear kg, +Weight Total kg +}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[ +concat(drawbar_type,''-'',weight_front_kg)::text, +concat(drawbar_type,''-'',weight_rear_kg)::text, +concat(drawbar_type,''-'',weight_total_kg)::text +]) AS val + FROM transactional.test_instance_drawbar_info + where + file_syspk = '''||__file_syspk||''' + ORDER BY generate_series(1,3), 2' + ) t (col text, value1 text,value2 text) +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; + + ALTER SEQUENCE obssequence RESTART WITH 1; + + insert into fw_ods.fw_ods_observations +( +client_id, +function_id, +test_file_mnemonic, +test_sheet_mnemonic, +test_file_id, +test_file_name, +--platform, +--benchmark_yn, +tractor_make, +tractor_model, +tractor_engine_hp, +wheel_drive_type, +configuration, +season, +test_date_year, +group_category, +sequence, +parameters, +value1, +value2, +--display_yn, +created_by, +updated_by, +create_timestamp, +update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_file_name, +b.tractor_make, +b.tractor_model, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +extract( year from a.date_of_test), + 'Tyre Details' as group_value, + nextval('obssequence'), + t.col as parameters, + t.value1 , + t.value2, +current_user, +current_user, +current_timestamp, +current_timestamp +from +transactional.test_instance a, +transactional.test_instance_tractor_info b, +staging2.crosstab( + 'SELECT unnest(''{Tyre Type,Tyre Make,Tyre Size,Tyre Ply Rating,Tyre Load Carrying Capacity in KG,Pressure (kg/cm2),Tyre number of lug,Tyre number of no load lug (30m),Tyre Lug Height,Tyre Dynamic Rolling Radius (mm),Tyre Wheel Rim Make and Size}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[tyre_type::text,tyre_make::text,tyre_size::text,tyre_ply_rating::text,tyre_load_carrying_capacity::text,tyre_pressure_kg_per_cm2::text,tyre_number_of_lug::text,tyre_number_of_no_load_lug_30m::text,tyre_lug_height::text,tyre_dynamic_rolling_radius_mm::text,tyre_wheel_rim_make_and_size]) AS val + FROM transactional.test_instance_tyre_info + where + file_syspk = '''||__file_syspk||''' + ORDER BY generate_series(1,11), 2' + ) t (col text, value1 text,value2 text) +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; + + ALTER SEQUENCE obssequence RESTART WITH 1; + + +err_context :=''; +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); +/* +EXCEPTION when OTHERS then + + err_state = returned_sqlstate, /* P0002 */ + err_msg = message_text, /* No Data in FTDRY */ + err_detail = pg_exception_detail, /* No data in table t_test_new */ + err_hint = pg_exception_hint, /* No data error capture */ + err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/ + +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); +*/ +end +$$ +LANGUAGE plpgsql; + diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_performance_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_performance_load.sql index 066110b..15915a6 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_performance_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_drawbar_performance_load.sql @@ -20,7 +20,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk= __file_syspk loop if f.file_mnemonic = 'DBSTD' then @@ -168,7 +168,7 @@ insert into fw_ods.fw_ods_drawbar_performance ( perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_drawbar_performance_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); - +/* EXCEPTION when OTHERS then @@ -183,7 +183,7 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_drawbar_performance_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ end $$ diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_field_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_field_load.sql index 14f82a8..f53fa32 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_field_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_field_load.sql @@ -21,7 +21,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk = __file_syspk loop if f.file_mnemonic = 'FTDRY' then @@ -461,7 +461,7 @@ perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compege - +/* EXCEPTION when OTHERS then @@ -477,7 +477,7 @@ perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compege - +*/ end $$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_iht_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_iht_load.sql index 3089509..0399559 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_iht_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_iht_load.sql @@ -20,7 +20,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk = __file_syspk loop if f.file_mnemonic like 'IHT%' then @@ -319,6 +319,112 @@ then and c.tractor_model = b.tractor_model and a.file_mnemonic in ('IHTSLL') and a.file_syspk = __file_syspk; + + + + + -- Insert data to fw_ods_iht: for Speed Lag: + insert into fw_ods.fw_ods( + -- File Identifier: Test_Mnemonic, Sheet_Mnemonic, file_syspk(id), test_instance_id, test_file_name, + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_name, + test_file_id, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,""""configuration"""",Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + season, + --test specific: location and test purpose +-- test_condition, + test_purpose, + location_name, + test_type, + --Test Specific: + gear_used, + engine_speed_var, + no_of_revolution_front, + Lead_lag_ratio, + Lead_lag_pct, + Lead_lag_type, + created_by, + updated_by, + create_timestamp, + update_timestamp + ) + select + -- File Identifier: Test_Mnemonic, Sheet_Mnemonic, file_syspk(id), test_instance_id, test_file_name, + a.client_id, + a.function_id, + a.file_mnemonic, + a.file_sheet_mnemonic, + a.test_name, + a.file_syspk, + a.test_file_name, + a.syspk, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,"""configuration""",Test insance tractor id + b.tractor_make, + b.tractor_model, + b.mahindra_model_yn, + b.test_tractor_yn, + b.tractor_engine_hp, + c.wheel_drive_type, + b."configuration", + b.syspk, + --test specific: date & test dimensions + a.date_of_test, + extract( year from a.date_of_test), + extract( quarter from a.date_of_test), + extract( month from a.date_of_test), + extract( day from a.date_of_test), + extract( dow from a.date_of_test), + concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", + --test specific: location +-- c.test_condition, + a.test_purpose, + a.test_location_name, + 'Lead-Lag', + -- Test Specific: + --wheel_drive_type + c.gear, + c.engine_rpm, + c.no_of_revolution_front, + c.ratio, + split_part(c.lead_lag_pct,' ',1)::numeric, + split_part(c.lead_lag_pct,' ',2), + current_user, + current_user, + current_timestamp, + current_timestamp + from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.iht_speed_lead_lag_measurement c + where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk + and c.tractor_model = b.tractor_model + and a.file_mnemonic in ('IHTSLL') + and a.file_syspk = __file_syspk; + -- Insert data to fw_ods_iht: for Brake: @@ -829,6 +935,219 @@ then and c.tractor_model = b.tractor_model and a.file_mnemonic in ('IHTEMT') and a.file_syspk = __file_syspk; + + + + + +insert into fw_ods.fw_ods +( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_name, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + season, + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + --test specific: condition + --test specific: location + location_name, + load_kg, + speed_kmph , + engine_speed_var, + gear_used, + test_type, + sensor_body_location, + body_location_temperature, + created_by, + updated_by, + create_timestamp, + update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_name, +a.test_file_name, +a.syspk, +b.tractor_make, +b.tractor_model, +b.test_tractor_yn, +b.mahindra_model_yn, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +b.syspk, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +a.date_of_test, +extract( year from a.date_of_test), +extract( quarter from a.date_of_test), +extract( month from a.date_of_test), +extract( day from a.date_of_test), +extract( dow from a.date_of_test), +a.test_location_name, +c.load_kg, +c.speed_kmph, +c.speed_rpm, +gear, +(case when d.col LiKE '%temp%' then 'TEMP' when d.col like '%roa%' then 'ROA' else null end) as TEStype, +split_part(d.col,' ',1), +d.r1, +current_user, +current_user, +current_timestamp, +current_timestamp +from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + transactional.iht_hot_air_mapping_results c, + ( + SELECT * +FROM staging2.crosstab( + 'SELECT unnest(''{Ambient temp,Head temp,Head roa,Chest temp,Chest roa,LH-Leg temp,LH-Leg roa,RH-Leg temp,RH-Leg roa,RH-Hand temp,RH-Hand roa,LH-Hand temp,LH-Hand roa}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[ambient_measured_temp_c::int,head_measured_temp_c::int,head_roa_c::int,chest_measured_temp_c::int,chest_roa_c::int,lh_leg_measured_temp_c::int,lh_leg_roa_c::int,rh_leg_measured_temp_c::int,rh_leg_roa_c::int,rh_hand_measured_temp_c::int,rh_hand_roa_c::int,lh_hand_measured_temp_c::int,lh_hand_roa_c::int]) AS val + FROM transactional.iht_hot_air_mapping_results where gear = ''Max'' + and file_syspk = '''||__file_syspk||''' + ORDER BY generate_series(1,13), 2' + ) t (col text, r1 int) + )d + + where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk + and trim(c.tractor_model) = trim(b.tractor_model) + and trim(c.tractor_model) = trim(a.tractor_model) + and a.file_sheet_mnemonic = 'IHTHAM_HAM' + and c.gear='Max' + and c.test_instance_id = a.syspk + and c.test_instance_tractor_id =b.syspk + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and a.file_sheet_mnemonic = c.file_sheet_mnemonic + and a.file_syspk = __file_syspk; + + + + +insert into fw_ods.fw_ods +( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_name, + test_file_name, + test_instance_id, + -- Tractor Identifier: tractor make,tractor model,tractor engine hp,wheel drive type,configuration,Test insance tractor id + tractor_make, + tractor_model, + mahindra_model_yn, + test_tractor_yn, + tractor_engine_hp, + wheel_drive_type, + "configuration", + test_instance_tractor_id, + --test specific: date & test dimensions + season, + test_date, + test_date_year, + test_date_quarter, + test_date_month, + test_date_dayofmonth, + test_date_dayofweek, + --test specific: condition + --test specific: location + location_name, + test_sub_type, + test_type, + coordinates, + created_by, + updated_by, + create_timestamp, + update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_name, +a.test_file_name, +a.syspk, +b.tractor_make, +b.tractor_model, +b.test_tractor_yn, +b.mahindra_model_yn, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +b.syspk, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +a.date_of_test, +extract( year from a.date_of_test), +extract( quarter from a.date_of_test), +extract( month from a.date_of_test), +extract( day from a.date_of_test), +extract( dow from a.date_of_test), +a.test_location_name, +split_part(c.col,'-',2), +split_part(c.col,'-',1), +c.r1, +current_user, +current_user, +current_timestamp, +current_timestamp +from + transactional.test_instance a, + transactional.test_instance_tractor_info b, + ( + SELECT * + FROM staging2.crosstab( + 'SELECT unnest(''{horizontal_distance_from_rac(mm)-x,lateral_co_ordinate_in_horizontal_plane(mm)-y,vertical_co_ordinate(mm)-z}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[horizontal_distance_from_rac_x_mm::numeric,lateral_co_ordinate_in_horizontal_plane_y_mm::numeric,vertical_co_ordinate_z_mm::numeric]) AS val + FROM transactional.iht_cgm_results + where + file_syspk = '''||__file_syspk||''' + ORDER BY generate_series(1,3), 2' + ) t (col text, r1 numeric) + ) c + where + a.file_syspk = b.file_syspk + and trim(a.tractor_model) = trim(b.tractor_model) + and a.file_sheet_mnemonic = 'IHTCGM_CGM' + and a.file_mnemonic = b.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and a.file_syspk =__file_syspk; update fw_ods.fw_ods b @@ -848,7 +1167,7 @@ END IF; perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_iht_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); - +/* EXCEPTION when OTHERS then @@ -862,7 +1181,7 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_iht_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ end $$ diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_implement_details_update.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_implement_details_update.sql old mode 100644 new mode 100755 index 277ab94..8bc2968 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_implement_details_update.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_implement_details_update.sql @@ -171,7 +171,7 @@ and b.file_syspk = __file_syspk end loop; perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_implement_details_update', err_state, err_msg, err_detail, err_hint, err_context,'success'); - +/* EXCEPTION when OTHERS then err_state = returned_sqlstate, /* P0002 */ err_msg = message_text, /* No Data in FTDRY */ @@ -180,6 +180,6 @@ EXCEPTION when OTHERS then err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/ perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_implement_details_update', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ end $$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_observation_ftdry_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_observation_ftdry_load.sql index 674f71c..5cbfe92 100755 --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_observation_ftdry_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_observation_ftdry_load.sql @@ -1,11 +1,13 @@ - - CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_observations_load(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 f record; +total_count int :=5; +null_count record; +i record; +counter integer := 1; declare __client_id int :=p_client_id; declare __function_id int :=p_function_id; @@ -17,187 +19,408 @@ f record; declare err_detail text; declare err_hint text; declare err_context text; - declare _error int; + declare _error int; begin +for i in select distinct test_iteration_number, file_syspk from transactional.field_perf_summary fps where file_syspk =__file_syspk +loop + insert into fw_ods.fw_ods_observations( + parameters, + value1, + value2, + value3, + value4, + value5 + ) + ( + SELECT * + FROM staging2.crosstab( + 'SELECT unnest(''{tractor_model,engine_smoke_on_load,engine_acceleration_smoke,range_gear_shifting,speed_gear_shifting,draft_response, + tractor_steer_ability,tractor_braking_perf,front_visibility,implement_accessibility,front_wheel_dragging_at_turning,front_end_lifting_during_operation + ,rpm_recovery_time,engine_vibration,engine_sound,implement_lifting_per_lowering_response,pulverization_quality,pulverization_index}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[tractor_model::text,engine_smoke_on_load::text,engine_acceleration_smoke::text, + range_gear_shifting::text,speed_gear_shifting::text,draft_response::text,tractor_steer_ability::text,tractor_braking_perf::text, + front_visibility::text,implement_accessibility::text,front_wheel_dragging_at_turning::text, + front_end_lifting_during_operation::text,rpm_recovery_time::text,engine_vibration::text,engine_sound::text, + implement_lifting_per_lowering_response,pulverization_quality::text,pulverization_index::text]) AS val + FROM transactional.field_perf_summary + where file_syspk = '''||__file_syspk||''' + and test_iteration_number = '''||i.test_iteration_number||''' + ORDER BY generate_series(1,18),tractor_model, 2' + ) t (col text,a1 text,a2 text,a3 text,a4 text,a5 text)); + + update fw_ods.fw_ods_observations set parameters = 'Tractor Model',sequence = 1 where parameters = 'tractor_model'; + update fw_ods.fw_ods_observations set parameters = 'Engine Smoke on Load' , sequence = 2 where parameters = 'engine_smoke_on_load'; + update fw_ods.fw_ods_observations set parameters = 'Engine acceleration smoke' , sequence = 3 where parameters = 'engine_acceleration_smoke'; + update fw_ods.fw_ods_observations set parameters = 'Draft Response' , sequence = 4 where parameters = 'draft_response'; + update fw_ods.fw_ods_observations set parameters = 'Tractor Steer ability' , sequence = 5 where parameters = 'tractor_steer_ability'; + update fw_ods.fw_ods_observations set parameters = 'Tractor braking performance' , sequence = 6 where parameters = 'tractor_braking_perf'; + update fw_ods.fw_ods_observations set parameters = 'Front Visibility' , sequence = 7 where parameters = 'front_visibility'; + update fw_ods.fw_ods_observations set parameters = 'Implement Accessibility' , sequence = 8 where parameters = 'implement_accessibility'; + update fw_ods.fw_ods_observations set parameters = 'Front Wheel dragging at turning' , sequence = 9 where parameters = 'front_wheel_dragging_at_turning'; + update fw_ods.fw_ods_observations set parameters = 'Front end lifting during operation' , sequence = 10 where parameters = 'front_end_lifting_during_operation'; + update fw_ods.fw_ods_observations set parameters = 'RPM Recovery Time' , sequence = 11 where parameters = 'rpm_recovery_time'; + update fw_ods.fw_ods_observations set parameters = 'Engine Vibration' , sequence = 12 where parameters = 'engine_vibration'; + update fw_ods.fw_ods_observations set parameters = 'Engine Sound' , sequence = 13 where parameters = 'engine_sound'; + update fw_ods.fw_ods_observations set parameters = 'Implement Lifting/Lowering response ' , sequence = 14 where parameters = 'implement_lifting_per_lowering_response'; + update fw_ods.fw_ods_observations set parameters = 'Pulverization Quality' , sequence = 15 where parameters = 'pulverization_quality'; + update fw_ods.fw_ods_observations set parameters = 'Pulverization Index' , sequence = 16 where parameters = 'pulverization_index'; + update fw_ods.fw_ods_observations set parameters = 'Tractor Model' , sequence = 17 where parameters = 'tractor_model'; + update fw_ods.fw_ods_observations set parameters = 'Range Gear Shifting' , sequence = 18 where parameters = 'range_gear_shifting'; + update fw_ods.fw_ods_observations set parameters = 'Speed Gear Shifting' , sequence = 19 where parameters = 'speed_gear_shifting'; + + DELETE FROM fw_ods.fw_ods_observations WHERE parameters IS null; + + update fw_ods.fw_ods_observations set test_file_id = i.file_syspk where test_file_id is null; + + update fw_ods.fw_ods_observations set test_iteration_number = i.test_iteration_number where test_file_id = __file_syspk and __file_syspk=i.file_syspk and test_iteration_number is null; + + update fw_ods.fw_ods_observations c set + client_id=a.client_id, + function_id = a.function_id, + test_file_mnemonic = a.file_mnemonic, + test_sheet_mnemonic = a.file_sheet_mnemonic, + display_yn = 'Y' + from transactional.field_perf_summary a + where a.file_syspk = __file_syspk + and c.test_file_id =a.file_syspk; +--end if; +end loop; +--end loop; -for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_mnemonic like 'FT%' + +for i in select distinct test_file_id, test_iteration_number from fw_ods.fw_ods_observations where test_file_mnemonic = 'FTHLG' and tractor_model is null + loop - insert into fw_ods.fw_ods_observations - ( - client_id , - function_id , - test_file_mnemonic , - test_sheet_mnemonic , - test_file_id , - test_file_name , - test_iteration_number , - --platform , - --benchmark_yn , - tractor_make , - tractor_model , - tractor_engine_hp , - wheel_drive_type , - name_of_implement , - type_of_implement , - season , - engine_smoke_on_load, - engine_acceleration_smoke , - range_gear_shifting , - speed_gear_shifting , - draft_response , - tractor_steer_ability , - tractor_braking_performance , - front_visibility , - implement_accessibility , - front_wheel_dragging_at_turning , - front_end_lifting_during_operation , - rpm_recovery_time , - engine_vibration , - engine_sound , - implement_lifing_lowering_response , - pulverization_quality , - pulverization_index - ) - - select - a.client_id , - a.function_id , - a.file_mnemonic, - a.file_sheet_mnemonic , - b.file_syspk , - a.test_file_name , - b.test_iteration_number , - --platform , - --benchmark_yn , - b.tractor_make , - b.tractor_model , - d.tractor_engine_hp , - d.wheel_drive_type , - c.name_of_implement , - c.type_of_implement , - concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',a.season) AS "Month Name", - b.engine_smoke_on_load, - b.engine_acceleration_smoke , - b.range_gear_shifting , - b.speed_gear_shifting , - b.draft_response , - b.tractor_steer_ability , - b.tractor_braking_perf , - b.front_visibility , - b.implement_accessibility , - b.front_wheel_dragging_at_turning , - b.front_end_lifting_during_operation , - b.rpm_recovery_time , - b.engine_vibration , - b.engine_sound , - b.implement_lifting_per_lowering_response, - b.pulverization_quality , - b.pulverization_index - from - transactional.test_instance a, - transactional.field_perf_summary b, - transactional.test_instance_implement_info c , - transactional.test_instance_tractor_info d - where - a.file_syspk= b.file_syspk - and b.file_syspk = c.file_syspk - and c.file_syspk = d.file_syspk - and d.tractor_model = b.tractor_model - and a.file_mnemonic in ('FTDRY','FTWET') - and a.file_syspk = __file_syspk; - + SELECT distinct num_nulls(value1,value2,value3,value4,value5) as nullcount + FROM fw_ods.fw_ods_observations + WHERE test_file_id= i.test_file_id and "sequence" = 1 + and test_iteration_number = i.test_iteration_number + into null_count; - insert into fw_ods.fw_ods_observations - ( - client_id , - function_id , - test_file_mnemonic , - test_sheet_mnemonic , - test_file_id , - test_file_name , - test_iteration_number , - --platform , - --benchmark_yn , - tractor_make , - tractor_model , - tractor_engine_hp , - wheel_drive_type , - name_of_implement , - type_of_implement , - season , - engine_smoke_on_load, - engine_acceleration_smoke , - range_gear_shifting , - speed_gear_shifting , - draft_response , - tractor_steer_ability , - tractor_braking_performance , - front_visibility , - implement_accessibility , - front_wheel_dragging_at_turning , - front_end_lifting_during_operation , - rpm_recovery_time , - engine_vibration , - engine_sound , - implement_lifing_lowering_response , - pulverization_quality , - pulverization_index - ) - select - a.client_id , - a.function_id , - a.file_mnemonic, - a.file_sheet_mnemonic , - b.file_syspk , - a.test_file_name , - b.test_iteration_number , - --platform , - --benchmark_yn , - b.tractor_make , - b.tractor_model , - d.tractor_engine_hp , - d.wheel_drive_type , - 'Trailer', - c.trailer_type , - concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( - TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' - ))) AS "Month Name", - b.engine_smoke_on_load, - b.engine_acceleration_smoke , - b.range_gear_shifting , - b.speed_gear_shifting , - b.draft_response , - b.tractor_steer_ability , - b.tractor_braking_perf , - b.front_visibility , - b.implement_accessibility , - b.front_wheel_dragging_at_turning , - b.front_end_lifting_during_operation , - b.rpm_recovery_time , - b.engine_vibration , - b.engine_sound , - b.implement_lifting_per_lowering_response, - b.pulverization_quality , - b.pulverization_index - from - transactional.test_instance a, - transactional.field_perf_summary b, - transactional.field_perf_summary_trailer_info c , - transactional.test_instance_tractor_info d - where - a.file_syspk= b.file_syspk - and b.file_syspk = c.file_syspk - and c.file_syspk = d.file_syspk - and d.tractor_model = b.tractor_model - and a.file_mnemonic= 'FTHLG' - and a.file_syspk = __file_syspk; + +-- for repeating +while counter <= (total_count-null_count.nullcount) +loop + insert into fw_ods.fw_ods_observations( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_file_name, + test_iteration_number, + tractor_model, + name_of_implement, + type_of_implement, + season, + test_date_year, + parameters, + "sequence", + value1, + value2, + value3, + value4, + value5, + display_yn, + created_by, + create_timestamp ) + + select + a.client_id, + a.function_id, + a.test_file_mnemonic, + a.test_sheet_mnemonic, + a.test_file_id, + b.test_file_name, + a.test_iteration_number, + (case + when counter = 1 then (select distinct value1 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 2 then (select distinct value2 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 3 then (select distinct value3 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 4 then (select distinct value4 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 5 then (select distinct value5 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + end), + 'Trailer', + d.type_of_trailer, + concat(lpad(extract( month from b.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from b.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", + extract( year from b.date_of_test), + a.parameters, + a."sequence", + a.value1, + a.value2, + a.value3, + a.value4, + a.value5, + a.display_yn, + current_user, + current_timestamp + from fw_ods.fw_ods_observations a, + transactional.test_instance b, + transactional.test_instance_trailer_info d + where + a.test_file_id = b.file_syspk + and a.test_file_id = d.file_syspk + and a.test_file_id = i.test_file_id + and a.test_iteration_number = i.test_iteration_number + and a.tractor_model is null; + + update fw_ods.fw_ods_observations set tractor_engine_hp = e.tractor_engine_hp , wheel_drive_type=e.wheel_drive_type from transactional.test_instance_tractor_info e where fw_ods.fw_ods_observations.tractor_model= e.tractor_model and test_file_id = e.file_syspk ; + + update fw_ods.fw_ods_observations + set tractor_make = x.tractor_make + from transactional.test_instance_tractor_info x + where fw_ods.fw_ods_observations.tractor_model =x.tractor_model and fw_ods.fw_ods_observations.test_file_id= x.file_syspk and fw_ods.fw_ods_observations.test_file_id= __file_syspk; + + counter := counter + 1; + +update fw_ods.fw_ods_observations a +set +gear_used = b.gear_used_on_straight_road +--speed_rpm = b.engine_rpm_set +from transactional.field_perf_summary b +where a.test_file_id = b.file_syspk +and a.tractor_model = b.tractor_model +and a.test_iteration_number = b.test_iteration_number +and a.test_file_mnemonic = b.file_mnemonic +and a.test_sheet_mnemonic = b.file_sheet_mnemonic +and b.file_mnemonic in ('FTHLG') +and a.test_iteration_number = i.test_iteration_number +and b.file_syspk = i.test_file_id; + + end loop; + counter :=1; +end loop; + + +for i in select distinct test_file_id, test_iteration_number from fw_ods.fw_ods_observations where test_file_mnemonic = 'FTWET' and tractor_model is null + +loop + + SELECT distinct num_nulls(value1,value2,value3,value4,value5) as nullcount + FROM fw_ods.fw_ods_observations + WHERE test_file_id= i.test_file_id and "sequence" = 1 + and test_iteration_number = i.test_iteration_number + into null_count; + +-- for repeating +while counter <= (total_count-null_count.nullcount) +loop + insert into fw_ods.fw_ods_observations( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_file_name, + test_iteration_number, + tractor_model, + name_of_implement, + type_of_implement, + season, + test_date_year, + parameters, + "sequence", + value1, + value2, + value3, + value4, + value5, + display_yn, + created_by, + create_timestamp ) + select + a.client_id, + a.function_id, + a.test_file_mnemonic, + a.test_sheet_mnemonic, + a.test_file_id, + b.test_file_name, + a.test_iteration_number, + (case + when counter = 1 then (select distinct value1 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 2 then (select distinct value2 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 3 then (select distinct value3 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 4 then (select distinct value4 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 5 then (select distinct value5 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + end), -end loop; + d.name_of_implement, + d.type_of_implement, + concat(lpad(extract( month from b.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from b.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", + extract( year from b.date_of_test), + a.parameters, + a."sequence", + a.value1, + a.value2, + a.value3, + a.value4, + a.value5, + a.display_yn, + current_user, + current_timestamp + from fw_ods.fw_ods_observations a, + transactional.test_instance b, + transactional.test_instance_implement_info d + + where + a.test_file_id = b.file_syspk + and a.test_file_id = i.test_file_id +-- and a.test_file_id = null_count.test_file_id + and a.test_file_id = d.file_syspk + and a.test_iteration_number = i.test_iteration_number + and a.tractor_model is null; + + update fw_ods.fw_ods_observations set tractor_engine_hp = e.tractor_engine_hp , wheel_drive_type=e.wheel_drive_type from transactional.test_instance_tractor_info e where fw_ods.fw_ods_observations.tractor_model= e.tractor_model and test_file_id = e.file_syspk ; + + update fw_ods.fw_ods_observations + set tractor_make = x.tractor_make + from transactional.test_instance_tractor_info x + where fw_ods.fw_ods_observations.tractor_model =x.tractor_model and fw_ods.fw_ods_observations.test_file_id= x.file_syspk and fw_ods.fw_ods_observations.test_file_id= __file_syspk; + + + +update fw_ods.fw_ods_observations a +set +gear_used = b.gear_used, +speed_rpm = b.engine_rpm_set +from transactional.field_perf_summary b +where a.test_file_id = b.file_syspk +and a.tractor_model = b.tractor_model +and a.test_iteration_number = b.test_iteration_number +and a.test_file_mnemonic = b.file_mnemonic +and a.test_sheet_mnemonic = b.file_sheet_mnemonic +and b.file_mnemonic in ('FTDRY', 'FTWET') +and a.test_iteration_number = i.test_iteration_number +and b.file_syspk = i.test_file_id; + counter := counter + 1; + end loop; + counter :=1; +end loop; + + + +for i in select distinct test_file_id, test_iteration_number from fw_ods.fw_ods_observations where test_file_mnemonic = 'FTDRY' and tractor_model is null + +loop + + SELECT distinct num_nulls(value1,value2,value3,value4,value5) as nullcount + FROM fw_ods.fw_ods_observations + WHERE test_file_id= i.test_file_id and "sequence" = 1 + and test_iteration_number = i.test_iteration_number + into null_count; + +-- for repeating +while counter <= (total_count-null_count.nullcount) +loop + insert into fw_ods.fw_ods_observations( + client_id, + function_id, + test_file_mnemonic, + test_sheet_mnemonic, + test_file_id, + test_file_name, + test_iteration_number, + tractor_model, + name_of_implement, + type_of_implement, + season, + test_date_year, + parameters, + "sequence", + value1, + value2, + value3, + value4, + value5, + display_yn, + created_by, + create_timestamp ) + select + a.client_id, + a.function_id, + a.test_file_mnemonic, + a.test_sheet_mnemonic, + a.test_file_id, + b.test_file_name, + a.test_iteration_number, + (case + when counter = 1 then (select distinct value1 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 2 then (select distinct value2 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 3 then (select distinct value3 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 4 then (select distinct value4 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + when counter = 5 then (select distinct value5 from fw_ods.fw_ods_observations WHERE "sequence" = 1 and test_file_id=i.test_file_id and test_iteration_number = i.test_iteration_number ) + end), + + d.name_of_implement, + d.type_of_implement, + concat(lpad(extract( month from b.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from b.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", + extract( year from b.date_of_test), + a.parameters, + a."sequence", + a.value1, + a.value2, + a.value3, + a.value4, + a.value5, + a.display_yn, + current_user, + current_timestamp + from fw_ods.fw_ods_observations a, + transactional.test_instance b, + transactional.test_instance_implement_info d + + where + a.test_file_id = b.file_syspk + and a.test_file_id = i.test_file_id +-- and a.test_file_id = null_count.test_file_id + and a.test_file_id = d.file_syspk + and a.test_iteration_number = i.test_iteration_number + and a.tractor_model is null; + + update fw_ods.fw_ods_observations set tractor_engine_hp = e.tractor_engine_hp , wheel_drive_type=e.wheel_drive_type from transactional.test_instance_tractor_info e where fw_ods.fw_ods_observations.tractor_model= e.tractor_model and test_file_id = e.file_syspk ; + + update fw_ods.fw_ods_observations + set tractor_make = x.tractor_make + from transactional.test_instance_tractor_info x + where fw_ods.fw_ods_observations.tractor_model =x.tractor_model and fw_ods.fw_ods_observations.test_file_id= x.file_syspk and fw_ods.fw_ods_observations.test_file_id= __file_syspk; + + counter := counter + 1; + + + +update fw_ods.fw_ods_observations a +set +gear_used = b.gear_used, +speed_rpm = b.engine_rpm_set +from transactional.field_perf_summary b +where a.test_file_id = b.file_syspk +and a.tractor_model = b.tractor_model +and a.test_iteration_number = b.test_iteration_number +and a.test_file_mnemonic = b.file_mnemonic +and a.test_sheet_mnemonic = b.file_sheet_mnemonic +and b.file_mnemonic in ('FTDRY', 'FTWET') +and a.test_iteration_number = i.test_iteration_number +and b.file_syspk = i.test_file_id; + + end loop; + counter :=1; +end loop; + + + delete from fw_ods.fw_ods_observations where tractor_model is null; + perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_observations_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); +/* EXCEPTION when OTHERS then @@ -209,6 +432,7 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_observations_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); +*/ end -$$ LANGUAGE plpgsql; \ No newline at end of file +$$ LANGUAGE plpgsql; diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_load.sql old mode 100644 new mode 100755 index 47a0069..238dfaa --- a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_load.sql +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_load.sql @@ -20,7 +20,7 @@ AS $$ begin -- Adding data to file fw_ods_field: for f in select distinct file_mnemonic from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' + where latest_runschedule_flag = '1' and end_status = 'success' and end_status_note = 'TRX_completed' and file_syspk = __file_syspk loop if f.file_mnemonic LIKE 'PTO%' then @@ -272,6 +272,7 @@ then engine_speed_var, power_hp, torque_kg_m, + sfc_gms_per_hp_hr, fuelling_mm3_per_stroke_per_cyl -- audit fields -- validate how it is being done @@ -315,6 +316,7 @@ then a.power_hp, -- test specific measures a.torque_kg_m, + a.sfc_gm_per_hp_hr, a.fuelling_mm3_per_stroke_per_cyl -- add user and timestamp fields from transactional.pto_perf_governing_graph a, transactional.test_instance_tractor_info b,transactional.test_instance d @@ -343,7 +345,7 @@ then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_pto_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); - +/* EXCEPTION when OTHERS then @@ -358,7 +360,7 @@ EXCEPTION when OTHERS then perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_pto_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); - +*/ end $$ LANGUAGE plpgsql; diff --git a/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_observation_load.sql b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_observation_load.sql new file mode 100755 index 0000000..cc3a4da --- /dev/null +++ b/onetime/dataloadfunctions/ODS_Load/fn_fw_ods_pto_observation_load.sql @@ -0,0 +1,198 @@ +CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_pto_observations_load(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 + f record; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_mnemonic text :=p_file_mnemonic; + declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare err_state text; + declare err_msg text; + declare err_detail text; + declare err_hint text; + declare err_context text; + declare _error int; + +begin +insert into fw_ods.fw_ods_observations( +client_id, +function_id, +test_file_mnemonic, +test_sheet_mnemonic, +test_file_id, +test_file_name, +--platform, +--benchmark_yn, +tractor_make, +tractor_model, +tractor_engine_hp, +wheel_drive_type, +configuration, +season, +test_date_year, +sequence, +parameters, +value1, +value2, +--display_yn, +created_by, +updated_by, +create_timestamp, +update_timestamp +) +select +a.client_id, +a.function_Id, +a.file_mnemonic, +a.file_sheet_mnemonic, +a.file_syspk, +a.test_file_name, +b.tractor_make, +b.tractor_model, +b.tractor_engine_hp, +b.wheel_drive_type, +b.configuration, +concat(lpad(extract( month from a.date_of_test)::text,2,'0'),'-',(TO_CHAR( + TO_DATE (extract( month from a.date_of_test)::text, 'MM'), 'Month' + ))) AS "Month Name", +extract( year from a.date_of_test), +unnest(Array[ +'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30']::int[]), +unnest(Array[ +'Tractor Serial Number', +'Tractor Emission', +'Test Standard', +'Test mode', +'PTO Gear Ratio', +'Specific Gravity of Fuel (kg/m3)', +'PTO Power (hp)', +'PTO Power (kw)', +'PTO SFC (gm/hp.hr)', +'PTO SFC (Kg/kw.hr)', +'% of Backup Torque', +'Max Equ Crankshaft Torque (Nm)', +'Equ Crankshaft Torque at Maximun Power (Nm)', +'Engine Speed at Max Equivalent Crankshaft Torque (rpm)', +'Rated Engine Speed', +'Max Torque Engine Speed', +'Engine High Idle Speed', +'Engine Low Idle Speed', +'Engine Oil Temp (degree-c)@NA', +'Coolant Temp (degree-c)@NA', +'Engine Oil Temp(degree-c)@HA', +'Coolant Temp (degree-c)HA', +'Ambient Pressure (Bar)', +'Ambient Pressure (mm of hg)', +'Back Pressure (Bar)', +'Back Pressure (mm of hg)', +'Engine Oil Pressure (bar)', +'Exhaust Temperature (c)', +'Relative Humidity %', +'Coolant (water) (% of total coolant capacity)' +]) as parameters, +unnest(Array[ +c.tractor_serial_number::text, +c.tractor_emission::text, +c.test_standard::text, +c.test_mode::text, +c.pto_gear_ratio::text, +c.specific_gravity_of_fuel_kg_per_m3::text, +c.pto_power_declared_hp::text, +c.pto_power_declared_kw::text, +c.pto_sfc_declared_gm_per_hp_hr::text, +c.pto_sfc_declared_kg_per_kw_hr::text, +c.pct_of_backup_torque_declared::text, +c.max_equ_crankshaft_torque_declared_nm::text, +c.equ_crankshaft_torque_at_max_power_declared_nm::text, +c.engine_speed_at_max_equ_crankshaft_torque_declared_rpm::text, +c.rated_engine_speed_declared_rpm::text, +c.max_torque_engine_speed_declared_rpm::text, +c.engine_high_idle_speed_declared_rpm::text, +c.engine_low_idle_speed_declared_rpm::text, +c.engine_oil_temp_at_na_declared_c::text, +c.coolant_temp_at_na_declared_c::text, +c.engine_oil_temp_at_ha_declared_c::text, +c.coolant_temp_at_ha_declared_c::text, +c.ambient_pressure_declared_bar::text, +c.ambient_pressure_declared_mm_of_hg::text, +c.back_pressure_declared_bar::text, +c.back_pressure_declared_mm_of_hg::text, +c.engine_oil_pressure_declared_bar::text, +c.exhaust_temp_declared_c::text, +c.relative_humidity_declared_pct::text, +c.coolant_water_pct_of_total_coolant_capacity_declared::text +]) as value1, +unnest(Array[ +null, +null, +null, +null, +null, +null, +c.pto_power_observed_hp::text, +c.pto_power_observed_kw::text, +c.pto_sfc_observed_gm_per_hp_hr::text, +c.pto_sfc_observed_kg_per_kw_hr::text, +c.pct_of_backup_torque_observed::text, +c.max_equ_crankshaft_torque_observed_nm::text, +c.equ_crankshaft_torque_at_max_power_observed_nm::text, +c.engine_speed_at_max_equ_crankshaft_torque_observed_rpm::text, +c.rated_engine_speed_observed_rpm::text, +c.max_torque_engine_speed_observed_rpm::text, +c.engine_high_idle_speed_observed_rpm::text, +c.engine_low_idle_speed_observed_rpm::text, +c.engine_oil_temp_at_na_observed_c::text, +c.coolant_temp_at_na_observed_c::text, +c.engine_oil_temp_at_ha_observed_c::text, +c.coolant_temp_at_ha_observed_c::text, +c.ambient_pressure_observed_bar::text, +c.ambient_pressure_observed_mm_of_hg::text, +c.back_pressure_observed_bar::text, +c.back_pressure_observed_mm_of_hg::text, +c.engine_oil_pressure_observed_bar::text, +c.exhaust_temp_observed_c::text, +c.relative_humidity_observed_pct::text, +c.coolant_water_pct_of_total_coolant_capacity_observed::text +]) as value2, +current_user, +current_user, +current_timestamp, +current_timestamp +from +transactional.test_instance a, +transactional.test_instance_tractor_info b, +transactional.pto_key_perf_parameters c +where + a.file_syspk = b.file_syspk + and b.file_syspk = c.file_syspk + and a.file_mnemonic = b.file_mnemonic + and a.file_mnemonic = c.file_mnemonic + and a.file_sheet_mnemonic = b.file_sheet_mnemonic + and a.file_sheet_mnemonic = c.file_sheet_mnemonic + and b.tractor_model = c.tractor_model + and a.file_syspk =__file_syspk; + +err_context :=''; +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'success'); +/* +EXCEPTION when OTHERS then + + err_state = returned_sqlstate, /* P0002 */ + err_msg = message_text, /* No Data in FTDRY */ + err_detail = pg_exception_detail, /* No data in table t_test_new */ + err_hint = pg_exception_hint, /* No data error capture */ + err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/ + + +perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'ods', 'fn_fw_ods_comments_load', err_state, err_msg, err_detail, err_hint, err_context,'error'); + +*/ + + +end +$$ +LANGUAGE plpgsql; diff --git a/onetime/dataloadfunctions/PTO/PTO_GVG_ods.sql b/onetime/dataloadfunctions/PTO/PTO_GVG_ods.sql old mode 100644 new mode 100755 diff --git a/onetime/dataloadfunctions/PTO/PTO_GVG_stg2.sql b/onetime/dataloadfunctions/PTO/PTO_GVG_stg2.sql old mode 100644 new mode 100755 diff --git a/onetime/dataloadfunctions/budni/BUDNI_NMT_STG2.sql b/onetime/dataloadfunctions/budni/BUDNI_NMT_STG2.sql index 6ae95db..973c941 100755 --- a/onetime/dataloadfunctions/budni/BUDNI_NMT_STG2.sql +++ b/onetime/dataloadfunctions/budni/BUDNI_NMT_STG2.sql @@ -1,5 +1,4 @@ -drop function if exists staging2.fn_BUDNI_NMT_Block ; -CREATE OR REPLACE FUNCTION staging2.fn_BUDNI_NMT_Block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int) +CREATE OR REPLACE FUNCTION staging2.fn_budni_nmt_block(p_client_id integer, p_function_id integer, p_file_mnemonic text, p_file_sheet_mnemonic text, p_file_syspk integer) RETURNS void LANGUAGE plpgsql AS $function$ @@ -125,7 +124,6 @@ order by a.row_number'; - execute 'insert into staging2.stg_process_table_BUDNI_NMT select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag from staging2.stg_specific_table_BUDNI_NMT a @@ -197,7 +195,7 @@ and b.block_row_number=5 and a.file_syspk=b.file_syspk; -perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_NMT_Spec_H1_Block'); +perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_NMT_Spec_H1_block'); /* blocks data loading - BUDNI_NMT_noise_at_bystander_position_block */ @@ -216,7 +214,6 @@ column8,column9,block_row_number from staging2.stg_process_table_BUDNI_NMT a where block_tag ='BUDNI_NMT_Noise_at_bystander’s_position'; - update staging2.BUDNI_NMT_noise_at_bystander_position_block set column2=column3 where block_row_number=1; @@ -277,7 +274,7 @@ update staging2.BUDNI_NMT_Atmos_Cond_1_Block set trx_record=0 where block_row_number in (1,2,3); -perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_NMT_Atmos_Cond_1_Block '); +perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_NMT_Atmos_Cond_1_Block'); @@ -315,7 +312,7 @@ file_syspk='||p_file_syspk||', file_mnemonic='''||p_file_mnemonic||''', file_sheet_mnemonic='''||p_file_sheet_mnemonic||''''; -perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_NMT_Meas_Results_1_Block '); +perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_NMT_Meas_Results_1_Block'); /* blocks data loading - BUDNI_NMT_Noise_at_operator_ear_level_block */ @@ -462,8 +459,3 @@ perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compege end $function$ ; - - - - - diff --git a/onetime/dataloadfunctions/field/FTWET_SUM_ods.sql b/onetime/dataloadfunctions/field/FTWET_SUM_ods.sql index e413c85..da04326 100755 --- a/onetime/dataloadfunctions/field/FTWET_SUM_ods.sql +++ b/onetime/dataloadfunctions/field/FTWET_SUM_ods.sql @@ -155,9 +155,9 @@ depth_of_cut_cm, fuel_consumption_lit_per_hr, area_covered_acr_per_hr, fuel_consumption_lit_per_acr, - fuel_consumption_var_lit_per_hr, -area_covered_var_acr_per_hr, -fuel_consumption_var_lit_per_acr, + fuel_consumption_var_pct_lit_per_hr, +area_covered_var_pct_acr_per_hr, +fuel_consumption_var_pct_lit_per_acr, Engine_Smoke_on_Load, Engine_acceleration_smoke, Draft_Response, @@ -199,9 +199,9 @@ Avg_Depth_of_cut_cm depth_of_cut_cm , Fuel_consumption_lit_hr::numeric fuel_consumption_lit_per_hr, Area_covered_acr_hr::numeric area_covered_acr_per_hr, Fuel_consumption_lit_Acr::numeric fuel_consumption_lit_per_acr, -case when fuel_consumption_lit_hr_2 ~ E'^\\d+$' then fuel_consumption_lit_hr_2::numeric else null end as fuel_consumption_var_lit_per_hr , -case when area_covered_acr_hr_2 ~ E'^\\d+$' then area_covered_acr_hr_2::numeric else null end as area_covered_var_acr_per_hr , -case when fuel_consumption_lit_acr_2 ~ E'^\\d+$' then fuel_consumption_lit_acr_2::numeric else null end as fuel_consumption_var_lit_per_acr, +fuel_consumption_lit_hr_2::numeric as fuel_consumption_var_lit_per_hr , +area_covered_acr_hr_2::numeric as area_covered_var_acr_per_hr , +fuel_consumption_lit_acr_2::numeric as fuel_consumption_var_lit_per_acr, Engine_Smoke_on_Load, Engine_acceleration_smoke, Draft_Response, diff --git a/onetime/wrappers/master_wrapper.sql b/onetime/wrappers/master_wrapper_v1.sql similarity index 95% rename from onetime/wrappers/master_wrapper.sql rename to onetime/wrappers/master_wrapper_v1.sql index 11016ba..2668bbf 100755 --- a/onetime/wrappers/master_wrapper.sql +++ b/onetime/wrappers/master_wrapper_v1.sql @@ -13,6 +13,19 @@ CREATE OR REPLACE FUNCTION fw_core.fn_run_master_wrapper(p_client_id int,p_funct w_client_id int := p_client_id; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + -- update fw_core.fw_jobctl_runschedule_jobstep set begin_status='started',start_time=now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1'; for f in select distinct file_syspk,file_mnemonic,file_sheet_mnemonic,sheet_id @@ -104,8 +117,11 @@ end if; err_file_syspk := f.file_syspk; continue; end if; + + + -perform archive.fn_run_block_archive(w_client_id, w_function_id); +perform archive.fn_run_block_archive(w_client_id, w_function_id,f.file_mnemonic); --run transactional scripts depending on sheet mnemonic if f.file_sheet_mnemonic = 'FTDRY_TRS' then @@ -172,6 +188,10 @@ perform archive.fn_run_block_archive(w_client_id, w_function_id); perform fw_core.fn_get_function_exception('staging2.fn_IHTBTD_BTD_TRX ('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')'); else perform fw_core.fn_insert_db_error ( w_client_id, w_function_id, 1001, 'Compegence', f.file_syspk ,f.file_mnemonic, f.file_sheet_mnemonic ,null,'TRX wrapper', 'unknown TRX', null, 'no script found', null, null, null,'error'); end if; + +perform fw_core.fn_get_function_exception('transactional.fn_run_updates('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')'); + + -- check if transactional script ran correctly and update fw_jobctl_file_sheet_runschedule table. select e.status from fw_core.db_run_status e where file_syspk = f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic and staging_type = 'trx' order by error_timestamp desc into TRX_status; if TRX_status = 'success' then @@ -190,16 +210,20 @@ end if; end loop; -perform transactional.fn_run_updates(w_client_id, w_function_id); + +--perform transactional.fn_run_updates(w_client_id, w_function_id,f.file_syspk); + +--perform fw_core.fn_get_function_exception('transactional.fn_run_updates('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')'); + -- update fw_jobctl_file_runschedule table. -update fw_core.fw_jobctl_file_runschedule set end_status_note = 'stg2_failed', end_status='error',staging_type = 'stg2',end_time=now() from fw_core.fw_jobctl_file_sheet_runschedule a -where a.latest_runschedule_flag = '1' and a.end_status = 'error' and a.end_status_note = 'stg2_failed' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk; - update fw_core.fw_jobctl_file_runschedule set end_status_note = 'TRX_completed', end_status='success',staging_type = 'trx',end_time=now() from fw_core.fw_jobctl_file_sheet_runschedule a where a.latest_runschedule_flag = '1' and a.end_status = 'success' and a.end_status_note ='TRX_completed' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk; +update fw_core.fw_jobctl_file_runschedule set end_status_note = 'stg2_failed', end_status='error',staging_type = 'stg2',end_time=now() from fw_core.fw_jobctl_file_sheet_runschedule a +where a.latest_runschedule_flag = '1' and a.end_status = 'error' and a.end_status_note = 'stg2_failed' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk; + update fw_core.fw_jobctl_file_runschedule set end_status_note = 'TRX_failed', end_status='error',staging_type = 'trx' ,end_time=now() from fw_core.fw_jobctl_file_sheet_runschedule a where a.latest_runschedule_flag = '1' and a.end_status = 'error' and a.end_status_note = 'TRX_failed' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk; @@ -212,7 +236,5 @@ else update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'trx_failed', end_status='success', end_time=now() where job_id = w_job_id and step_id = w_step_id and latest_runschedule_flag = '1'; end if; - - end; $$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/onetime/wrappers/wrapper.sql b/onetime/wrappers/wrapper.sql deleted file mode 100755 index eae3500..0000000 --- a/onetime/wrappers/wrapper.sql +++ /dev/null @@ -1,163 +0,0 @@ - - -CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_load(p_client_id int,p_function_id int,p_job_id int,p_step_id int) - RETURNS void -AS $$ - declare - f record; - w_job_id int := p_job_id; - w_step_id int := p_step_id; - w_function_id int := p_function_id; - w_client_id int := p_client_id; - w_file_sheet_mnemonic text := 'Sheets'; - -begin - -for f in select distinct file_syspk, file_mnemonic - from fw_core.fw_jobctl_file_runschedule - where latest_runschedule_flag = '1' and - end_status = 'success' and - end_status_note = 'TRX_completed' - order by file_syspk -loop - - -if f.file_mnemonic in ('FTDRY', 'FTWET', 'FTHLG') -then - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_field_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_implement_details_update('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_comments_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - SET search_path To fw_ods; - drop extension tablefunc; - CREATE extension tablefunc; - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_observations_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - SET search_path To staging2; - drop extension tablefunc; - CREATE extension tablefunc; - - - - -elsif f.file_mnemonic ='PTO' then - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_PTO_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - -elsif f.file_mnemonic = 'BUDNI' then - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_budni_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - -elsif f.file_mnemonic in ('PTOBEN', 'PTOSTD') then - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_PTO_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - - -elsif f.file_mnemonic in ('IHTBT30','IHTBT50','IHTBTD','IHTCGM','IHTHAM','IHTEMT','IHTHLS','IHTNST','IHTSLL') then - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_IHT_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_detailed_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - - - -elsif f.file_mnemonic in ('DBOECD', 'DBSTD') then - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_drawbar_performance_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_drawbar_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); - - -end if; - - - -end loop; - - - update fw_ods.fw_ods set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); - - update fw_ods.fw_ods set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; - update fw_ods.fw_ods set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; - update fw_ods.fw_ods set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; - update fw_ods.fw_ods set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; - update fw_ods.fw_ods set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; - - -update fw_ods.fw_ods set "configuration" = m."configuration", -tractor_engine_hp = m.tractor_engine_hp, wheel_drive_type=m.wheel_drive_type,platform = m.platform,tractor_make = m.tractor_make -from fw_ods.tractor_info m where fw_ods.fw_ods.tractor_model = m.tractor_model; - - -update fw_ods.fw_ods_comments set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); - - update fw_ods.fw_ods_comments set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; - update fw_ods.fw_ods_comments set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; - update fw_ods.fw_ods_comments set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; - update fw_ods.fw_ods_comments set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; - update fw_ods.fw_ods_comments set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; - - -update fw_ods.fw_ods_drawbar_performance set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); - - update fw_ods.fw_ods_drawbar_performance set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; - update fw_ods.fw_ods_drawbar_performance set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; - update fw_ods.fw_ods_drawbar_performance set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; --- update fw_ods.fw_ods_drawbar_performance set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; ---update fw_ods.fw_ods_drawbar_performance set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; - - -update fw_ods.fw_ods_drawbar_performance set "configuration" = m."configuration", -tractor_engine_hp = m.tractor_engine_hp, wheel_drive_type=m.wheel_drive_type,platform = m.platform,tractor_make = m.tractor_make -from fw_ods.tractor_info m where fw_ods.fw_ods_drawbar_performance.tractor_model = m.tractor_model; - -update fw_ods.fw_ods_comments set "configuration" = m."configuration", -tractor_engine_hp = m.tractor_engine_hp, wheel_drive_type=m.wheel_drive_type,platform = m.platform,tractor_make = m.tractor_make -from fw_ods.tractor_info m where fw_ods.fw_ods_comments.tractor_model = m.tractor_model; - - -update fw_ods.fw_ods_detailed set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); - - update fw_ods.fw_ods_detailed set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; - update fw_ods.fw_ods_detailed set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; - update fw_ods.fw_ods_detailed set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; --- update fw_ods.fw_ods_detailed set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; - --update fw_ods.fw_ods_detailed set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; - - -update fw_ods.fw_ods_detailed set "configuration" = m."configuration", -tractor_engine_hp = m.tractor_engine_hp, wheel_drive_type=m.wheel_drive_type,platform = m.platform,tractor_make = m.tractor_make -from fw_ods.tractor_info m where fw_ods.fw_ods_detailed.tractor_model = m.tractor_model; - - - -update fw_ods.fw_ods_observations set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); - - update fw_ods.fw_ods_observations set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; - update fw_ods.fw_ods_observations set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; - update fw_ods.fw_ods_observations set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; - update fw_ods.fw_ods_observations set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; - update fw_ods.fw_ods_observations set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; - - -update fw_ods.fw_ods_observations set "configuration" = m."configuration", -tractor_engine_hp = m.tractor_engine_hp, wheel_drive_type=m.wheel_drive_type,platform = m.platform,tractor_make = m.tractor_make -from fw_ods.tractor_info m where fw_ods.fw_ods_observations.tractor_model = m.tractor_model; - - - -update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'TRX_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; - - diff --git a/onetime/wrappers/wrapper_BUDNI.sql b/onetime/wrappers/wrapper_BUDNI_v1.sql similarity index 91% rename from onetime/wrappers/wrapper_BUDNI.sql rename to onetime/wrappers/wrapper_BUDNI_v1.sql index c3921b1..dbf5ab6 100755 --- a/onetime/wrappers/wrapper_BUDNI.sql +++ b/onetime/wrappers/wrapper_BUDNI_v1.sql @@ -1,66 +1,81 @@ -drop function if exists staging2.fn_BUDNI_RUN; -CREATE OR REPLACE FUNCTION staging2.fn_BUDNI_RUN() - RETURNS void AS $$ - declare - f record; - w_file_syspk int; - status text; - begin - for f in select distinct a.file_syspk - from fw_core.fw_jobctl_file_runschedule a - where end_status like 'stg1-completed' and file_mnemonic='BUDNI' - loop - select f.file_syspk into w_file_syspk; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_ARC_Block(20,1,''BUDNI'',''BUDNI_ARC'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_ARC' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_ARC_TRX(20,1,''BUDNI'',''BUDNI_ARC'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_BRK_Block (20,1,''BUDNI'',''BUDNI_BRK'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_BRK' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_BRK_TRX(20,1,''BUDNI'',''BUDNI_BRK'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_DBP_Block (20,1,''BUDNI'',''BUDNI_DBP'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_DBP' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_DBP_TRX(20,1,''BUDNI'',''BUDNI_DBP'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_FLD_Block (20,1,''BUDNI'',''BUDNI_FLD'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_FLD' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_FLD_TRX(20,1,''BUDNI'',''BUDNI_FLD'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HDL_Block(20,1,''BUDNI'',''BUDNI_HDL'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_HDL' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HDL_TRX(20,1,''BUDNI'',''BUDNI_HDL'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HLG_Block(20,1,''BUDNI'',''BUDNI_HLG'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_HLG' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HLG_TRX(20,1,''BUDNI'',''BUDNI_HLG'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_LCG_Block(20,1,''BUDNI'',''BUDNI_LCG'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_LCG' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_LCG_TRX(20,1,''BUDNI'',''BUDNI_LCG'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_NMT_Block(20,1,''BUDNI'',''BUDNI_NMT'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_NMT' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_NMT_TRX(20,1,''BUDNI'',''BUDNI_NMT'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_PTO_Block(20,1,''BUDNI'',''BUDNI_PTO'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_PTO' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_PTO_TRX(20,1,''BUDNI'',''BUDNI_PTO'','||w_file_syspk||')'); - end if; - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_VMT_Block(20,1,''BUDNI'',''BUDNI_VMT'','||w_file_syspk||')'); - select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_VMT' order by error_timestamp desc into status; - if status = 'success' then - perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_VMT_TRX(20,1,''BUDNI'',''BUDNI_VMT'','||w_file_syspk||')'); - end if; - end loop; -end; -$$ LANGUAGE plpgsql; +drop function if exists staging2.fn_BUDNI_RUN; +CREATE OR REPLACE FUNCTION staging2.fn_BUDNI_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + + + for f in select distinct a.file_syspk + from fw_core.fw_jobctl_file_runschedule a + where end_status like 'stg1-completed' and file_mnemonic='BUDNI' + loop + select f.file_syspk into w_file_syspk; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_ARC_Block(20,1,''BUDNI'',''BUDNI_ARC'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_ARC' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_ARC_TRX(20,1,''BUDNI'',''BUDNI_ARC'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_BRK_Block (20,1,''BUDNI'',''BUDNI_BRK'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_BRK' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_BRK_TRX(20,1,''BUDNI'',''BUDNI_BRK'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_DBP_Block (20,1,''BUDNI'',''BUDNI_DBP'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_DBP' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_DBP_TRX(20,1,''BUDNI'',''BUDNI_DBP'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_FLD_Block (20,1,''BUDNI'',''BUDNI_FLD'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_FLD' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_FLD_TRX(20,1,''BUDNI'',''BUDNI_FLD'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HDL_Block(20,1,''BUDNI'',''BUDNI_HDL'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_HDL' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HDL_TRX(20,1,''BUDNI'',''BUDNI_HDL'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HLG_Block(20,1,''BUDNI'',''BUDNI_HLG'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_HLG' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HLG_TRX(20,1,''BUDNI'',''BUDNI_HLG'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_LCG_Block(20,1,''BUDNI'',''BUDNI_LCG'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_LCG' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_LCG_TRX(20,1,''BUDNI'',''BUDNI_LCG'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_NMT_Block(20,1,''BUDNI'',''BUDNI_NMT'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_NMT' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_NMT_TRX(20,1,''BUDNI'',''BUDNI_NMT'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_PTO_Block(20,1,''BUDNI'',''BUDNI_PTO'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_PTO' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_PTO_TRX(20,1,''BUDNI'',''BUDNI_PTO'','||w_file_syspk||')'); + end if; + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_VMT_Block(20,1,''BUDNI'',''BUDNI_VMT'','||w_file_syspk||')'); + select e.status from fw_core.db_run_status e where file_syspk = w_file_syspk and file_sheet_mnemonic ='BUDNI_VMT' order by error_timestamp desc into status; + if status = 'success' then + perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_VMT_TRX(20,1,''BUDNI'',''BUDNI_VMT'','||w_file_syspk||')'); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; diff --git a/onetime/wrappers/wrapper_DBOECD.sql b/onetime/wrappers/wrapper_DBOECD_v1.sql similarity index 65% rename from onetime/wrappers/wrapper_DBOECD.sql rename to onetime/wrappers/wrapper_DBOECD_v1.sql index e02a6a4..a995f94 100755 --- a/onetime/wrappers/wrapper_DBOECD.sql +++ b/onetime/wrappers/wrapper_DBOECD_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_DBOECD_RUN; CREATE OR REPLACE FUNCTION staging2.fn_DBOECD_RUN() RETURNS void AS $$ @@ -6,6 +7,20 @@ CREATE OR REPLACE FUNCTION staging2.fn_DBOECD_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='DBOECD' loop diff --git a/onetime/wrappers/wrapper_DBSTD.sql b/onetime/wrappers/wrapper_DBSTD_v1.sql similarity index 66% rename from onetime/wrappers/wrapper_DBSTD.sql rename to onetime/wrappers/wrapper_DBSTD_v1.sql index c460820..64ffd71 100755 --- a/onetime/wrappers/wrapper_DBSTD.sql +++ b/onetime/wrappers/wrapper_DBSTD_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_DBSTD_RUN; CREATE OR REPLACE FUNCTION staging2.fn_DBSTD_RUN() RETURNS void AS $$ @@ -6,6 +7,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_DBSTD_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='DBSTD' loop diff --git a/onetime/wrappers/wrapper_FTDRY.sql b/onetime/wrappers/wrapper_FTDRY_v1.sql similarity index 75% rename from onetime/wrappers/wrapper_FTDRY.sql rename to onetime/wrappers/wrapper_FTDRY_v1.sql index b75b68a..8f63234 100755 --- a/onetime/wrappers/wrapper_FTDRY.sql +++ b/onetime/wrappers/wrapper_FTDRY_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_FTDRY_RUN; CREATE OR REPLACE FUNCTION staging2.fn_FTDRY_RUN() RETURNS void AS $$ @@ -6,6 +7,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_FTDRY_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='FTDRY' loop diff --git a/onetime/wrappers/wrapper_FTHLG.sql b/onetime/wrappers/wrapper_FTHLG_v1.sql similarity index 73% rename from onetime/wrappers/wrapper_FTHLG.sql rename to onetime/wrappers/wrapper_FTHLG_v1.sql index 7bd2808..569da32 100755 --- a/onetime/wrappers/wrapper_FTHLG.sql +++ b/onetime/wrappers/wrapper_FTHLG_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_FTHLG_RUN; CREATE OR REPLACE FUNCTION staging2.fn_FTHLG_RUN() RETURNS void AS $$ @@ -6,6 +7,20 @@ CREATE OR REPLACE FUNCTION staging2.fn_FTHLG_RUN() w_file_syspk int; status text; begin + + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='FTHLG' loop diff --git a/onetime/wrappers/wrapper_FTWET.sql b/onetime/wrappers/wrapper_FTWET_v1.sql similarity index 73% rename from onetime/wrappers/wrapper_FTWET.sql rename to onetime/wrappers/wrapper_FTWET_v1.sql index f297049..1bedca9 100755 --- a/onetime/wrappers/wrapper_FTWET.sql +++ b/onetime/wrappers/wrapper_FTWET_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_FTWET_RUN; CREATE OR REPLACE FUNCTION staging2.fn_FTWET_RUN() RETURNS void AS $$ @@ -6,6 +8,20 @@ CREATE OR REPLACE FUNCTION staging2.fn_FTWET_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='FTWET' loop diff --git a/onetime/wrappers/wrapper_IHTBT30.sql b/onetime/wrappers/wrapper_IHTBT30_v1.sql similarity index 68% rename from onetime/wrappers/wrapper_IHTBT30.sql rename to onetime/wrappers/wrapper_IHTBT30_v1.sql index 3e562b5..1a9f6c5 100755 --- a/onetime/wrappers/wrapper_IHTBT30.sql +++ b/onetime/wrappers/wrapper_IHTBT30_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_IHTBT30_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTBT30_RUN() RETURNS void AS $$ @@ -6,6 +8,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTBT30_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTBT30' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTBT50.sql b/onetime/wrappers/wrapper_IHTBT50_v1.sql similarity index 68% rename from onetime/wrappers/wrapper_IHTBT50.sql rename to onetime/wrappers/wrapper_IHTBT50_v1.sql index ff96a53..624453d 100755 --- a/onetime/wrappers/wrapper_IHTBT50.sql +++ b/onetime/wrappers/wrapper_IHTBT50_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_IHTBT50_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTBT50_RUN() RETURNS void AS $$ @@ -6,6 +8,18 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTBT50_RUN() w_file_syspk int; status text; begin +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTBT50' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTBTD.sql b/onetime/wrappers/wrapper_IHTBTD_v1.sql similarity index 67% rename from onetime/wrappers/wrapper_IHTBTD.sql rename to onetime/wrappers/wrapper_IHTBTD_v1.sql index 77df592..ef36597 100755 --- a/onetime/wrappers/wrapper_IHTBTD.sql +++ b/onetime/wrappers/wrapper_IHTBTD_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_IHTBTD_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTBTD_RUN() RETURNS void AS $$ @@ -6,6 +8,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTBTD_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTBTD' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTCGM.sql b/onetime/wrappers/wrapper_IHTCGM_v1.sql similarity index 67% rename from onetime/wrappers/wrapper_IHTCGM.sql rename to onetime/wrappers/wrapper_IHTCGM_v1.sql index d380c6a..1c70ee0 100755 --- a/onetime/wrappers/wrapper_IHTCGM.sql +++ b/onetime/wrappers/wrapper_IHTCGM_v1.sql @@ -1,3 +1,6 @@ + + + drop function if exists staging2.fn_IHTCGM_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTCGM_RUN() RETURNS void AS $$ @@ -6,6 +9,18 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTCGM_RUN() w_file_syspk int; status text; begin +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTCGM' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTEMT.sql b/onetime/wrappers/wrapper_IHTEMT_v1.sql similarity index 75% rename from onetime/wrappers/wrapper_IHTEMT.sql rename to onetime/wrappers/wrapper_IHTEMT_v1.sql index b4ce046..f420d2e 100755 --- a/onetime/wrappers/wrapper_IHTEMT.sql +++ b/onetime/wrappers/wrapper_IHTEMT_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_IHTEMT_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTEMT_RUN() RETURNS void AS $$ @@ -6,6 +7,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTEMT_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTEMT' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTHAM.sql b/onetime/wrappers/wrapper_IHTHAM_v1.sql similarity index 67% rename from onetime/wrappers/wrapper_IHTHAM.sql rename to onetime/wrappers/wrapper_IHTHAM_v1.sql index 5039b52..084c90b 100755 --- a/onetime/wrappers/wrapper_IHTHAM.sql +++ b/onetime/wrappers/wrapper_IHTHAM_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_IHTHAM_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTHAM_RUN() RETURNS void AS $$ @@ -6,6 +8,20 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTHAM_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTHAM' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTHSL.sql b/onetime/wrappers/wrapper_IHTHSL_v1.sql similarity index 67% rename from onetime/wrappers/wrapper_IHTHSL.sql rename to onetime/wrappers/wrapper_IHTHSL_v1.sql index 7734b1c..3424bd4 100755 --- a/onetime/wrappers/wrapper_IHTHSL.sql +++ b/onetime/wrappers/wrapper_IHTHSL_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_IHTHSL_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTHSL_RUN() RETURNS void AS $$ @@ -6,6 +7,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTHSL_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTHSL' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTNST.sql b/onetime/wrappers/wrapper_IHTNST_v1.sql similarity index 67% rename from onetime/wrappers/wrapper_IHTNST.sql rename to onetime/wrappers/wrapper_IHTNST_v1.sql index c1e35bd..47fdff7 100755 --- a/onetime/wrappers/wrapper_IHTNST.sql +++ b/onetime/wrappers/wrapper_IHTNST_v1.sql @@ -1,3 +1,6 @@ + + + drop function if exists staging2.fn_IHTNST_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTNST_RUN() RETURNS void AS $$ @@ -6,6 +9,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTNST_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTNST' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_IHTSLL.sql b/onetime/wrappers/wrapper_IHTSLL_v1.sql similarity index 67% rename from onetime/wrappers/wrapper_IHTSLL.sql rename to onetime/wrappers/wrapper_IHTSLL_v1.sql index 9589805..90e02df 100755 --- a/onetime/wrappers/wrapper_IHTSLL.sql +++ b/onetime/wrappers/wrapper_IHTSLL_v1.sql @@ -1,3 +1,4 @@ + drop function if exists staging2.fn_IHTSLL_RUN; CREATE OR REPLACE FUNCTION staging2.fn_IHTSLL_RUN() RETURNS void AS $$ @@ -6,6 +7,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_IHTSLL_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic = 'IHTSLL' order by file_syspk loop diff --git a/onetime/wrappers/wrapper_PTOBEN.sql b/onetime/wrappers/wrapper_PTOBEN_v1.sql similarity index 85% rename from onetime/wrappers/wrapper_PTOBEN.sql rename to onetime/wrappers/wrapper_PTOBEN_v1.sql index ca7426d..354563a 100755 --- a/onetime/wrappers/wrapper_PTOBEN.sql +++ b/onetime/wrappers/wrapper_PTOBEN_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_PTOBEN_RUN; CREATE OR REPLACE FUNCTION staging2.fn_PTOBEN_RUN() RETURNS void AS $$ @@ -6,6 +8,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_PTOBEN_RUN() w_file_syspk int; status text; begin +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='PTOBEN' loop diff --git a/onetime/wrappers/wrapper_PTOSTD.sql b/onetime/wrappers/wrapper_PTOSTD_v1.sql similarity index 79% rename from onetime/wrappers/wrapper_PTOSTD.sql rename to onetime/wrappers/wrapper_PTOSTD_v1.sql index a4e6a55..04bc5e8 100755 --- a/onetime/wrappers/wrapper_PTOSTD.sql +++ b/onetime/wrappers/wrapper_PTOSTD_v1.sql @@ -1,3 +1,5 @@ + + drop function if exists staging2.fn_PTOSTD_RUN; CREATE OR REPLACE FUNCTION staging2.fn_PTOSTD_RUN() RETURNS void AS $$ @@ -6,6 +8,19 @@ CREATE OR REPLACE FUNCTION staging2.fn_PTOSTD_RUN() w_file_syspk int; status text; begin + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + for f in select file_syspk from fw_core.fw_jobctl_file_runschedule where end_status like 'stg1-completed' and file_mnemonic='PTOSTD' loop diff --git a/onetime/wrappers/wrapper_v1.sql b/onetime/wrappers/wrapper_v1.sql new file mode 100755 index 0000000..82a72eb --- /dev/null +++ b/onetime/wrappers/wrapper_v1.sql @@ -0,0 +1,223 @@ + + +CREATE OR REPLACE FUNCTION fw_ods.fn_fw_ods_load(p_client_id int,p_function_id int,p_job_id int,p_step_id int) + RETURNS void +AS $$ + declare + f record; + w_job_id int := p_job_id; + w_step_id int := p_step_id; + w_function_id int := p_function_id; + w_client_id int := p_client_id; + w_file_sheet_mnemonic text :=''; + error_count int :=0; + +begin + + +/**************************************************************** +******* ForeWarn Licensing and / or usage Terms and Conditions ****** +ForeWarn. The NextGen Insights Solution Platform + +Copyright 2021 COMPEGENCE. All Rights Reserved + +ForeWarn is a product of COMPEGENCE. +To be used only with a valid license from COMPEGENCE + +www.compegence.com info@compegence.com +****************************************************************/ + + +for f in select distinct file_syspk, file_mnemonic + from fw_core.fw_jobctl_file_runschedule + where latest_runschedule_flag = '1' and + end_status = 'success' and + end_status_note = 'TRX_completed' + order by file_syspk +loop + +if f.file_mnemonic in ('FTDRY', 'FTWET', 'FTHLG') +then + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_field_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_implement_details_update('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_comments_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_observations_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + + + +elsif f.file_mnemonic = 'BUDNI' then + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_budni_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + +elsif f.file_mnemonic in ('PTOBEN', 'PTOSTD') then + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_PTO_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_pto_observations_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + + +elsif f.file_mnemonic in ('IHTBT30','IHTBT50','IHTBTD','IHTCGM','IHTHAM','IHTEMT','IHTHLS','IHTNST','IHTSLL') then + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_IHT_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_detailed_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + + + +elsif f.file_mnemonic in ('DBOECD', 'DBSTD') then + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_drawbar_performance_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_drawbar_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_drawbar_observations_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + perform fw_core.fn_get_function_exception('fw_ods.fn_fw_ods_drawbar_comments_load('||w_client_id||','||w_function_id||','''||f.file_mnemonic||''','''||w_file_sheet_mnemonic||''','||f.file_syspk||')'); + + +end if; + +select count(status) from fw_core.db_run_status where file_syspk = f.file_syspk and file_mnemonic = f.file_mnemonic and staging_type = 'ods' and status = 'error' into error_count; +if error_count = 0 then +update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'ODS_completed', end_status='success',staging_type = 'ODS',end_time = now() + where file_syspk=f.file_syspk; +update fw_core.fw_jobctl_file_runschedule set end_status_note = 'ODS_completed', end_status='success',staging_type = 'ODS',end_time=now() +where latest_runschedule_flag = '1' and end_status_note ='TRX_completed' and file_syspk = f.file_syspk; + +else +update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'ODS_failed', end_status='error',staging_type = 'ODS',end_time = now() + where file_syspk=f.file_syspk; +update fw_core.fw_jobctl_file_runschedule set end_status_note = 'ODS_failed', end_status='error',staging_type = 'ODS',end_time=now() +where latest_runschedule_flag = '1' and end_status_note ='TRX_completed' and file_syspk = f.file_syspk; + +end if; + +end loop; + + +--fw_ods + update fw_ods.fw_ods set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); + + update fw_ods.fw_ods set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; + update fw_ods.fw_ods set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; + update fw_ods.fw_ods set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; + update fw_ods.fw_ods set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; + update fw_ods.fw_ods set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; + + +update fw_ods.fw_ods a set "configuration" = m."configuration" from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a."configuration" is null; +update fw_ods.fw_ods a set tractor_engine_hp = m.tractor_engine_hp from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_engine_hp is null; +update fw_ods.fw_ods a set wheel_drive_type=m.wheel_drive_type from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.wheel_drive_type is null; +update fw_ods.fw_ods a set platform = m.platform from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.platform is null; +update fw_ods.fw_ods a set tractor_make = m.tractor_make from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_make is null; + +--fw_ods_comments +update fw_ods.fw_ods_comments set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); + + update fw_ods.fw_ods_comments set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; + update fw_ods.fw_ods_comments set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; + update fw_ods.fw_ods_comments set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; + update fw_ods.fw_ods_comments set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; + update fw_ods.fw_ods_comments set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; + + + +update fw_ods.fw_ods_comments a set "configuration" = m."configuration" from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a."configuration" is null; +update fw_ods.fw_ods_comments a set tractor_engine_hp = m.tractor_engine_hp from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_engine_hp is null; +update fw_ods.fw_ods_comments a set wheel_drive_type=m.wheel_drive_type from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.wheel_drive_type is null; +update fw_ods.fw_ods_comments a set platform = m.platform from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.platform is null; +update fw_ods.fw_ods_comments a set tractor_make = m.tractor_make from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_make is null; + +--fw_ods_drawbar_observations + + +update fw_ods.fw_ods_drawbar_performance set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); + + update fw_ods.fw_ods_drawbar_performance set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; + update fw_ods.fw_ods_drawbar_performance set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; + update fw_ods.fw_ods_drawbar_performance set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; +-- update fw_ods.fw_ods_drawbar_performance set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; +--update fw_ods.fw_ods_drawbar_performance set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; + + +update fw_ods.fw_ods_drawbar_performance a set "configuration" = m."configuration" from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a."configuration" is null; +update fw_ods.fw_ods_drawbar_performance a set tractor_engine_hp = m.tractor_engine_hp from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_engine_hp is null; +update fw_ods.fw_ods_drawbar_performance a set wheel_drive_type=m.wheel_drive_type from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.wheel_drive_type is null; +update fw_ods.fw_ods_drawbar_performance a set platform = m.platform from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.platform is null; +update fw_ods.fw_ods_drawbar_performance a set tractor_make = m.tractor_make from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_make is null; + + +--fw_ods_detailed + +update fw_ods.fw_ods_detailed set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); + + update fw_ods.fw_ods_detailed set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; + update fw_ods.fw_ods_detailed set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; + update fw_ods.fw_ods_detailed set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; +-- update fw_ods.fw_ods_detailed set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; + --update fw_ods.fw_ods_detailed set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; + + + +update fw_ods.fw_ods_detailed a set "configuration" = m."configuration" from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a."configuration" is null; +update fw_ods.fw_ods_detailed a set tractor_engine_hp = m.tractor_engine_hp from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_engine_hp is null; +update fw_ods.fw_ods_detailed a set wheel_drive_type=m.wheel_drive_type from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.wheel_drive_type is null; +update fw_ods.fw_ods_detailed a set platform = m.platform from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.platform is null; +update fw_ods.fw_ods_detailed a set tractor_make = m.tractor_make from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_make is null; + + +--f_ods_observations +update fw_ods.fw_ods_observations set tractor_model=REGEXP_REPLACE(tractor_model,'\r|\n','','g'); + + update fw_ods.fw_ods_observations set tractor_make = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_make) = m.source_value ; + update fw_ods.fw_ods_observations set tractor_model = m.target_value from fw_ods.fw_ods_misnomer m where trim(tractor_model) = m.source_value ; + update fw_ods.fw_ods_observations set wheel_drive_type = m.target_value from fw_ods.fw_ods_misnomer m where trim(wheel_drive_type) = m.source_value ; + update fw_ods.fw_ods_observations set name_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(name_of_implement) = m.source_value ; + update fw_ods.fw_ods_observations set type_of_implement = m.target_value from fw_ods.fw_ods_misnomer m where trim(type_of_implement) = m.source_value ; + + + + +update fw_ods.fw_ods_observations a set "configuration" = m."configuration" from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a."configuration" is null; +update fw_ods.fw_ods_observations a set tractor_engine_hp = m.tractor_engine_hp from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_engine_hp is null; +update fw_ods.fw_ods_observations a set wheel_drive_type=m.wheel_drive_type from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.wheel_drive_type is null; +update fw_ods.fw_ods_observations a set platform = m.platform from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.platform is null; +update fw_ods.fw_ods_observations a set tractor_make = m.tractor_make from fw_ods.fw_ods_tractor_model_info m where a.tractor_model = m.tractor_model and a.tractor_make is null; + + + +-- Additional Updates: + +-- Gear Used: +update fw_ods.fw_ods set gear_used = m.target_value from fw_ods.fw_ods_misnomer m where trim(gear_used) = m.source_value; + +update fw_ods.fw_ods_comments set gear_used = m.target_value from fw_ods.fw_ods_misnomer m where trim(gear_used) = m.source_value; + +update fw_ods.fw_ods_drawbar_performance set gear_used = m.target_value from fw_ods.fw_ods_misnomer m where trim(gear_used) = m.source_value; + +update fw_ods.fw_ods_observations set gear_used = m.target_value from fw_ods.fw_ods_misnomer m where trim(gear_used) = m.source_value; + +-- Sensor body Location: + +update fw_ods.fw_ods set sensor_body_location = m.target_value from fw_ods.fw_ods_misnomer m where trim(sensor_body_location) = m.source_value; + + + + + + +update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'ODS_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; + + diff --git a/scripts/.file_move.sh.swp b/scripts/.file_move.sh.swp new file mode 100755 index 0000000..eb38014 Binary files /dev/null and b/scripts/.file_move.sh.swp differ diff --git a/scripts/Output.html b/scripts/Output.html new file mode 100755 index 0000000..98499a2 --- /dev/null +++ b/scripts/Output.html @@ -0,0 +1,36 @@ +

**Latest Files Update Status**

+ + + + + + + + + + + + + + + + + +
run_schedule_idfile_syspkfile_mnemonicfile_namestatusload_time
20245BUDNI20181002_BUDNI_MF 241 Planetary Plus V1.xlsxsuccess2021-08-27 06:32:58.220188
+

(1 row)
+

+

**Error Files*****

+ + + + + + + + + + + +
run_schedule_idfile_syspkfile_mnemonicfile_namesheet_idsheet_nameend_statusload_time
+

(0 rows)
+

diff --git a/scripts/Output.txt b/scripts/Output.txt new file mode 100755 index 0000000..d14926c --- /dev/null +++ b/scripts/Output.txt @@ -0,0 +1,57 @@ +--asdfghjkl +Content-Type: text/plain; charset=utf-8 + +Alerts for the job run status + +--asdfghjkl +Content-Type: text/html; charset=utf-8 + + + + + + + +

Mahindra TDMS - Latest Flles Update Status

+ + + + + + + + + + + + + + + + + +
run_schedule_idfile_syspkfile_mnemonicfile_namestatusload_time
70261FTDRY20210725_FTDRY_575 DI XP_45 HP_VS_SONALIKA_VS_POWERTRAC EURO 45 PLUS_ROTAVATOR_SHIVPURI.xlsxsuccess2021-10-28 08:38:25.586439
+

(1 row)
+

+ + + + +

Error Files

+ + + + + + + + + + + +
run_schedule_idfile_syspkfile_mnemonicfile_namesheet_idsheet_nameend_statusload_time
+

(0 rows)
+

+ + +--asdfghjkl diff --git a/scripts/check_duplicate_file.sh b/scripts/check_duplicate_file.sh index dfb0402..4289f6a 100755 --- a/scripts/check_duplicate_file.sh +++ b/scripts/check_duplicate_file.sh @@ -1,8 +1,24 @@ #!/bin/bash -e -HOME="/home/compegence/customer" + +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright © 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + + +#HOME="/home/compegence/customer" #Directories -homeDir=$HOME/MMT +fileDir="/data/customer/MMT" +homeDir=$HOME/customer/MMT configDir=$homeDir/conf input_file=$configDir/etl-config.txt declare -A credentials @@ -22,31 +38,33 @@ postgres_con="psql -A -t postgresql://$user:$password@$host/$db" $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note ='Initial', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" + count=`$postgres_con -c "select count(*) from fw_core.fw_jobctl_file_runschedule"` if [[ $count -eq 0 ]] then - $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note ='no_duplicate_file_found', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" + $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note ='file_found_to_process', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" else while IFS= read -a filenames do file_name=$(echo $filenames | sed 's/[[:space:]]/\\ /g') - if [[ -f $homeDir/files/landing/$filenames ]]; + if [[ -f $fileDir/files/landing/$filenames ]]; then echo "File: $file_name is already processed and is moved to Duplicate Folder" - move=$(echo "mv $homeDir/files/landing/$file_name $homeDir/files/duplicate_file/$file_name") + move=$(echo "mv $fileDir/files/landing/$file_name $fileDir/files/duplicate_file/$file_name") eval $move #update ctl table to exit for duplicate files $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note ='duplicate_file_found', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" else - $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'no_duplicate_file_found', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" - fi -done < <($postgres_con -c "select file_name from fw_core.fw_jobctl_file_runschedule where end_status_note='TRX_completed' and end_status ='success'") + + filecount=find $fileDir/files/landing/ -type f -name "*.xlsx" 2> /dev/null |wc -l 1> /dev/null + if [[ $filecount -eq 0 ]] + then + $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'No files in Landing folder', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" + else + $postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'file_found_to_process', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'" + fi + fi +done < <($postgres_con -c "select file_name from fw_core.fw_jobctl_file_runschedule where end_status_note='ODS_completed' and end_status ='success'") fi - - -#$postgres_con -c "insert into fw_core.track_jobstep select *,'duplicate_check' from fw_core.fw_jobctl_runschedule_jobstep;" -#$postgres_con -c "insert into fw_core.track_file select *,'duplicate_check' from fw_core.fw_jobctl_file_runschedule;" -#$postgres_con -c "insert into fw_core.track_file_sheet select *,'duplicate_check' from fw_core.fw_jobctl_file_sheet_runschedule;" - diff --git a/scripts/con-pwd.sh b/scripts/con-pwd.sh new file mode 100755 index 0000000..9aa51ba --- /dev/null +++ b/scripts/con-pwd.sh @@ -0,0 +1 @@ +psql -h localhost -d mmt_deploy -U postgres -p 2345 diff --git a/scripts/con.sh b/scripts/con.sh new file mode 100755 index 0000000..ab9f952 --- /dev/null +++ b/scripts/con.sh @@ -0,0 +1 @@ +psql -X -A -t postgresql://postgres:'j3(jLBq}e'@localhost/MMT_PROD?options=--search_path%3Dstaging2 diff --git a/scripts/con_admin.sh b/scripts/con_admin.sh new file mode 100755 index 0000000..6de3590 --- /dev/null +++ b/scripts/con_admin.sh @@ -0,0 +1,2 @@ +psql -X -A -t postgresql://fw_admin:'$HjNxDV3g=bJ=Tw9'@localhost/forewarn_tdm?options=--search_path%3Dstaging2 + diff --git a/scripts/con_check.sh b/scripts/con_check.sh new file mode 100755 index 0000000..72918d1 --- /dev/null +++ b/scripts/con_check.sh @@ -0,0 +1,28 @@ + + +#HOME="/home/compegence/customer" +#Directories +fileDir="/data/customer/MMT" +homeDir=$HOME/customer/MMT +configDir=$homeDir/conf +input_file=$configDir/etl-config.txt +declare -A credentials +while IFS="=" read -r key value; do + credentials[$key]=$value + done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file ) +#for i in ${credentials[@]}; do echo ***$i; done + +user=${credentials[user]} +password=${credentials[password]} +host=${credentials[host]} +db=${credentials[db]} +protocol=${credentials[protocol]} +server=${credentials[server]} + +postgres_con="psql -A -t postgresql://$user:$password@$host/$db" + + +count=`$postgres_con -c "select count(*) from staging1.temtable"` + +echo $count + diff --git a/scripts/correlation.sh b/scripts/correlation.sh new file mode 100755 index 0000000..c35d477 --- /dev/null +++ b/scripts/correlation.sh @@ -0,0 +1,60 @@ +#!/bin/bash -e + +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright ¿ 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + +HOME="/home/compegence/customer" +#Directories +homeDir=$HOME/MMT +configDir=$homeDir/conf +input_file=$configDir/etl-config.txt +declare -A credentials +while IFS="=" read -r key value; do + credentials[$key]=$value + done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file ) + + +user=${credentials[user]} +password=${credentials[password]} +host=${credentials[host]} +db=${credentials[db]} +protocol=${credentials[protocol]} +server=${credentials[server]} + + +psql_base_arg="postgresql://$user:$password@$host/$db" + +#update fw_jobctl_file_landing + + +##get file mnemonic count + file_mnemonic_count_drawbar=$(psql $psql_base_arg -t -c "select count(*) from fw_core.fw_jobctl_file_runschedule where latest_runschedule_flag=true and file_mnemonic like 'DB%' ;") + echo "file-mnemonic-count is $file_mnemonic_count_drawbar" + + if [[ $file_mnemonic_count_drawbar -gt 0 ]]; then + psql $psql_base_arg -t -c "select fw_ods.drawbar_correlation_upload()" + # else + # exit 1; + fi + + file_mnemonic_count_pto=$(psql $psql_base_arg -t -c "select count(*) from fw_core.fw_jobctl_file_runschedule where latest_runschedule_flag=true and file_mnemonic like 'PTO%';") + echo "file-mnemonic-count_pto is $file_mnemonic_count_pto" + + if [[ $file_mnemonic_count_pto -gt 0 ]]; then + psql $psql_base_arg -t -c "select fw_ods.pto_correlation_upload()" + # else + # exit 1; + fi + + + diff --git a/scripts/crontab b/scripts/crontab new file mode 100755 index 0000000..eabe22e --- /dev/null +++ b/scripts/crontab @@ -0,0 +1 @@ +25 13 * * * /home/tdmsadmin/customer/MMT/sql/scripts/run_schedule.sh >>/data/cumstomer/MMT/logs/test_data_MMT`date+\%Y\%m\%d\%H\%M\%S`.log 2>&1 diff --git a/scripts/fileLoadMail.sh b/scripts/fileLoadMail.sh new file mode 100755 index 0000000..2d5325d --- /dev/null +++ b/scripts/fileLoadMail.sh @@ -0,0 +1,43 @@ +#!/bin/bash -e + +#Declare the Associative array + +homeDir=$HOME/customer/MMT +configDir=$homeDir/conf +input_file=$configDir/etl-config.txt +declare -A credentials +while IFS="=" read -r key value; do + credentials[$key]=$value + done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file ) + + +user=${credentials[user]} +password=${credentials[password]} +host=${credentials[host]} +db=${credentials[db]} +protocol=${credentials[protocol]} +server=${credentials[server]} + +postgres_con="psql -A -t postgresql://$user:$password@$host/$db" + + +echo $postgres_con + +( +echo "*****************************" +echo "**Latest File Update Status**" +echo "*****************************" +echo " " +psql $postgres_con -c "select run_schedule_id, file_syspk, file_mnemonic, file_name, end_status as status, end_time from fw_core.fw_jobctl_file_runschedule +where run_schedule_id in (select max(run_schedule_id) from fw_core.fw_jobctl_file_runschedule) order by run_schedule_id, file_syspk, end_status desc;" +echo " " +echo "**********************************" +echo "**Error Files********************" +echo "**********************************" +echo " " +psql $postgres_con -c "select A.run_schedule_id, A.file_syspk, A.file_mnemonic, A.file_name, B.sheet_id, B.sheet_name, A.end_status, A.end_time from fw_core.fw_jobctl_file_runschedule a, fw_core.fw_jobctl_file_sheet_runschedule b +where a.run_schedule_id = (select max(run_schedule_id) from fw_core.fw_jobctl_file_runschedule) and a.file_syspk = b.file_syspk and (b.file_sheet_mnemonic != '' or b.file_sheet_mnemonic is not null) +and b.end_status='error' order by A.run_schedule_id, b.file_syspk, b.sheet_id desc limit 10" +) | mail -s 'FIles Load Status' muin.shariff@compegence.com abdur.rahman@compegence.com dheepa.k@compegence.com jagadish.puvvada@compegence.com -a "From: noreply@forewarn.com" + + diff --git a/scripts/fileLoadMailhtml.sh b/scripts/fileLoadMailhtml.sh new file mode 100755 index 0000000..56e9444 --- /dev/null +++ b/scripts/fileLoadMailhtml.sh @@ -0,0 +1,78 @@ +#!/bin/bash -e + +#HOME="/home/compegence/customer" +#Directories +homeDir=$HOME/customer/MMT +configDir=$homeDir/conf +input_file=$configDir/etl-config.txt +declare -A credentials +while IFS="=" read -r key value; do + credentials[$key]=$value + done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file ) + + + user=${credentials[user]} + password=${credentials[password]} + host=${credentials[host]} + db=${credentials[db]} + protocol=${credentials[protocol]} + server=${credentials[server]} + + + + psql_base_arg="postgresql://$user:$password@$host/$db" +#dbname="mmt_tdm" +#port=5432 + + + +Get_Email_Ids () { + #client_id=$1 + echo $client_id + email_ids=`psql $psql_base_arg -t -c "select runschedule_status_email from fw_core.fw_m_client where client_id=$client_id"` + #echo $email_ids + #mail -a "Content-type: text/html" -s "Mail configuration Completed" $email_ids -a "From: noreply@forewarn.com" < Output.html +} +#echo $psql_base_arg + +Get_FileUpload_Status (){ +#echo -e "MIME-Version: 1.0\nContent-Type: multipart/plain" >Output.txt + echo -e "--asdfghjkl\nContent-Type: text/plain; charset=utf-8\n\nAlerts for the job run status\n\n--asdfghjkl\nContent-Type: text/html; charset=utf-8\n\n\n\n\n\t\n\t\t\n\t\n

Mahindra TDMS - Latest Flles Update Status

" > Output.txt + #echo "

Mahindra TDMS - Latest Files Update Status

" >> Output.txt + #echo " " >>Output.txt + + psql $psql_base_arg -H -c "select run_schedule_id, file_syspk, file_mnemonic, file_name, end_status as status, end_time load_time from fw_core.fw_jobctl_file_runschedule +where run_schedule_id in (select max(run_schedule_id) from fw_core.fw_jobctl_file_runschedule) order by run_schedule_id, file_syspk, end_status desc;" >> Output.txt + + + echo -e "\n\t\n\t\t\n\t\n

Error Files

" >> Output.txt + + psql $psql_base_arg -H -c "select A.run_schedule_id, A.file_syspk, A.file_mnemonic, A.file_name, B.sheet_id, B.sheet_name, A.end_status, A.end_time load_time from fw_core.fw_jobctl_file_runschedule a, fw_core.fw_jobctl_file_sheet_runschedule b +where a.run_schedule_id = (select max(run_schedule_id) from fw_core.fw_jobctl_file_runschedule) and a.file_syspk = b.file_syspk and (b.file_sheet_mnemonic != '' or b.file_sheet_mnemonic is not null) and b.end_status='error' order by A.run_schedule_id, b.file_syspk, b.sheet_id desc" >> Output.txt + + echo -e "\n\n--asdfghjkl" >> Output.txt +} + +Send_Mail () { + Get_Email_Ids + echo $email_ids + mail -a "Content-Type: multipart/alternative; boundary=asdfghjkl" -s "FIle Load Status" $email_ids -a "From: noreply@forewarn.com" < Output.txt +} + #mail -a "Content-type: text/html" -s "Mail configuration Completed" muin.shariff@compegence.com nagaraj.kulkarni@compegence.com dheepa.k@compegence.com abdur.rahman@compegence.com jagadish.puvvada@compegence.com -a "From: noreply@forewarn.com" < Output.html + + + + +if [ -z "$1" ] + then + client_id=20 + Get_FileUpload_Status + Send_Mail; + else + Get_FileUpload_Status + Send_Mail; +fi + + +psql $psql_base_arg -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note ='email_completed', end_status='success',end_time = now() where job_script_type = 'shell_script' and latest_runschedule_flag='1' and job_name= 'sending mail'" + diff --git a/scripts/fileLoadMailhtml_20210928.sh b/scripts/fileLoadMailhtml_20210928.sh new file mode 100755 index 0000000..bf53081 --- /dev/null +++ b/scripts/fileLoadMailhtml_20210928.sh @@ -0,0 +1,72 @@ +#!/bin/bash -e + +#HOME="/home/compegence/customer" +#Directories +homeDir=$HOME/customer/MMT +configDir=$homeDir/conf +input_file=$configDir/etl-config.txt +declare -A credentials +while IFS="=" read -r key value; do + credentials[$key]=$value +done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file ) + + +user=${credentials[user]} +password=${credentials[password]} +host=${credentials[host]} +db=${credentials[db]} +protocol=${credentials[protocol]} +server=${credentials[server]} + + + +psql_base_arg="postgresql://$user:$password@$host/$db" + +Get_Email_Ids () { + #client_id=$1 +# echo $client_id + email_ids=`psql $psql_base_arg -t -c "select runschedule_status_email from fw_core.fw_m_client where client_id=$client_id"` + #echo $email_ids + #mail -a "Content-type: text/html" -s "Mail configuration Completed" $email_ids -a "From: noreply@forewarn.com" < Output.html +} +#echo $psql_base_arg + +Get_FileUpload_Status (){ +#echo -e "MIME-Version: 1.0\nContent-Type: multipart/plain" >Output.txt + echo "

**Latest Files Update Status**

" > Output.html + #echo " " >>Output.txt + + psql $psql_base_arg -H -c "select run_schedule_id, file_syspk, file_mnemonic, file_name, end_status as status, end_time load_time from fw_core.fw_jobctl_file_runschedule +where run_schedule_id in (select max(run_schedule_id) from fw_core.fw_jobctl_file_runschedule) order by run_schedule_id, file_syspk, end_status desc;" >> Output.html + + + echo "

**Error Files*****

" >> Output.html + + psql $psql_base_arg -H -c "select A.run_schedule_id, A.file_syspk, A.file_mnemonic, A.file_name, B.sheet_id, B.sheet_name, A.end_status, A.end_time load_time from fw_core.fw_jobctl_file_runschedule a, fw_core.fw_jobctl_file_sheet_runschedule b +where a.run_schedule_id = (select max(run_schedule_id) from fw_core.fw_jobctl_file_runschedule) and a.file_syspk = b.file_syspk and (b.file_sheet_mnemonic != '' or b.file_sheet_mnemonic is not null) and b.end_status='error' order by A.run_schedule_id, b.file_syspk, b.sheet_id desc" >> Output.html + +} + +Send_Mail () { + Get_Email_Ids + echo $email_ids + mail -a "Content-type: text/html" -s "Mail configuration Completed" $email_ids -a "From: noreply@forewarn.com" < Output.html +} + #mail -a "Content-type: text/html" -s "Mail configuration Completed" muin.shariff@compegence.com nagaraj.kulkarni@compegence.com dheepa.k@compegence.com abdur.rahman@compegence.com jagadish.puvvada@compegence.com -a "From: noreply@forewarn.com" < Output.html + + + + +if [ -z "$1" ] + then + echo "No argument supplied" + echo "usage --> `basename ${0}` client_id" + echo "Ex: `basename ${0}` 20" + exit 1; + else + client_id=$1 + Get_FileUpload_Status + Send_Mail; +fi + + diff --git a/scripts/file_move.sh b/scripts/file_move.sh index 1d0c9c3..63f218d 100755 --- a/scripts/file_move.sh +++ b/scripts/file_move.sh @@ -1,7 +1,22 @@ #!/bin/bash -e -HOME="/home/compegence/customer" + +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright © 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + +#HOME="/home/compegence/customer" #Directories -homeDir=$HOME/MMT +fileDir="/data/customer/MMT" +homeDir=$HOME/customer/MMT configDir=$homeDir/conf input_file=$configDir/etl-config.txt declare -A credentials @@ -25,15 +40,15 @@ for filesyspk in ${filesyspks} do IFS="|" read name endstatus endnote <<<`$postgres_con -c "select file_name,end_status,end_status_note from fw_core.fw_jobctl_file_runschedule where file_syspk=$filesyspk"` filename=$(echo $name | sed 's/[[:space:]]/\\ /g') - if [ $endstatus == "success" -a $endnote == 'TRX_completed' ] + if [ $endstatus == "success" -a $endnote == 'ODS_completed' ] then echo " moving file:$filename to processed folder" - move=$(echo "mv $homeDir/files/landing/$filename $homeDir/files/processed/$filename") + move=$(echo "mv $fileDir/files/landing/$filename $fileDir/files/processed/$filename") eval $move else echo "moving file: $filename to error_file folder " - move=$(echo "mv $homeDir/files/landing/$filename $homeDir/files/error_file/$filename") + move=$(echo "mv $fileDir/files/landing/$filename $fileDir/files/error_file/$filename") eval $move fi diff --git a/scripts/job_load.sh b/scripts/job_load.sh index 6498127..ac91bd9 100755 --- a/scripts/job_load.sh +++ b/scripts/job_load.sh @@ -1,9 +1,21 @@ -#!/bin/bash -e +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright © 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + #!/bin/bash -e -HOME="/home/compegence/customer" +#HOME="/home/compegence/customer" #Directories -homeDir=$HOME/MMT +homeDir=$HOME/customer/MMT configDir=$homeDir/conf input_file=$configDir/etl-config.txt declare -A credentials @@ -43,7 +55,7 @@ sun="Mon" psql $psql_base_arg -q -c "update fw_core.fw_jobctl_file_sheet_runschedule set latest_runschedule_flag='0' where latest_runschedule_flag='1';" #inserting into fw_core.fw_jobctl_runschedule -chkrun=$(psql $psql_base_arg -t -c "select count(*) from fw_core.fw_jobctl_jobstep_master where client_id=21 and function_id=1 and run_frequency='daily' and active_flag=true;") +chkrun=$(psql $psql_base_arg -t -c "select count(*) from fw_core.fw_jobctl_jobstep_master where client_id=20 and function_id=1 and run_frequency='daily' and active_flag=true;") if [[ $chkrun -gt 0 ]]; then psql $psql_base_arg -q -c "INSERT INTO fw_core.fw_jobctl_runschedule (client_id, function_id, run_schedule_timestamp, run_frequency, start_time, begin_status, created_by, updated_by, create_timestamp, update_timestamp) @@ -52,19 +64,19 @@ where active_flag='TRUE' group by client_id, function_id, run_frequency limit 1; #check previous day job status in fw_jobctl_runschedule chkrun2=$(psql $psql_base_arg -t -c "select trim(end_status) from fw_core.fw_jobctl_runschedule where run_schedule_id = ( - select max(run_schedule_id) as max from fw_core.fw_jobctl_runschedule where latest_runschedule_flag='0' and client_id=21 and function_id=1);") + select max(run_schedule_id) as max from fw_core.fw_jobctl_runschedule where latest_runschedule_flag='0' and client_id=20 and function_id=1);") if [ "$chkrun2" != " error" ]; then #Update fw_jobctl_runschedule - psql $psql_base_arg -q -c "update fw_core.fw_jobctl_runschedule set begin_status='started' where client_id=21 and function_id=1 and run_frequency='daily' and latest_runschedule_flag='1' " + psql $psql_base_arg -q -c "update fw_core.fw_jobctl_runschedule set begin_status='started' where client_id=20 and function_id=1 and run_frequency='daily' and latest_runschedule_flag='1' " else - psql $psql_base_arg -q -c "update fw_core.fw_jobctl_runschedule set begin_status='started',end_status='error',end_status_note = 'previous day job failed' where client_id=21 and function_id=1 and run_frequency='daily' and latest_runschedule_flag='1' " + psql $psql_base_arg -q -c "update fw_core.fw_jobctl_runschedule set begin_status='started',end_status='error',end_status_note = 'previous day job failed' where client_id=20 and function_id=1 and run_frequency='daily' and latest_runschedule_flag='1' " echo "welcome2" exit 1; fi else - echo " No active job for daily for client_id=21" + echo " No active job for daily for client_id=20" exit 1; fi diff --git a/scripts/onetime_compile.sh b/scripts/onetime_compile.sh index a1b3f0a..93141a7 100755 --- a/scripts/onetime_compile.sh +++ b/scripts/onetime_compile.sh @@ -1,7 +1,21 @@ #!/bin/bash -e -HOME="/home/compegence/customer" + +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright © 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + +#HOME="/home/compegence/customer" #Directories -homeDir=$HOME/MMT +homeDir=$HOME/customer/MMT configDir=$homeDir/conf input_file=$configDir/etl-config.txt declare -A credentials @@ -19,7 +33,7 @@ server=${credentials[server]} mmt_con="psql -X -q -A -t postgresql://$user:$password@$host/$db?options=--search_path%3D" -declare -a archivepathvar=("$homeDir/sql/onetime/archive/schema") +#declare -a archivepathvar=("$homeDir/sql/onetime/archive/schema") declare -a archivepathsvar=("$homeDir/sql/onetime/archive/create" "$homeDir/sql/onetime/archive/function") @@ -39,7 +53,7 @@ func_execute_conn(){ done } -func_execute_conn "$mmt_con'archive'" archivepathvar +#func_execute_conn "$mmt_con'archive'" archivepathvar func_execute_conn "$mmt_con'staging2'" stgpathvar diff --git a/scripts/post_update.sh b/scripts/post_update.sh new file mode 100755 index 0000000..7e178c0 --- /dev/null +++ b/scripts/post_update.sh @@ -0,0 +1,39 @@ +#!/bin/bash -e + +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright ¿ 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + +HOME="/home/compegence/customer" +#Directories +homeDir=$HOME/MMT +configDir=$homeDir/conf +input_file=$configDir/etl-config.txt +declare -A credentials +while IFS="=" read -r key value; do + credentials[$key]=$value + done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file ) + + +user=${credentials[user]} +password=${credentials[password]} +host=${credentials[host]} +db=${credentials[db]} +protocol=${credentials[protocol]} +server=${credentials[server]} + + +psql_base_arg="postgresql://$user:$password@$host/$db" + +#update fw_jobctl_file_landing + psql $psql_base_arg -t -q -c "update fw_core.fw_jobctl_file_landing a set run_schedule_id=b.run_schedule_id,file_syspk=b.file_syspk,file_landing_date=b.file_landing_date,status=b.end_status from fw_core.fw_jobctl_file_runschedule b where a.file_name=b.file_name and b.latest_runschedule_flag=true;" + diff --git a/scripts/run_schedule.sh b/scripts/run_schedule.sh index 01a3a5e..1114110 100755 --- a/scripts/run_schedule.sh +++ b/scripts/run_schedule.sh @@ -1,7 +1,21 @@ #!/bin/bash -e -HOME="/home/compegence/customer" + +#/**************************************************************** +#****** ForeWarn Licensing and / or usage Terms and Conditions ***** +#ForeWarn. The NextGen Insights Solution Platform + +#Copyright © 2021 COMPEGENCE. All Rights Reserved + +#ForeWarn is a product of COMPEGENCE. + +#To be used only with a valid license from COMPEGENCE + +#www.compegence.com info@compegence.com +#****************************************************************/ + +#HOME="/home/compegence/customer" #Directories -homeDir=$HOME/MMT +homeDir=$HOME/customer/MMT configDir=$homeDir/conf input_file=$configDir/etl-config.txt declare -A credentials @@ -22,7 +36,7 @@ server=${credentials[server]} psql_base_arg="postgresql://$user:$password@$host/$db" # load the record into the fw_jobctl_runschedule accounting for run frequency (hourly, daily, monthly, yearly) and insert - /home/compegence/customer/MMT/sql/scripts/job_load.sh + $homeDir/sql/scripts/job_load.sh ##***** Run frequency loop; Outer Loop #while loop for each client_id,function_id,run_frequency from fw_jobctl_runschedule_jobstep @@ -78,10 +92,14 @@ echo "Executing Job: $job_name by checking Previous End Status" ## Process java Program if [[ $job_script_type == "java" ]]; then psql $psql_base_arg -t -q -c "update fw_core.fw_jobctl_runschedule_jobstep set start_time=now(),begin_status='started' where job_step_script_name='$job_step_script_name' and client_id=$client_id and function_id=$function_id and run_frequency='$run_frequency' and latest_runschedule_flag='1' " +echo "--$prev_job_seq" if [[ $prev_job_seq == '' ]]; then - java -jar $job_step_script_name +echo "calling java jar" + java -jar $job_step_script_name + else - chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;") + chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=20 and function_id=1;") +echo "chk $chkrun" if [[ "$chkrun" == " success" ]]; then java -jar $job_step_script_name else @@ -95,7 +113,7 @@ echo "Executing Job: $job_name by checking Previous End Status" if [[ $prev_job_seq == '' ]]; then psql $psql_base_arg -a -f $job_step_script_name $host $port $user $pwd $dbname $param $client_id $function_id $data_from_date $data_to_date $job_scope $job_scope_qualifier else - chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;") + chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=20 and function_id=1;") if [[ "$chkrun" == " success" && $file_count -gt 0 ]]; then psql $psql_base_arg -a -f $job_step_script_name $host $port $user $pwd $dbname $param $client_id $function_id $data_from_date $data_to_date $job_scope $job_scope_qualifier else @@ -109,7 +127,7 @@ echo "Executing Job: $job_name by checking Previous End Status" if [[ $prev_job_seq == '' ]]; then $job_step_script_name else - chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;") + chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=20 and function_id=1;") if [[ "$chkrun" == " success" && $file_count -gt 0 ]]; then $job_step_script_name @@ -125,7 +143,7 @@ echo "Executing Job: $job_name by checking Previous End Status" psql $psql_base_arg -c "select $job_step_script_name_concat" else - chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;") + chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=20 and function_id=1;") if [[ "$chkrun" == " success" && $file_count -gt 0 ]]; then psql $psql_base_arg -t -c "select $job_step_script_name_concat" else