From c8985b2d62094af5ac8f437d45aa17810e86bf41 Mon Sep 17 00:00:00 2001 From: Deepthi Date: Tue, 27 Apr 2021 16:13:33 +0530 Subject: [PATCH] added deployment folder with latest code --- .../deployment/Drawbar/DBOECD-TEST-ods.txt | 867 ++++++++++ .../deployment/Drawbar/DBOECD-TEST-stg2.txt | 1480 +++++++++++++++++ .../deployment/Drawbar/DBSTD_TEST_ODS.txt | 754 +++++++++ .../deployment/Drawbar/DBSTD_TEST_stg2.txt | 1342 +++++++++++++++ .../deployment/IHT/IHT_BRT_ODS.SQL | 408 +++++ .../deployment/IHT/IHT_BRT_STG2.sql | 784 +++++++++ .../deployment/IHT/IHT_CGM_ODS.SQL | 305 ++++ .../deployment/IHT/IHT_CGM_STG2.sql | 563 +++++++ .../deployment/IHT/IHT_EMT_ODS.SQL | 401 +++++ .../deployment/IHT/IHT_EMT_STG2.sql | 607 +++++++ .../deployment/IHT/IHT_HAM_ODS.SQL | 384 +++++ .../deployment/IHT/IHT_HAM_STG2.sql | 785 +++++++++ .../deployment/IHT/IHT_HLS_ODS.SQL | 269 +++ .../deployment/IHT/IHT_HLS_STG2.sql | 567 +++++++ .../deployment/IHT/IHT_NST_ODS.SQL | 499 ++++++ .../deployment/IHT/IHT_SLL_ODS.SQL | 347 ++++ .../deployment/IHT/IHT_SLL_STG2.sql | 664 ++++++++ .../deployment/budni/BUDNI_ARC_ODS.SQL | 241 +++ .../deployment/budni/BUDNI_ARC_STG2.sql | 315 ++++ .../deployment/budni/BUDNI_BRK_ODS.SQL | 499 ++++++ .../deployment/budni/BUDNI_BRK_STG2.sql | 720 ++++++++ .../deployment/budni/BUDNI_DBP_ODS.SQL | 192 +++ .../deployment/budni/BUDNI_DBP_STG2.sql | 267 +++ .../deployment/budni/BUDNI_FLD_ODS.SQL | 397 +++++ .../deployment/budni/BUDNI_FLD_STG2.sql | 594 +++++++ .../deployment/budni/BUDNI_HDL_ODS.SQL | 368 ++++ .../deployment/budni/BUDNI_HDL_STG2.sql | 554 ++++++ .../deployment/budni/BUDNI_HLG_ODS.SQL | 253 +++ .../deployment/budni/BUDNI_HLG_STG2.sql | 443 +++++ .../deployment/budni/BUDNI_LCG_ODS.SQL | 199 +++ .../deployment/budni/BUDNI_LCG_STG2.sql | 248 +++ .../deployment/budni/BUDNI_NMT_ODS.SQL | 348 ++++ .../deployment/budni/BUDNI_NMT_STG2.sql | 507 ++++++ .../deployment/budni/BUDNI_PTO_ODS.SQL | 309 ++++ .../deployment/budni/BUDNI_PTO_STG2.sql | 358 ++++ .../deployment/budni/BUDNI_VMT_ODS.SQL | 234 +++ .../deployment/budni/BUDNI_VMT_STG2.sql | 371 +++++ .../deployment/budni/delete_ods_BUDNI.sql | 110 ++ .../deployment/budni/output_BUDNI.txt | 370 +++++ .../commonfunctions/Error Handling.txt | 88 + .../commonfunctions/generic_functions.txt | 79 + .../deployment/configentires/BUDNI_config.sql | 100 ++ .../configentires/DBOECD-TEST-config.txt | 14 + .../deployment/configentires/IHT config.sql | 60 + .../configentires/insert-config.txt | 110 ++ .../createtables/DBOECD-TEST-blocktables.txt | 750 +++++++++ .../DBSTD_TEST_create-block-tables.txt | 695 ++++++++ .../createtables/PTO-create-blocktables | 1402 ++++++++++++++++ .../deployment/createtables/create-config.txt | 37 + .../createtables/create_table_FTDRY_SUM.sql | 337 ++++ .../createtables/create_table_FTHLG_SUM.sql | 335 ++++ .../createtables/create_table_FTWET_SUM.sql | 303 ++++ .../createtables/create_tables_BUDNI_ARC.sql | 223 +++ .../createtables/create_tables_BUDNI_BRK.sql | 440 +++++ .../createtables/create_tables_BUDNI_DBP.sql | 214 +++ .../createtables/create_tables_BUDNI_FLD.sql | 333 ++++ .../createtables/create_tables_BUDNI_HDL.sql | 302 ++++ .../createtables/create_tables_BUDNI_HLG.sql | 249 +++ .../createtables/create_tables_BUDNI_LCG.sql | 203 +++ .../createtables/create_tables_BUDNI_NMT.sql | 348 ++++ .../createtables/create_tables_BUDNI_PTO.sql | 282 ++++ .../createtables/create_tables_BUDNI_VMT.sql | 224 +++ .../createtables/create_tables_IHT_BRT.sql | 351 ++++ .../createtables/create_tables_IHT_CGM.sql | 367 ++++ .../createtables/create_tables_IHT_EMT.sql | 394 +++++ .../createtables/create_tables_IHT_HAM.sql | 426 +++++ .../createtables/create_tables_IHT_HLS.sql | 368 ++++ .../createtables/create_tables_IHT_NST.sql | 386 +++++ .../createtables/create_tables_IHT_SLL.sql | 395 +++++ .../deployment/field/FTDRY-SUM_STG2.txt | 672 ++++++++ .../deployment/field/FTDRY-TRS_STG2.txt | 448 +++++ .../deployment/field/FTDRY_SUM_ODS.sql | 358 ++++ .../deployment/field/FTDRY_SUM_STG2.sql | 663 ++++++++ .../deployment/field/FTDRY_TRS_ODS.sql | 369 ++++ .../deployment/field/FTDRY_TRS_STG2.sql | 440 +++++ .../field/FTDRY_TRS_stg2_version2.sql | 468 ++++++ .../deployment/field/FTHLG-SUM_ods.txt | 357 ++++ .../deployment/field/FTHLG-SUM_stg2.txt | 771 +++++++++ .../deployment/field/FTHLG-TRS_ods.txt | 388 +++++ .../deployment/field/FTHLG-TRS_stg2.txt | 440 +++++ .../field/FTHLG_TRS_stg2_version2.sql | 421 +++++ .../deployment/field/FTWET-SUM_ods.txt | 298 ++++ .../deployment/field/FTWET-SUM_stg2.txt | 477 ++++++ .../deployment/field/FTWET-TRS_ods.txt | 390 +++++ .../deployment/field/FTWET-TRS_stg2.txt | 441 +++++ .../field/FTWET_TRS_stg2_version2.sql | 406 +++++ .../deployment/pto-V0-April22/PTO-GVG_ods.txt | 196 +++ .../pto-V0-April22/PTO-GVG_stg2.txt | 373 +++++ .../pto-V0-April22/PTO-MPM-stg2.txt | 188 +++ .../deployment/pto-V0-April22/PTO-MPM_ods.txt | 72 + .../pto-V0-April22/PTO-PHA-stg2.txt | 479 ++++++ .../deployment/pto-V0-April22/PTO-PHA_ods.txt | 155 ++ .../deployment/pto-V0-April22/PTO-PNA-ods.txt | 226 +++ .../pto-V0-April22/PTO-PNA-stg2.txt | 837 ++++++++++ .../deployment/pto-V0-April22/PTO-RPT-ods.txt | 304 ++++ .../pto-V0-April22/PTO-RPT-stg2.txt | 352 ++++ ...V (Boost) SAMPLE TEST DATA MANAGEMENT.xlsx | Bin 0 -> 397536 bytes .../deployment/pto-V1-April22/PTO-GVG_ods.txt | 196 +++ .../pto-V1-April22/PTO-GVG_stg2.txt | 373 +++++ .../pto-V1-April22/PTO-MPM-stg2.txt | 188 +++ .../deployment/pto-V1-April22/PTO-MPM_ods.txt | 72 + .../pto-V1-April22/PTO-PHA-stg2.txt | 479 ++++++ .../deployment/pto-V1-April22/PTO-PHA_ods.txt | 155 ++ .../deployment/pto-V1-April22/PTO-PNA-ods.txt | 226 +++ .../pto-V1-April22/PTO-PNA-stg2.txt | 837 ++++++++++ .../deployment/wrappers/BUDNI_Wrapper.sql | 80 + .../deployment/wrappers/DBOECD_wrapper.txt | 23 + .../deployment/wrappers/DBSTD_wrapper.txt | 23 + .../deployment/wrappers/FTDRY-wrapper.txt | 29 + .../deployment/wrappers/FTDRY-wrapper_v1.txt | 26 + .../deployment/wrappers/FTHLG-wrapper.txt | 29 + .../deployment/wrappers/FTWET-wrapper.txt | 29 + 112 files changed, 42492 insertions(+) create mode 100644 deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_ODS.txt create mode 100644 deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_NST_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_ODS.SQL create mode 100644 deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/delete_ods_BUDNI.sql create mode 100644 deployment-20210427T103328Z-001/deployment/budni/output_BUDNI.txt create mode 100644 deployment-20210427T103328Z-001/deployment/commonfunctions/Error Handling.txt create mode 100644 deployment-20210427T103328Z-001/deployment/commonfunctions/generic_functions.txt create mode 100644 deployment-20210427T103328Z-001/deployment/configentires/BUDNI_config.sql create mode 100644 deployment-20210427T103328Z-001/deployment/configentires/DBOECD-TEST-config.txt create mode 100644 deployment-20210427T103328Z-001/deployment/configentires/IHT config.sql create mode 100644 deployment-20210427T103328Z-001/deployment/configentires/insert-config.txt create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/DBOECD-TEST-blocktables.txt create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/DBSTD_TEST_create-block-tables.txt create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/PTO-create-blocktables create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create-config.txt create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_table_FTDRY_SUM.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_table_FTHLG_SUM.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_table_FTWET_SUM.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_ARC.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_BRK.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_DBP.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_FLD.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HDL.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HLG.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_LCG.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_NMT.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_PTO.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_VMT.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_BRT.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_CGM.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_EMT.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HAM.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HLS.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_NST.sql create mode 100644 deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_SLL.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY-SUM_STG2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY-TRS_STG2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_ODS.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_ODS.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_STG2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_stg2_version2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTHLG_TRS_stg2_version2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/field/FTWET_TRS_stg2_version2.sql create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/ETL_MAP_PTOBST_v1.0_20210309_MAH_ PTO LAB _M-Star 65 Hp P- II Trem IV (Boost) SAMPLE TEST DATA MANAGEMENT.xlsx create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-GVG_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-GVG_stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA_ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-ods.txt create mode 100644 deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-stg2.txt create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/BUDNI_Wrapper.sql create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/DBOECD_wrapper.txt create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/DBSTD_wrapper.txt create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper.txt create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper_v1.txt create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/FTHLG-wrapper.txt create mode 100644 deployment-20210427T103328Z-001/deployment/wrappers/FTWET-wrapper.txt diff --git a/deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-ods.txt b/deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-ods.txt new file mode 100644 index 0000000..991689c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-ods.txt @@ -0,0 +1,867 @@ +--select mmt_ods.fn_dboecd_test_ods(); + +drop function if exists mmt_ods.fn_dboecd_test_ods; +CREATE OR REPLACE FUNCTION mmt_ods.fn_dboecd_test_ods(p_file_syspk int) + RETURNS text AS $$ +declare + __test_instance_id int; + __file_syspk int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin +__file_syspk := p_file_syspk; + +/*********************************************************** +Function Name:fn_dboecd_test_ods +Function Desc: This function populates data into ods block +File Format: DBOECD +Sheet Format: DBOECD_TEST +Creation Date: March 27 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_ods.fn_dboecd_test_ods() +***************************************************************/ +SET search_path TO mmt_staging2; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +acceptance_criteria, +objective_of_test, +test_file_format, +test_file_sheet_format, +date_of_test +) +select +client_id, +function_id, +file_syspk, +make, +model, +test_request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as sample_receipt_date , +test_report_no, +generation, +customer_name, +test_engineer, +date '1899-12-30' + test_report_date::int * interval '1' day as test_report_date , +no_of_sample, +date '1899-12-30' + test_start_date::int* interval '1' day as test_start_date , +date '1899-12-30' + test_end_date::int* interval '1' day as test_end_date , +tractor_sr_no, +test_standard_refer, +test_location, +operator_name, +project_group, +objective, +acceptance_criteria, +file_format, +sheet_mnemonic, +current_date +from +mmt_staging2.dboecd_test_h1_block; + +update mmt_ods.test_instance a +set test_condition=b.c2 +from mmt_staging2.dboecd_test_test_condition_block b +where a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance a +set remarks = b.remark +from mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block b +where a.test_file_ref_no=b.file_syspk; + +select file_syspk into __file_syspk from mmt_staging2.dboecd_test_h1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +insert into mmt_ods.test_instance_engine_info +(client_id, +function_id, +test_file_ref_no, +tractor_model, +tractor_make, +low_idle_declared, +low_idle_observed, +high_idle_declared, +high_idle_observed, +test_file_format, +test_file_sheet_format +) +select client_id, +function_id, +file_syspk, +make,model, +low_idle_declared, +low_idle_observed::int, +high_idle_declared, +high_idle_observed::int, +file_format, +sheet_mnemonic +from mmt_staging2.DBOECD_test_engine_RPM_RPM_block; + + +update mmt_ods.test_instance_engine_info a +set rated_rpm=b.rated_speed::int ,engine_to_pto_ratio_540_pto=b.engine_to_pto_ratio::numeric::int,engine_power_hp = b.engine_power_hp::int, +pto_power_hp = b.pto_power_hp::numeric +from +mmt_staging2.dboecd_test_engine_rpm_engine_to_pto_block b +where a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_engine_info a +set engine_cylinder_stroke_mm=b.stroke::int,engine_cylinder_bore_mm=b.bore::numeric,engine_cylinder_no=b.number::int,engine_cylinder_capacity_ltr=b.capacity::int +from mmt_staging2.dboecd_test_tractor_specifications_cylinders_block b +where test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_engine_info a +set engine_type=b."type" ,engine_serial_no=b.serial_no,engine_make=b.make_in_block ,engine_model = b.model_in_block ,rated_rpm=b.rated_speed::int +from mmt_staging2.dboecd_test_tractor_specifications_engine_details_block b +where test_file_ref_no=b.file_syspk; + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +wheel_base_mm, +tractor_engine_hp, +pto_power_hp, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +wheel_base_mm::int, +engine_power_hp::int, +pto_power_hp::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.dboecd_test_engine_rpm_engine_to_pto_block; + +update mmt_ods.test_instance_tractor_info a +set +steering_type=b.steering_type, +transmission_type=clutch_type, +transmission_disc_diam=diameter_of_disc_mm +from mmt_staging2.dboecd_test_transmission_clutch_block b +where a.test_file_ref_no=b.file_syspk; + + +insert into mmt_ods.test_instance_drawbar_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +drawbar_type, +required_pull_in_kg, +actual_pull_in_kg, +required_power_in_hp, +actual_power_in_hp, +calculated_hitch_height_mm, +actual_hitch_height_mm, +test_file_format, +test_file_sheet_format +) + +select +client_id, +function_id, +file_syspk, +make, +model, +pull_type, +required_pull_in_kg::numeric , +actual_pull_in_kg::numeric , +required_power_in_hp::numeric, +actual_power_in_hp::numeric , +calculated_hitch_height_mm::numeric, +actual_hitch_height_mm::numeric, +file_format, +sheet_mnemonic +from + mmt_staging2.dboecd_test_engine_rpm_required_pull_block; + +update mmt_ods.test_instance_drawbar_info a +set weight_front_kg = front::int , +weight_rear_kg = rear::int , +weight_total_kg = total::int +from mmt_staging2.dboecd_test_engine_rpm_weight_block b +where b.weight_kg='Unballast' +and a.drawbar_type='UB' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_drawbar_info a +set weight_front_kg = front::int , +weight_rear_kg = rear::int , +weight_total_kg = total::int +from mmt_staging2.dboecd_test_engine_rpm_weight_block b +where b.weight_kg='Ballast' +and a.drawbar_type='B' +and a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_drawbar_info a +set test_condition=b.test_condition, +drawbar_type_info=b.type, +height_above_ground_max_mm=b.height_above_ground_max_mm::numeric, +height_above_ground_min_mm=b.height_above_ground_min_mm::numeric, +position_related_to_pto=b.position_related_to_pto, +wheel_base=b.wheel_base +from mmt_staging2.dboecd_test_transmission_drawbar_block b +where a.drawbar_type=b.test_condition +and a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_drawbar_info set drawbar_type_name='Un-Ballasted' where drawbar_type='UB'; +update mmt_ods.test_instance_drawbar_info set drawbar_type_name='Ballasted' where drawbar_type='B'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_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, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +dummy_f, +tyre_make, +size, +ply_rating::int, +load_carrying_capacity_in_kg, +pressure_kg_cm2::numeric, +number_of_lug::int, +number_of_no_load_lug_30m::int, +lug_height::numeric, +dynamic_rolling_radius_mm::numeric, +wheel_rim_make_size, +file_format, +sheet_mnemonic + from mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block ; + + insert into mmt_ods.drawbar_perf_results_summary + ( + client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +gear_number_and_range, +travel_speed_km_per_hr, +drawbar_power_kw, +drawbar_power_hp, +drawbar_pull_kgf, +drawbar_pull_kn, +engine_speed_min_1, +fan_speed_min_1, +wheel_slip_pct_front, +no_of_load_lugs_front, +wheel_slip_pct_rear, +fuel_consumption_l_per_h, +fuel_consumption_kg_per_kwh, +fuel_consumption_g_per_kwh, +fuel_consumption_kwh_per_l, +temp_engine_oil_c, +temp_trans_oil_c, +temp_coolant_c, +temp_fuel_in_c, +temp_fuel_out_c, +atm_conditions_rh_pct, +atm_conditions_temp_c, +atm_conditions_pressure_kpa, +test_file_format, +test_file_sheet_format +) + select + client_id, +function_id, +file_syspk, +make, +model, + c1, + c2::numeric, +c3::numeric, +c4::numeric, +c5::int, +c6::numeric, +c7::int, +c8::int, +c9::numeric, +c10::numeric, +c11::numeric, +c12::numeric, +c13::numeric, +c14::numeric, +c15::numeric, +c16::int, +c17::int, +c18::int, +c19::int, +c20::int, +c21::numeric, +c22::numeric, +c23::numeric, +file_format, +sheet_mnemonic + from mmt_staging2.dboecd_test_drawbar_performance_selected_summary_block; + +insert into mmt_ods.drawbar_perf_oecd_results + ( + client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +srl_no, +test_condition , +gear_number_and_range, +travel_speed_km_per_hr, +drawbar_power_kw, +drawbar_power_hp, +drawbar_pull_kgf, +drawbar_pull_kn, +engine_speed_min_1, +fan_speed_min_1, +wheel_slip_pct_front, +no_of_load_lugs_front, +wheel_slip_pct_rear, +fuel_consumption_l_per_h, +fuel_consumption_kg_per_kwh, +fuel_consumption_g_per_kwh, +fuel_consumption_kwh_per_l, +temp_engine_oil_c, +temp_trans_oil_c, +temp_coolant_c, +temp_fuel_in_c, +temp_fuel_out_c, +atm_conditions_rh_pct, +atm_conditions_temp_c, +atm_conditions_pressure_kpa, +test_file_format, +test_file_sheet_format +) + select + client_id, +function_id, +file_syspk, +make, +model, +c1_1, + c2_1, + c1, + c2::numeric, +c3::numeric, +c4::numeric, +c5::int, +c6::numeric, +c7::int, +c8::int, +c9::numeric, +c10::numeric, +c11::numeric, +c12::numeric, +c13::numeric, +c14::numeric, +c15::numeric, +c16::int, +c17::int, +c18::int, +c19::int, +c20::int, +c21::numeric, +c22::numeric, +c23::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block; + + +insert into mmt_ods.drawbar_perf_results + ( client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +gear_number_and_range, +travel_speed_km_per_hr, +drawbar_power_kw, +drawbar_power_hp, +drawbar_pull_kgf, +drawbar_pull_kn, +engine_speed_min_1, +fan_speed_min_1, +wheel_slip_pct_front, +no_of_load_lugs_front, +wheel_slip_pct_rear, +fuel_consumption_l_per_h, +fuel_consumption_kg_per_kwh, +fuel_consumption_g_per_kwh, +fuel_consumption_kwh_per_l, +temp_engine_oil_c, +temp_trans_oil_c, +temp_coolant_c, +temp_fuel_in_c, +temp_fuel_out_c, +atm_conditions_rh_pct, +atm_conditions_temp_c, +atm_conditions_pressure_kpa, +test_file_format, +test_file_sheet_format +) + select + client_id, +function_id, +file_syspk, +make, +model, + c1, + c2::numeric, +c3::numeric, +c4::numeric, +c5::int, +c6::numeric, +c7::int, +c8::int, +c9::numeric, +c10::numeric, +c11::numeric, +c12::numeric, +c13::numeric, +c14::numeric, +c15::numeric, +c16::int, +c17::int, +c18::int, +c19::int, +c20::int, +c21::numeric, +c22::numeric, +c23::numeric, +file_format, +sheet_mnemonic + from mmt_staging2.dboecd_test_drawbar_performance_gear_performance_block; + + + insert into mmt_ods.test_instance_equipment_info + (client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +srl_no, +instrument_name, +instrument_serial_no, +calibration_due_date, +test_file_format, +test_file_sheet_format ) +select + client_id, +function_id, +file_syspk, +make, +model, + s_no::int, + instruments, + instruments_no, + date '1899-12-30' + cali_due_date::int * interval '1' day as cali_due_date, + file_format, +sheet_mnemonic + from mmt_staging2.DBOECD_test_test_equipment_used_block; + +insert into mmt_ods.test_instance_measurement_uncertainty +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +load_cell, +rpm_meter, +speed, +fuel_flow_meter, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +load_cell, +rpm_meter, +speed, +fuel_flow_meter, +file_format, +sheet_mnemonic +from +mmt_staging2.dboecd_test_measurement_uncertainty_block; + +insert into mmt_ods.test_instance_tractor_info_misc +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +capacity_of_fuel_tank_ltr, +make_type_and_model_of_injection_pump, +manufacturers_production_setting, +make_type_and_model_of_injectors, +make_type_and_model_of_magneto_coil_and_distributor, +make_type_and_model_of_carburetor, +ignition_or_injection_timing, +test_file_format, +test_file_sheet_format +) +select + client_id, +function_id, +file_syspk, +make, +model, +regexp_replace(capacity_of_fuel_tank_lit,'[^0-9]', '', 'g')::int, +make_type_and_model_of_injection_pump, +manufacturer_production_setting, +make_type_and_model_of_injectors, +make_type_and_model_of_magneto_coil_and_distributor, +make_type_and_model_of_carburetor, +ignition_or_injection_timing_manual_or_automatic, +file_format, +sheet_mnemonic +from +mmt_staging2.dboecd_test_tractor_specifications_fuel_and_injection_block; + + +update mmt_ods.test_instance_tractor_info_misc a +set aircleaner_make_model=b.make_and_model +from mmt_staging2.dboecd_test_tractor_specifications_cleaner_block b +where b.cleaner_type='Air cleaner' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_tractor_info_misc a +set aircleaner_type=b.type +from mmt_staging2.dboecd_test_tractor_specifications_cleaner_block b +where cleaner_type='Air cleaner' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_tractor_info_misc a +set precleaner_make_model=b.make_and_model +from mmt_staging2.dboecd_test_tractor_specifications_cleaner_block b +where cleaner_type='Precleaner (if fitted)' +and a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_tractor_info_misc a +set precleaner_type=b.type +from mmt_staging2.dboecd_test_tractor_specifications_cleaner_block b +where cleaner_type='Precleaner (if fitted)' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_staging2.dboecd_test_transmission_speed_chart_block a +set tyre_condition=b.descr +from mmt_staging2.dboecd_test_transmission_speed_chart_desc_block b +where a.file_syspk=b.file_syspk; + + +insert into mmt_ods.test_instance_gear_speed_chart +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +forward_reverse, +gear, +speed_kmph, +tyre_condition, +test_file_format, +test_file_sheet_format +) +select + client_id, +function_id, +file_syspk, +make, +model, + 'forward', + gear, + cast(coalesce(nullif(forward,''),'0') as numeric), + tyre_condition, + file_format, +sheet_mnemonic + from + mmt_staging2.dboecd_test_transmission_speed_chart_block; + + + insert into mmt_ods.test_instance_gear_speed_chart +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +forward_reverse, +gear, +speed_kmph, +tyre_condition, +test_file_format, +test_file_sheet_format +) +select + client_id, +function_id, +file_syspk, +make, +model, + 'reverse', + gear, + cast(coalesce(nullif(reverse,''),'0') as numeric), + tyre_condition, + file_format, +sheet_mnemonic + from + mmt_staging2.dboecd_test_transmission_speed_chart_block; + + + +insert into mmt_ods.Test_instance_wheels_info +(client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +steered_driving_wheel, +location_of_driving_wheel, +make_of_tyres, +wheel_types, +wheel_size, +maximum_permissible_load_kg, +ply_rating, +track_width_max_mm, +track_width_min_mm, +inflation_pressure_kg_per_cm2, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +dummy_f, +location_of_driving_wheel, +make_of_tyres, +types, +size, +maximum_permissible_load_kg::int, +ply_rating::int, +track_width_max_mm::int, +track_width_min_mm::int, +inflation_pressure_kg_cm2::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.dboecd_test_transmission_wheels_block; + + +insert into mmt_ods.Test_instance_fuel_lubricant_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +trade_name, +fuel_lubricant_type, +octane_per_cetane_number, +viscocity, +density_at_15c, +test_file_format, +test_file_sheet_format +) +select + client_id, +function_id, +file_syspk, +make, +model, + trade_name, + type, + octane_cetane_number::numeric, + viscosity, +density_at_15c, +file_format, +sheet_mnemonic +from + mmt_staging2.dboecd_test_transmission_fuel_lubricant_block ; + + +insert into mmt_ods.drawbar_perf_observations +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +test_parameter , +acceptance_criteria , +observation , +remarks, +test_file_format, +test_file_sheet_format +) +select + client_id, +function_id, +file_syspk, +make, +model, + parameter, + acceptance_criteria , + observations, + remarks, + file_format, +sheet_mnemonic +from mmt_staging2.dboecd_test_remarks_block; + +update mmt_ods.test_instance a +set +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_template_rev_no=b.revision_no, +report_template_rev_Date=b.rev3, +report_template_no=b.rev1, +report_title=b.comments +from mmt_staging2.dboecd_test_remarks_footer_block b +where a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_drawbar_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.drawbar_perf_results_summary +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.drawbar_perf_oecd_results +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.drawbar_perf_results +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_equipment_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_measurement_uncertainty +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tractor_info_misc +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_gear_speed_chart +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.Test_instance_wheels_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.Test_instance_fuel_lubricant_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.drawbar_perf_observations +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'DBOECD','DBOECD_TEST' ,null,'ods', 'fn_DBOECD_test_ods', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'DBOECD','DBOECD_TEST' ,null,'ods', 'fn_DBOECD_test_ods', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-stg2.txt b/deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-stg2.txt new file mode 100644 index 0000000..bb03422 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/Drawbar/DBOECD-TEST-stg2.txt @@ -0,0 +1,1480 @@ +--select mmt_staging2.fn_dboecd_test_block(1,1,'DBOECD','DBOECD_TEST',526); + +drop function if exists mmt_staging2.fn_dboecd_test_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_dboecd_test_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + +/************************************************************* +Function Name:fn_dboecd_test_block +Function Desc: This function populates data into staging 2 block +File Format: DBOECD +Sheet Format: DBOECD_TEST +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_dboecd_test_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +***************************************************************/ + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ +truncate table mmt_staging2.dboecd_test_transmission_wheels_int; +truncate table mmt_staging2.dboecd_test_h1_int; +truncate table mmt_staging2.dboecd_test_engine_rpm_engine_to_pto_block; +truncate table mmt_staging2.dboecd_test_engine_rpm_required_pull_block; +truncate table mmt_staging2.dboecd_test_engine_rpm_weight_block; +truncate table mmt_staging2.dboecd_test_engine_rpm_tyre_details_block; +truncate table mmt_staging2.dboecd_test_engine_RPM_tyre_details_int; +truncate table mmt_staging2.dboecd_test_test_condition_block; +truncate table mmt_staging2.dboecd_test_drawbar_performance_selected_summary_block; +truncate table mmt_staging2.dboecd_test_drawbar_performance_gear_performance_block; +truncate table mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block; +truncate table mmt_staging2.dboecd_test_test_equipment_used_block; +truncate table mmt_staging2.dboecd_test_measurement_uncertainty_block; +truncate table mmt_staging2.dboecd_test_tractor_specifications_engine_details_block; +truncate table mmt_staging2.dboecd_test_tractor_specifications_cylinders_block; +truncate table mmt_staging2.dboecd_test_tractor_specifications_fuel_and_injection_block; +truncate table mmt_staging2.dboecd_test_tractor_specifications_cleaner_block; +truncate table mmt_staging2.dboecd_test_transmission_clutch_block; +truncate table mmt_staging2.dboecd_test_transmission_drawbar_block; +truncate table mmt_staging2.dboecd_test_transmission_speed_chart_desc_block; +truncate table mmt_staging2.dboecd_test_transmission_wheels_block; +truncate table mmt_staging2.dboecd_test_transmission_fuel_lubricant_int; +truncate table mmt_staging2.dboecd_test_remarks_block; +truncate table mmt_staging2.dboecd_test_remarks_footer_block; +truncate table mmt_staging2.dboecd_test_h1_block; +truncate table mmt_staging2.dboecd_test_transmission_fuel_lubricant_block; +truncate table mmt_staging2.dboecd_test_engine_rpm_rpm_block; +truncate table mmt_staging2.dboecd_test_transmission_speed_chart_block; +truncate table mmt_staging2.stg_specific_table_dboecd_test; +truncate table mmt_staging2.stg_process_table_dboecd_test; +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*run specific data */ +execute 'insert into mmt_staging2.stg_specific_table_dboecd_test +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* standardizing keywords */ +update mmt_staging2.stg_specific_table_dboecd_test set column3='Remarks:' where column3 like 'Remarks:%'; +update mmt_staging2.stg_specific_table_dboecd_test set column15='Objective' where column15 like 'Objective%'; + +update mmt_staging2.stg_specific_table_dboecd_test set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_dboecd_test set column3 = TRIM (LEADING FROM column3 ); + +/* To process repeated keywords */ +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/*updating row numbers in mmt_config table*/ + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_dboecd_test b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_staging2.stg_specific_table_dboecd_test a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update null for the last keyword as read end beacause of overlap of multiple formats*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Remarks:'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block */ + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine (RPM)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test condition'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Drawbar Performance Test Results (Selected Summary)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Drawbar Performance Test Results (Gear Performance Test)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''3.3.2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test equipment’s used'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor specification'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Transmission'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_dboecd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dboecd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Remarks:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tactor make*/ +select column6 into __make from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' and trim(' :' from column4)='Make'; + +/*selecting tractor model*/ +select column6 into __model from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_Test_H1' and trim(column3)='Tractor Model'; + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_TEST_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='DBOECD_TEST_H1_BLOCK'; + +/*selecting first block column and their data*/ +insert into mmt_staging2.DBOECD_TEST_H1_INT (c1,c2,rank) +select a.column3,column6,rank from mmt_staging2.stg_process_table_dboecd_test a where rank_tag='DBOECD_Test_H1' +union +select a.column9,column12,rank from mmt_staging2.stg_process_table_dboecd_test a where rank_tag='DBOECD_Test_H1' +order by column3,"rank"; + +/*execute if using old format*/ +update mmt_staging2.stg_process_table_dboecd_test set column11 = null +where column11 ='-'; +update mmt_staging2.stg_process_table_dboecd_test set column12 = null +where column12 = '-'; +update mmt_staging2.stg_process_table_dboecd_test set column9 = null +where column9 ='-'; +update mmt_staging2.stg_process_table_dboecd_test set column21 = null +where column21 = '-'; +update mmt_staging2.stg_process_table_dboecd_test set column12 = null +where column12 = '…..'; +update mmt_staging2.stg_process_table_dboecd_test set column8 = null +where column8 = '….'; +update mmt_staging2.stg_process_table_dboecd_test set column20 = trim(' Kg' from column20) +where rank =7 and rank_tag = 'DBOECD_test_transmission'; +update mmt_staging2.stg_process_table_dboecd_test set column23 = trim(' Kg' from column23) +where rank =7 and rank_tag = 'DBOECD_test_transmission'; + +/*selecting objective column and its data*/ +insert into mmt_staging2.DBOECD_TEST_H1_INT (c1,c2) +select 'Objective',column15 +from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_Test_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_dboecd_test a +where column15='Objective' +and rank_tag='DBOECD_Test_H1' +); + +/*selecting acceptance criteria column and its data*/ +insert into mmt_staging2.dboecd_TEST_H1_INT (c1,c2) +select 'Acceptance criteria',column15 +from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_Test_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_dboecd_test a +where trim(':' from column15)='Acceptance criteria' +and rank_tag='DBOECD_Test_H1' +); + +/*filling h1 block by transposing h1 int block*/ +insert into mmt_staging2.DBOECD_TEST_H1_Block +( +dummy_f, +Customer_Name, +Generation, +No_of_Sample, +Operator_Name, +Project_Group, +Sample_Receipt_Date, +Test_End_Date, +Test_Engineer, +Test_Location, +Test_Report_Date, +Test_Request_no, +Test_Standard_Refer, +Test_Start_Date, +Test_report_No, +Tractor_Model, +Tractor_Sr_No, +Objective, +Acceptance_criteria +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.DBOECD_TEST_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text); + + + /*deleting dummy null record and filling make, model and other id's*/ +delete from mmt_staging2.DBOECD_TEST_H1_Block where dummy_f is null ; + execute 'update mmt_staging2.DBOECD_TEST_H1_Block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_TEST_H1_Block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_TEST_H1_Block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_TEST_H1_Block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_TEST_H1_Block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_TEST_H1_Block set make=__make; + update mmt_staging2.DBOECD_TEST_H1_Block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_TEST_H1_BLOCK'); + +/* engine_RPM_RPM_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_engine_RPM_RPM_block',__file_format,__sheet_mnemonic,2); +v_block:='DBOECD_test_engine_RPM_RPM_block'; +insert into mmt_staging2.DBOECD_test_engine_RPM_RPM_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBOECD_test_engine_RPM_RPM_block +set low_idle_declared=(select column6 from +mmt_staging2.stg_process_table_dboecd_test where rank=2 and column3='Low Idle RPM' and rank_tag='DBOECD_test_engine_RPM') +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_RPM_block +set low_idle_observed=(select column8 from +mmt_staging2.stg_process_table_dboecd_test where rank=2 and column3='Low Idle RPM' and rank_tag='DBOECD_test_engine_RPM') +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_RPM_block +set high_idle_declared=(select column6 from +mmt_staging2.stg_process_table_dboecd_test where rank=3 and column3='High Idle RPM' and rank_tag='DBOECD_test_engine_RPM') +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_RPM_block +set high_idle_observed=(select column8 from +mmt_staging2.stg_process_table_dboecd_test where rank=3 and column3='High Idle RPM' and rank_tag='DBOECD_test_engine_RPM') +where dummy_f='dummy'; + +execute 'update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set make=__make; + update mmt_staging2.DBOECD_test_engine_RPM_RPM_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_engine_RPM_RPM_block'); + +/*engine_rpm_engine_to_pto_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'dboecd_test_engine_rpm_engine_to_pto_block',__file_format,__sheet_mnemonic,3); +v_block:='dboecd_test_engine_rpm_engine_to_pto_block'; + +insert into mmt_staging2.dboecd_test_engine_rpm_engine_to_pto_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set rated_speed= +(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and rank=4 ) +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set engine_to_PTO_ratio= +(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and rank=5 ) +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set wheel_base_mm= +(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and rank=6 ) +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set engine_power_hp= +(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where a.file_format='DBOECD' and a.sheet_mnemonic='DBOECD_TEST' and a.rank_tag='DBOECD_test_engine_RPM' +and rank=7 ) +where dummy_f='dummy'; + +update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set PTO_Power_hp= +(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where a.file_format='DBOECD' and a.sheet_mnemonic='DBOECD_TEST' and a.rank_tag='DBOECD_test_engine_RPM' +and rank=8 ) +where dummy_f='dummy'; + +execute 'update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set make=__make; + update mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'dboecd_test_engine_rpm_engine_to_pto_block'); + +/*engine_RPM_required_pull_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_engine_RPM_required_pull_block',__file_format,__sheet_mnemonic,4); +v_block:='DBOECD_test_engine_RPM_required_pull_block'; + + +insert into mmt_staging2.DBOECD_test_engine_RPM_required_pull_block ( pull_type) values ('UB'), ('B'); + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set required_pull_in_kg=(select column7 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Required pull in (kg)') +where pull_type='UB'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set required_pull_in_kg=(select column9 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Required pull in (kg)') +where pull_type='B'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set required_power_in_hp=(select column7 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Required Power in hp') +where pull_type='UB'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set required_power_in_hp=(select column9 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Required Power in hp') +where pull_type='B'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set actual_pull_in_kg=(select column7 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Actual pull in (kg)') +where pull_type='UB'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set actual_pull_in_kg=(select column9 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Actual pull in (kg)') +where pull_type='B'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set actual_power_in_hp=(select column7 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='actual power in hp') +where pull_type='UB'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set actual_power_in_hp=(select column9 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='actual power in hp') +where pull_type='B'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set calculated_hitch_height_mm=(select column7 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Calculated hitch height (mm)') +where pull_type='UB'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set calculated_hitch_height_mm=(select column9 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Calculated hitch height (mm)') +where pull_type='B'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set actual_hitch_height_mm=(select column7 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Actual hitch height (mm)') +where pull_type='UB'; + +update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +set actual_hitch_height_mm=(select column9 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and column3='Actual hitch height (mm)') +where pull_type='B'; + +execute 'update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set make=__make; + update mmt_staging2.DBOECD_test_engine_RPM_required_pull_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_engine_RPM_required_pull_block'); + +/* RPM_weight_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_engine_RPM_weight_block',__file_format,__sheet_mnemonic,5); +v_block:='DBOECD_test_engine_RPM_weight_block'; + +insert into mmt_staging2.DBOECD_test_engine_RPM_weight_block( +weight_kg , +Front , +rear , +Total +) +select column10,column13,column17,column22 from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and rank in(2,3); + +execute 'update mmt_staging2.DBOECD_test_engine_RPM_weight_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_weight_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_weight_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_weight_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_weight_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_engine_RPM_weight_block set make=__make; + update mmt_staging2.DBOECD_test_engine_RPM_weight_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_engine_RPM_weight_block'); + +/*rpm tyre details block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_engine_RPM_tyre_details_block',__file_format,__sheet_mnemonic,6); +v_block:='DBOECD_test_engine_RPM_tyre_details_block'; + + insert into mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int +( s_no,tyre_details,front,rear) + +select column10,column11,column15,column20 +from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_engine_RPM' +and rank >=5 and rank<=14 +order by rank; + + +execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set make=__make; + update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int set model=__model; + +/*rpm tyre details block*/ + +insert into mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block +( +dummy_f, +tyre_Make, +size, +Ply_Rating, +Load_Carrying_Capacity_in_Kg, +Pressure_kg_cm2, +Number_of_lug, +Number_of_no_load_lug_30m, +Lug_Height, +Dynamic_rolling_radius_mm, +Wheel_Rim_Make_Size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{front,rear}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[front::text,rear::text]) AS val + FROM mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int + ORDER BY generate_series(1,15),2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text + ,a_10 text); + + delete from mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block where dummy_f is null; + +execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set make=__make; + update mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_engine_RPM_tyre_details_block'); + +/* test condition block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_test_condition_block',__file_format,__sheet_mnemonic,7); +v_block:='DBOECD_test_test_condition_block'; + + +insert into mmt_staging2.DBOECD_test_test_condition_block(c1,c2,c3) +select column3 c1,column10 c2,column15 c3 +from mmt_staging2.stg_process_table_dboecd_test a +where a.rank_tag='DBOECD_test_test_condition'; + + +execute 'update mmt_staging2.DBOECD_test_test_condition_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_test_condition_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_test_condition_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_test_condition_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_test_condition_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_test_condition_block set make=__make; + update mmt_staging2.DBOECD_test_test_condition_block set model=__model; + +update mmt_staging2.dboecd_test_test_condition_block +set c3='B' +where c2='Ballasted'; + + +update mmt_staging2.dboecd_test_test_condition_block +set c3='UB' +where c2='Un-ballasted'; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_test_condition_block'); + +/* performance_selected_summary_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_drawbar_performance_selected_summary_block',__file_format,__sheet_mnemonic,8); + +v_block:='DBOECD_test_drawbar_performance_selected_summary_block'; + +insert into mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25) +select column3 c1, +column4 c2, +column5 c3, +column6 c4, +column7 c5, +column8 c6, +column9 c7, +column10 c8, +column11 c9, +column12 c10, +column13 c11, +column14 c12, +column15 c13, +column16 c14, +column17 c15, +column18 c16, +column19 c17, +column20 c18, +column21 c19, +column22 c20, +column23 c21, +column24 c22, +column25 c23, +column26 c24, +column27 c25 +from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_drawbar_performance_selected_summary' +and rank>3; + + + +execute 'update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set make=__make; + update mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_drawbar_performance_selected_summary_block'); + + /* Fuel_consumption_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'dboecd_test_drawbar_performance_fuel_consumption_block',__file_format,__sheet_mnemonic,9); + v_block:='dboecd_test_drawbar_performance_fuel_consumption_block'; + + +insert into mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block(c1_1,c2_1,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25) +with fuel_consumtion_data as( +select column3 c1, +column4 c2, +column5 c3, +column6 c4, +column7 c5, +column8 c6, +column9 c7, +column10 c8, +column11 c9, +column12 c10, +column13 c11, +column14 c12, +column15 c13, +column16 c14, +column17 c15, +column18 c16, +column19 c17, +column20 c18, +column21 c19, +column22 c20, +column23 c21, +column24 c22, +column25 c23, +column26 c24, +column27 c25, +rank +from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_fuel_consumption' and column5 is not null +and rank>3), +data_required as +( +select column3 as c1_1,column4 as c2_1 from mmt_staging2.stg_process_table_dboecd_test a where rank_tag='DBOECD_test_fuel_consumption' +and rank>3 and column5 is null +), +stag1_info_table as +(select c1_1,c2_1,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25 +from (select *,row_number() over () as rn from data_required) t1, +(select *,row_number() over () as rn from fuel_consumtion_data)t2 +where t1.rn = t2.rn) +select * from stag1_info_table; + +update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set Remark = (select replace(column3,'Remark: ','') from mmt_staging2.stg_process_table_dboecd_test where column3 like 'Remark%' and rank_tag='DBOECD_test_fuel_consumption'); + + +execute 'update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set file_format='''||p_file_format||''''; + update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set make=__make; + update mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'dboecd_test_drawbar_performance_fuel_consumption_block'); + + /* performance_gear_summary_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_drawbar_performance_gear_performance_block',__file_format,__sheet_mnemonic,10); + v_block:='DBOECD_test_drawbar_performance_gear_performance_block'; + + + insert into mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block (c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25) +select column3 c1, +column4 c2, +column5 c3, +column6 c4, +column7 c5, +column8 c6, +column9 c7, +column10 c8, +column11 c9, +column12 c10, +column13 c11, +column14 c12, +column15 c13, +column16 c14, +column17 c15, +column18 c16, +column19 c17, +column20 c18, +column21 c19, +column22 c20, +column23 c21, +column24 c22, +column25 c23, +column26 c24, +column27 c25 +from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_drawbar_performance_gear_performance' +and rank>3; + + + +execute 'update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set make=__make; + update mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_drawbar_performance_gear_performance_block'); + + /*test_equipment_used_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_test_equipment_used_block',__file_format,__sheet_mnemonic,11); + v_block:='DBOECD_test_test_equipment_used_block'; + + + insert into mmt_staging2.DBOECD_test_test_equipment_used_block( s_no,instruments,instruments_no,cali_due_date) +select column3,column4,column8,column12 +from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_test_equipment' +and rank>2; + +execute 'update mmt_staging2.DBOECD_test_test_equipment_used_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_test_equipment_used_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_test_equipment_used_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_test_equipment_used_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_test_equipment_used_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_test_equipment_used_block set make=__make; + update mmt_staging2.DBOECD_test_test_equipment_used_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_test_equipment_used_block'); + +/*measurement_uncertainty_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_measurement_uncertainty_block',__file_format,__sheet_mnemonic,12); + v_block:='DBOECD_test_measurement_uncertainty_block'; + + + insert into mmt_staging2.DBOECD_test_measurement_uncertainty_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBOECD_test_measurement_uncertainty_block set load_cell= +(select column20 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_test_equipment' and trim(' :' from column15)='Load cell'); + +update mmt_staging2.DBOECD_test_measurement_uncertainty_block set rpm_meter= +(select column20 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_test_equipment' and trim(' :' from column15)='RPM Meter'); + +update mmt_staging2.DBOECD_test_measurement_uncertainty_block set speed= +(select column20 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_test_equipment' and trim(' :' from column15)='Speed'); + + +update mmt_staging2.DBOECD_test_measurement_uncertainty_block set fuel_flow_meter= +(select column20 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_test_equipment' and trim(' :' from column15)='Fuel Flow meter'); + + + +execute 'update mmt_staging2.DBOECD_test_measurement_uncertainty_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_measurement_uncertainty_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_measurement_uncertainty_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_measurement_uncertainty_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_measurement_uncertainty_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_measurement_uncertainty_block set make=__make; + update mmt_staging2.DBOECD_test_measurement_uncertainty_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_measurement_uncertainty_block'); + + /*tractor_specifications_engine_details_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_tractor_specifications_engine_details_block',__file_format,__sheet_mnemonic,13); + v_block:='DBOECD_test_tractor_specifications_engine_details_block'; + + + insert into mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block(dummy_f) +values ('dummy'); + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set make_in_block=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='Make' +) +where dummy_f is not null; + + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set type=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='Type' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set model_in_block=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='Model' +) +where dummy_f is not null; + + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set serial_no=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='Serial No' +) +where dummy_f is not null; + + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set E_P_ratio=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='E/P Ratio' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set rated_speed=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='Rated Speed' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set high_idle=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='High Idle' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set high_idle=(select column6 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column4)='High Idle' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +set low_idle=(select replace(column8,'Low Idle:- ','') from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(column4)='High Idle' +) +where dummy_f is not null; + + +execute 'update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block set file_format='''||p_file_format||''''; + + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_tractor_specifications_engine_details_block'); + + /*tractor_specifications_cylinders_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_tractor_specifications_cylinders_block',__file_format,__sheet_mnemonic,14); + v_block:='DBOECD_test_tractor_specifications_cylinders_block'; + + + insert into mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block(dummy_f) +values ('dummy'); + +update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block +set number=(select column11 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column9)='Number' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block +set stroke=(select column11 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column9)='Stroke' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block +set bore=(select column11 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column9)='Bore' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block +set capacity=(select column11 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :' from column9)='Capacity' +) +where dummy_f is not null; + + +execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set make=__make; + update mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_tractor_specifications_cylinders_block'); + + /*fuel_and_injection_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_tractor_specifications_fuel_and_injection_block',__file_format,__sheet_mnemonic,15); + v_block:='DBOECD_test_tractor_specifications_fuel_and_injection_block'; + + + insert into mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block(dummy_f) +values ('dummy'); + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_injection_pump=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(column12)='Make, type and model of injection pump' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set capacity_of_fuel_tank_lit=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim('. :-' from column12)='Capacity of fuel tank, lit' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_injection_pump=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :-' from column12)='Make, type and model of injection pump' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Manufacturer_production_setting=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :-' from column12)='Manufacturer’s production setting' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_injectors=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :-' from column12)='Make, type and model of injectors' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_magneto_coil_and_distributor=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :-' from column12)='Make, type and model of magneto, coil and distributor' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_carburetor=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :-' from column12)='Make, type and model of carburetor' +) +where dummy_f is not null; + +update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +set Ignition_or_injection_timing_Manual_or_automatic=(select column17 from mmt_staging2.stg_process_table_dboecd_test a +where rank_tag='DBOECD_test_tractor_specifications' +and trim(' :-' from column12)='Ignition or injection timing (Manual or automatic)' +) +where dummy_f is not null; + + +execute 'update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set make=__make; + update mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_tractor_specifications_fuel_and_injection_block'); + + /*tractor_specifications_cleaner_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_tractor_specifications_cleaner_block',__file_format,__sheet_mnemonic,16); + v_block:='DBOECD_test_tractor_specifications_cleaner_block'; + + + insert into mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block(cleaner_type) +values ('Air cleaner'),('Precleaner (if fitted)'); + +update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block +set make_and_model = +(select column23 from mmt_staging2.stg_process_table_dboecd_test a where + rank_tag='DBOECD_test_tractor_specifications' +and column21='Make and model' and rank=3) +where cleaner_type='Air cleaner'; + +update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block +set type= +(select column23 from mmt_staging2.stg_process_table_dboecd_test a where + rank_tag='DBOECD_test_tractor_specifications' +and column21='Type' and rank=5) +where cleaner_type='Air cleaner'; + +update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block +set make_and_model = +(select column23 from mmt_staging2.stg_process_table_dboecd_test a where + rank_tag='DBOECD_test_tractor_specifications' +and column21='Make and model' and rank=7) +where cleaner_type='Precleaner (if fitted)'; + +update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block +set type= +(select column23 from mmt_staging2.stg_process_table_dboecd_test a where +rank_tag='DBOECD_test_tractor_specifications' +and column21='Type' and rank=9) +where cleaner_type='Precleaner (if fitted)'; + + +execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set make=__make; + update mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block set model=__model; + + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_tractor_specifications_cleaner_block'); + + /*transmission_clutch_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_transmission_clutch_block',__file_format,__sheet_mnemonic,17); + v_block:='DBOECD_test_transmission_clutch_block'; + + + insert into mmt_staging2.DBOECD_test_transmission_clutch_block(dummy_f) values ('dummy'); + + +update mmt_staging2.DBOECD_test_transmission_clutch_block a +set clutch_type=( +select column6 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Type' and rank=2 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_transmission_clutch_block a +set steering_type=( +select column6 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Type' and rank=5 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_transmission_clutch_block a +set diameter_of_disc_mm=( +select column6 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Diameter of disc, mm' and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + + +execute 'update mmt_staging2.DBOECD_test_transmission_clutch_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_transmission_clutch_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_clutch_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_clutch_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_transmission_clutch_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_transmission_clutch_block set make=__make; + update mmt_staging2.DBOECD_test_transmission_clutch_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_transmission_clutch_block'); + + /*transmission_drawbar_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_transmission_drawbar_block',__file_format,__sheet_mnemonic,18); + v_block:='DBOECD_test_transmission_drawbar_block'; + +insert into mmt_staging2.DBOECD_test_transmission_drawbar_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBOECD_test_transmission_drawbar_block a +set type=( +select column8 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Type' and rank=7 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_transmission_drawbar_block a +set Height_above_ground_max_mm=( +select column8 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Height above ground (max), mm' and rank=9 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_transmission_drawbar_block a +set Height_above_ground_min_mm=( +select column8 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Height above ground (min), mm' and rank=11 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_transmission_drawbar_block a +set Position_related_to_PTO=( +select column8 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Position related to PTO' and rank=13 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_transmission_drawbar_block a +set Wheel_Base=( +select column8 from mmt_staging2.stg_process_table_dboecd_test b +where trim(' :' from b.column3)='Wheel Base' and rank=15 and b.rank_tag='DBOECD_test_transmission') +where dummy_F='dummy'; + + execute 'update mmt_staging2.DBOECD_test_transmission_drawbar_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_transmission_drawbar_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_drawbar_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_drawbar_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_transmission_drawbar_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_transmission_drawbar_block set make=__make; + update mmt_staging2.DBOECD_test_transmission_drawbar_block set model=__model; + + update mmt_staging2.dboecd_test_transmission_drawbar_block a +set test_condition=b.c3 +from mmt_staging2.dboecd_test_test_condition_block b +where a.file_syspk=b.file_syspk; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_transmission_drawbar_block'); + +/*transmission_speed_chart_desc_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_transmission_speed_chart_desc_block',__file_format,__sheet_mnemonic,19); + v_block:='DBOECD_test_transmission_speed_chart_desc_block'; + +insert into mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block +(descr) +select column10 +from +mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_transmission' +and rank=1; + + +execute 'update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set make=__make; + update mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_transmission_speed_chart_desc_block'); + +/*transmission_speed_chart_desc_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_transmission_speed_chart_block',__file_format,__sheet_mnemonic,20); + /*transmission_speed_chart_block*/ + v_block:='DBOECD_test_transmission_speed_chart_block'; + + insert into mmt_staging2.DBOECD_test_transmission_speed_chart_block +(gear,forward,reverse) +select column10,column11, column13 from +mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_transmission' +and rank>=3; + + +execute 'update mmt_staging2.dboecd_test_transmission_speed_chart_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.dboecd_test_transmission_speed_chart_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.dboecd_test_transmission_speed_chart_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.dboecd_test_transmission_speed_chart_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.dboecd_test_transmission_speed_chart_block set file_format='''||p_file_format||''''; + update mmt_staging2.dboecd_test_transmission_speed_chart_block set make=__make; + update mmt_staging2.dboecd_test_transmission_speed_chart_block set model=__model; + delete from mmt_staging2.dboecd_test_transmission_speed_chart_block where gear is null; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_transmission_speed_chart_block'); + +/*transmission_wheels_in*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_transmission_wheels_block',__file_format,__sheet_mnemonic,21); + v_block:='DBOECD_test_transmission_wheels_block'; + +insert into mmt_staging2.DBOECD_test_transmission_wheels_int(Descriptions,Steered_wheels,Driving_wheel) +select column15,column20,column23 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_transmission' +and rank>=3 and rank<=11 +order by rank; + +update mmt_staging2.DBOECD_test_transmission_wheels_int +set Driving_wheel=Steered_wheels +where trim(' :' from Descriptions)='Location of driving wheel' +and Driving_wheel =''; + + +execute 'update mmt_staging2.DBOECD_test_transmission_wheels_int set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_transmission_wheels_int set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_wheels_int set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_wheels_int set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_transmission_wheels_int set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_transmission_wheels_int set make=__make; + update mmt_staging2.DBOECD_test_transmission_wheels_int set model=__model; + + + /*transmission_wheels_block*/ +insert into mmt_staging2.dboecd_test_transmission_wheels_block + ( + dummy_f, + Location_of_driving_wheel, +Make_of_tyres, +types, +size, +Maximum_permissible_load_kg, +Ply_rating, +Track_width_max_mm, +Track_width_min_mm, +Inflation_pressure_kg_cm2 + + ) + SELECT * +FROM crosstab( + 'SELECT unnest(''{steered_wheels,driving_wheel}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[steered_wheels::text,driving_wheel::text]) AS val + FROM mmt_staging2.dboecd_test_transmission_wheels_int + ORDER BY generate_series(1,10),2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +delete from dboecd_test_transmission_wheels_block where dummy_f is null; + + +execute 'update mmt_staging2.dboecd_test_transmission_wheels_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.dboecd_test_transmission_wheels_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.dboecd_test_transmission_wheels_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.dboecd_test_transmission_wheels_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.dboecd_test_transmission_wheels_block set file_format='''||p_file_format||''''; + update mmt_staging2.dboecd_test_transmission_wheels_block set make=__make; + update mmt_staging2.dboecd_test_transmission_wheels_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_transmission_wheels_block'); + +/*transmission_fuel_lubricant*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_transmission_fuel_lubricant_block',__file_format,__sheet_mnemonic,22); + v_block:='DBOECD_test_transmission_fuel_lubricant_block'; + + +insert into mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int( Descriptions,Diesel_BS_IV,Engine_oil,Transmission_oil) +select column15,column18,column20,column23 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_transmission' +and rank>=14 and rank<=18 +order by rank; + + +execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set make=__make; + update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int set model=__model; + + +/*transmission_fuel_lubricant_block*/ +insert into mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block + ( + dummy_f, + Trade_name, +type, +Octane_Cetane_number, +Viscosity, +Density_at_15C +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{diesel_bs_iv,engine_oil,transmission_oil}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[diesel_bs_iv::text,engine_oil::text,transmission_oil::text]) AS val + FROM mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text); + + delete from DBOECD_test_transmission_fuel_lubricant_block where dummy_f is null; + +execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set make=__make; + update mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_transmission_fuel_lubricant_block'); + +/*DBOECD_test_remarks_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_remarks_block',__file_format,__sheet_mnemonic,23); + v_block:='DBOECD_test_remarks_block'; + +insert into mmt_staging2.DBOECD_test_remarks_block +( +remarks , +parameter , +acceptance_criteria, +observations +) +select column3,column13,column15,column23 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank>3 and rank<=5; + + +execute 'update mmt_staging2.DBOECD_test_remarks_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_remarks_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_remarks_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_remarks_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_remarks_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_remarks_block set make=__make; + update mmt_staging2.DBOECD_test_remarks_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_remarks_block'); + +/*DBOECD_test_remarks_footer_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBOECD_test_remarks_footer_block',__file_format,__sheet_mnemonic,24); + v_block:='DBOECD_test_remarks_footer_block'; + +insert into mmt_staging2.DBOECD_test_remarks_footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set prepared_by=( select column7 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +--update mmt_staging2.DBOECD_test_remarks_footer_block a +--set reviewed_by=( select column7 from mmt_staging2.stg_process_table_dboecd_test b +--where b.rank_tag='DBOECD_test_remarks' +--and trim(column3)='Reviewed by' ) +--where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set approved_by=( select column7 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=9 ) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=10 ) +where dummy_F='dummy'; + + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set rev2=( select column9 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=10 ) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set rev3=( select column18 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=10 ) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set replaces=( select column23 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=6) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set revision_no=( select column23 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=7) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set date=( select column19 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=6) +where dummy_F='dummy'; + +update mmt_staging2.DBOECD_test_remarks_footer_block a +set date=( select column19 from mmt_staging2.stg_process_table_dboecd_test b +where b.rank_tag='DBOECD_test_remarks' +and rank=7 and column9 is not null) +where dummy_F='dummy'; + + +execute 'update mmt_staging2.DBOECD_test_remarks_footer_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBOECD_test_remarks_footer_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBOECD_test_remarks_footer_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.DBOECD_test_remarks_footer_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.DBOECD_test_remarks_footer_block set file_format='''||p_file_format||''''; + update mmt_staging2.DBOECD_test_remarks_footer_block set make=__make; + update mmt_staging2.DBOECD_test_remarks_footer_block set model=__model; +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBOECD_test_remarks_footer_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_dboecd_test_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_dboecd_test_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_ODS.txt b/deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_ODS.txt new file mode 100644 index 0000000..2412091 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_ODS.txt @@ -0,0 +1,754 @@ +drop function if exists mmt_ods.fn_dbstd_test_ods; +CREATE OR REPLACE FUNCTION mmt_ods.fn_dbstd_test_ods() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + + begin + +/************************************************************ +Function Name:fn_dbstd_test_ods +Function Desc: This function populates data into ODS +File Format: DBSTD +Sheet Format: DBSTD_TEST +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_ods.fn_dbstd_test_ods() +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* ODS */ +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +acceptance_criteria, +objective_of_test, +date_of_test, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +test_request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as sample_receipt_date , +test_report_no, +generation, +customer_name, +test_engineer, +date '1899-12-30' + test_report_date::int * interval '1' day as test_report_date , +no_of_sample, +date '1899-12-30' + test_start_date::int* interval '1' day as test_start_date , +date '1899-12-30' + test_end_date::int* interval '1' day as test_end_date , +tractor_sr_no, +test_standard_refer, +test_location, +operator_name, +project_group, +objective, +acceptance_criteria, +current_date, +file_format, +sheet_mnemonic +from +mmt_staging2.dbstd_test_h1_block; + +update mmt_ods.test_instance a +set test_condition=b.c2 +from mmt_staging2.dbstd_test_test_condition_block b +where a.test_file_ref_no=b.file_syspk; + +/* ODS */ + +insert into mmt_ods.test_instance_engine_info +(client_id,function_id,test_file_ref_no,tractor_model,tractor_make,low_idle_declared,low_idle_observed,high_idle_declared,high_idle_observed,test_file_format, +test_file_sheet_format) +select client_id,function_id,file_syspk,make,model,low_idle_declared,low_idle_observed::int,high_idle_declared,high_idle_observed::int,file_format,sheet_mnemonic +from mmt_staging2.DBSTD_test_engine_RPM_RPM_block; + +update mmt_ods.test_instance_engine_info a +set engine_to_pto_ratio_540_pto=b.engine_to_pto_ratio::numeric,engine_power_hp = b.engine_power_hp::int, +pto_power_hp = b.pto_power_hp::numeric +from +mmt_staging2.dbstd_test_engine_rpm_engine_to_pto_block b +where a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_engine_info a +set engine_cylinder_stroke_mm=b.stroke::int,engine_cylinder_bore_mm=b.bore::numeric,engine_cylinder_no=b.number::int,engine_cylinder_capacity_ltr=b.capacity::int +from mmt_staging2.dbstd_test_tractor_specifications_cylinders_block b +where test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_engine_info a +set engine_serial_no=serial_no,engine_type=type,rated_rpm=rated_speed::int,engine_make=b.make_in_block ,engine_model = b.model_in_block +from mmt_staging2.dbstd_test_tractor_specifications_engine_details_block b +where test_file_ref_no=b.file_syspk; + +/*ODS */ +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +wheel_base_mm, +tractor_engine_hp, +pto_power_hp, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +wheel_base_mm::int, +engine_power_hp::int, +pto_power_hp::numeric, +file_format, +sheet_mnemonic +from dbstd_test_engine_rpm_engine_to_pto_block; + +update mmt_ods.test_instance_tractor_info a +set +steering_type=b.steering_type, +transmission_type=clutch_type, +transmission_disc_diam=diameter_of_disc_mm +from mmt_staging2.dbstd_test_transmission_clutch_block b +where a.test_file_ref_no=b.file_syspk; + +/*ODS */ +insert into mmt_ods.test_instance_drawbar_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +drawbar_type, +required_pull_in_kg, +actual_pull_in_kg, +required_power_in_hp, +actual_power_in_hp, +calculated_hitch_height_mm, +actual_hitch_height_mm, +test_file_format, +test_file_sheet_format +) + +select +client_id, +function_id, +file_syspk, +make, +model, +pull_type, +required_pull_in_kg::numeric , +actual_pull_in_kg::numeric , +required_power_in_hp::numeric, +actual_power_in_hp::numeric , +calculated_hitch_height_mm::numeric, +actual_hitch_height_mm::numeric , +file_format, +sheet_mnemonic +from + mmt_staging2.dbstd_test_engine_rpm_required_pull_block; + +update mmt_ods.test_instance_drawbar_info a +set weight_front_kg = front::int , +weight_rear_kg = rear::int , +weight_total_kg = total::int +from mmt_staging2.dbstd_test_engine_rpm_weight_block b +where b.weight_kg='Unballast' +and a.drawbar_type='UB' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_drawbar_info a +set weight_front_kg = front::int , +weight_rear_kg = rear::int , +weight_total_kg = total::int +from mmt_staging2.dbstd_test_engine_rpm_weight_block b +where b.weight_kg='Ballast' +and a.drawbar_type='B' +and a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_drawbar_info a +set test_condition=b.test_condition, +drawbar_type_info=b.type, +height_above_ground_max_mm=b.height_above_ground_max_mm::numeric, +height_above_ground_min_mm=b.height_above_ground_min_mm::numeric, +position_related_to_pto=b.position_related_to_pto, +wheel_base=b.wheel_base +from mmt_staging2.dbstd_test_transmission_drawbar_block b +where a.drawbar_type=b.test_condition +and a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_drawbar_info set drawbar_type_name='UnBallasted' where drawbar_type='UB'; +update mmt_ods.test_instance_drawbar_info set drawbar_type_name='Ballasted' where drawbar_type='B'; + +/* ODS */ +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_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, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +dummy_f, +tyre_make, +size, +ply_rating::int, +load_carrying_capacity_in_kg, +pressure_kg_cm2::numeric, +number_of_lug::int, +number_of_no_load_lug_30m::int, +lug_height::numeric, +dynamic_rolling_radius_mm::numeric, +wheel_rim_make_size , +file_format, +sheet_mnemonic +from mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block ; + +/* ODS */ + +insert into mmt_ods.drawbar_perf_results_summary + ( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +gear_number_and_range, +travel_speed_km_per_hr, +drawbar_power_kw, +drawbar_power_hp, +drawbar_pull_kgf, +drawbar_pull_kn, +engine_speed_min_1, +fan_speed_min_1, +wheel_slip_pct_front, +no_of_load_lugs_front, +wheel_slip_pct_rear, +fuel_consumption_l_per_h, +fuel_consumption_kg_per_kwh, +fuel_consumption_g_per_kwh, +fuel_consumption_kwh_per_l, +temp_engine_oil_c, +temp_trans_oil_c, +temp_coolant_c, +temp_fuel_in_c, +temp_fuel_out_c, +atm_conditions_rh_pct, +atm_conditions_temp_c, +atm_conditions_pressure_kpa, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +c1, +c2::numeric, +c3::numeric, +c4::numeric, +c5::int, +c6::numeric, +c7::int, +c8::int, +c9::numeric, +c10::numeric, +c11::numeric, +c12::numeric, +c13::numeric, +c14::numeric, +c15::numeric, +c16::int, +c17::int, +c18::int, +c19::int, +c20::int, +c21::numeric, +c22::numeric, +c23::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.dbstd_test_drawbar_performance_selected_summary_block; + +/* ODS */ +insert into mmt_ods.drawbar_perf_results +(client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +gear_number_and_range, +travel_speed_km_per_hr, +drawbar_power_kw, +drawbar_power_hp, +drawbar_pull_kgf, +drawbar_pull_kn, +engine_speed_min_1, +fan_speed_min_1, +wheel_slip_pct_front, +no_of_load_lugs_front, +wheel_slip_pct_rear, +fuel_consumption_l_per_h, +fuel_consumption_kg_per_kwh, +fuel_consumption_g_per_kwh, +fuel_consumption_kwh_per_l, +temp_engine_oil_c, +temp_trans_oil_c, +temp_coolant_c, +temp_fuel_in_c, +temp_fuel_out_c, +atm_conditions_rh_pct, +atm_conditions_temp_c, +atm_conditions_pressure_kpa, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +c1, +c2::numeric, +c3::numeric, +c4::numeric, +c5::int, +c6::numeric, +c7::int, +c8::int, +c9::numeric, +c10::numeric, +c11::numeric, +c12::numeric, +c13::numeric, +c14::numeric, +c15::numeric, +c16::int, +c17::int, +c18::int, +c19::int, +c20::int, +c21::numeric, +c22::numeric, +c23::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.dbstd_test_drawbar_performance_gear_performance_block; + +/* ODS */ +insert into mmt_ods.test_instance_equipment_info +(client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +srl_no,instrument_name,instrument_serial_no,calibration_due_date,test_file_format, +test_file_sheet_format) +select +client_id, +function_id, +file_syspk, +make, +model, +s_no::int, +instruments, +instruments_no, +date '1899-12-30' + cali_due_date::int * interval '1' day as cali_due_date , +file_format, +sheet_mnemonic +from mmt_staging2.DBSTD_test_test_equipment_used_block; + +/* ODS */ +insert into mmt_ods.test_instance_measurement_uncertainty +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +load_cell, +rpm_meter, +speed, +fuel_flow_meter, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +load_cell, +rpm_meter, +speed, +fuel_flow_meter , +file_format, +sheet_mnemonic +from +mmt_staging2.dbstd_test_measurement_uncertainty_block; + +/* ODS */ +insert into mmt_ods.test_instance_tractor_info_misc +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +capacity_of_fuel_tank_ltr, +make_type_and_model_of_injection_pump, +manufacturers_production_setting, +make_type_and_model_of_injectors, +make_type_and_model_of_magneto_coil_and_distributor, +make_type_and_model_of_carburetor, +ignition_or_injection_timing, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +regexp_replace(capacity_of_fuel_tank_lit,'[^0-9]', '', 'g')::int, +make_type_and_model_of_injection_pump, +manufacturer_production_setting, +make_type_and_model_of_injectors, +make_type_and_model_of_magneto_coil_and_distributor, +make_type_and_model_of_carburetor, +ignition_or_injection_timing_manual_or_automatic, +file_format, +sheet_mnemonic +from +mmt_staging2.dbstd_test_tractor_specifications_fuel_and_injection_block; + + +update mmt_ods.test_instance_tractor_info_misc a +set aircleaner_make_model=b.make_and_model +from mmt_staging2.dbstd_test_tractor_specifications_cleaner_block b +where b.cleaner_type='Air cleaner' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_tractor_info_misc a +set aircleaner_type=b.type +from mmt_staging2.dbstd_test_tractor_specifications_cleaner_block b +where cleaner_type='Air cleaner' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_ods.test_instance_tractor_info_misc a +set precleaner_make_model=b.make_and_model +from mmt_staging2.dbstd_test_tractor_specifications_cleaner_block b +where cleaner_type='Precleaner (if fitted)' +and a.test_file_ref_no=b.file_syspk; + +update mmt_ods.test_instance_tractor_info_misc a +set precleaner_type=b.type +from mmt_staging2.dbstd_test_tractor_specifications_cleaner_block b +where cleaner_type='Precleaner (if fitted)' +and a.test_file_ref_no=b.file_syspk; + + +update mmt_staging2.dbstd_test_transmission_speed_chart_block a +set tyre_condition=b.descr +from mmt_staging2.dbstd_test_transmission_speed_chart_desc_block b +where a.file_syspk=b.file_syspk; + +/* ODS */ + +insert into mmt_ods.test_instance_gear_speed_chart +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +forward_reverse, +gear, +speed_kmph, +tyre_condition, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +'forward', +gear, +cast(coalesce(nullif(forward,''),'0') as numeric), +tyre_condition, +file_format, +sheet_mnemonic +from +mmt_staging2.dbstd_test_transmission_speed_chart_block; + +/* ODs */ +insert into mmt_ods.test_instance_gear_speed_chart +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +forward_reverse, +gear, +speed_kmph, +tyre_condition, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +'reverse', +gear, +cast(coalesce(nullif(reverse,''),'0') as numeric), +tyre_condition, +file_format, +sheet_mnemonic +from +mmt_staging2.dbstd_test_transmission_speed_chart_block; + +/* ODS */ +insert into mmt_ods.Test_instance_wheels_info +(client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +steered_driving_wheel, +location_of_driving_wheel, +make_of_tyres, +wheel_types, +wheel_size, +maximum_permissible_load_kg, +ply_rating, +track_width_max_mm, +track_width_min_mm, +inflation_pressure_kg_per_cm2, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +dummy_f, +location_of_driving_wheel, +make_of_tyres, +types, +size, +maximum_permissible_load_kg::int, +ply_rating::int, +track_width_max_mm::int, +track_width_min_mm::int, +inflation_pressure_kg_cm2::numeric, + file_format, +sheet_mnemonic +from mmt_staging2.dbstd_test_transmission_wheels_block; + +update mmt_staging2.dbstd_test_transmission_wheels_block a +set location_of_driving_wheel=(select location_of_driving_wheel from +mmt_staging2.dbstd_test_transmission_wheels_block b where location_of_driving_wheel is not null) +where location_of_driving_wheel is null; + +/* ODS */ +insert into mmt_ods.Test_instance_fuel_lubricant_info +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +trade_name, +fuel_lubricant_type, +octane_per_cetane_number, +viscocity, +density_at_15c, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +trade_name, +type, +octane_cetane_number::numeric, +viscosity, +density_at_15c, +file_format, +sheet_mnemonic +from +mmt_staging2.dbstd_test_transmission_fuel_lubricant_block ; + +/* ODS */ +insert into mmt_ods.drawbar_perf_observations +( +client_id, +function_id, +test_file_ref_no, +tractor_make, +tractor_model, +test_parameter , +acceptance_criteria , +observation , +remarks , +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +file_syspk, +make, +model, +parameter, +acceptance_criteria , +observations, +remarks , +file_format, +sheet_mnemonic +from mmt_staging2.dbstd_test_remarks_block; + +update mmt_ods.test_instance a +set +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_template_rev_no=b.revision_no, +report_template_rev_Date=b.rev3, +report_template_no=b.rev1, +report_title=b.comments +from mmt_staging2.dbstd_test_remarks_footer_block b +where a.test_file_ref_no=b.file_syspk; + +select file_syspk into __file_syspk from mmt_staging2.dbstd_test_h1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_drawbar_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.drawbar_perf_results_summary +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.drawbar_perf_results +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_equipment_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_measurement_uncertainty +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tractor_info_misc +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_gear_speed_chart +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.Test_instance_wheels_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.Test_instance_fuel_lubricant_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.drawbar_perf_observations +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_stg2.txt b/deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_stg2.txt new file mode 100644 index 0000000..cef6b81 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/Drawbar/DBSTD_TEST_stg2.txt @@ -0,0 +1,1342 @@ +drop function if exists mmt_staging2.fn_dbstd_test_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_dbstd_test_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS void AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + + begin + +/************************************************************ +Function Name:fn_dbstd_test_block +Function Desc: This function populates data into staging 2 block +File Format: DBSTD +Sheet Format: DBSTD_TEST +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_dbstd_test_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_dbstd_test_block(1,2,'DBSTD','DBSTD_TEST',526) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.dbstd_test_transmission_wheels_int; +truncate table mmt_staging2.dbstd_test_h1_int; +truncate table mmt_staging2.dbstd_test_engine_rpm_engine_to_pto_block; +truncate table mmt_staging2.dbstd_test_engine_rpm_required_pull_block; +truncate table mmt_staging2.dbstd_test_engine_rpm_weight_block; +truncate table mmt_staging2.dbstd_test_engine_rpm_tyre_details_block; +truncate table mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int; +truncate table mmt_staging2.dbstd_test_test_condition_block; +truncate table mmt_staging2.dbstd_test_drawbar_performance_selected_summary_block; +truncate table mmt_staging2.dbstd_test_drawbar_performance_gear_performance_block; +truncate table mmt_staging2.dbstd_test_test_equipment_used_block; +truncate table mmt_staging2.dbstd_test_measurement_uncertainty_block; +truncate table mmt_staging2.dbstd_test_tractor_specifications_engine_details_block; +truncate table mmt_staging2.dbstd_test_tractor_specifications_cylinders_block; +truncate table mmt_staging2.dbstd_test_tractor_specifications_fuel_and_injection_block; +truncate table mmt_staging2.dbstd_test_tractor_specifications_cleaner_block; +truncate table mmt_staging2.dbstd_test_transmission_clutch_block; +truncate table mmt_staging2.dbstd_test_transmission_drawbar_block; +truncate table mmt_staging2.dbstd_test_transmission_speed_chart_desc_block; +truncate table mmt_staging2.dbstd_test_transmission_wheels_block; +truncate table mmt_staging2.dbstd_test_transmission_fuel_lubricant_int; +truncate table mmt_staging2.dbstd_test_remarks_block; +truncate table mmt_staging2.dbstd_test_remarks_footer_block; +truncate table mmt_staging2.dbstd_test_h1_block; +truncate table mmt_staging2.dbstd_test_transmission_fuel_lubricant_block; +truncate table mmt_staging2.dbstd_test_engine_rpm_rpm_block; +truncate table mmt_staging2.dbstd_test_transmission_speed_chart_block; +truncate table mmt_staging2.stg_specific_table_dbstd_test; +truncate table mmt_staging2.stg_process_table_dbstd_test; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*run specific data */ +execute 'insert into mmt_staging2.stg_specific_table_dbstd_test +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* standardizing keywords */ +update mmt_staging2.stg_specific_table_dbstd_test set column3='Remarks' where column3 like 'Remarks%'; +update mmt_staging2.stg_specific_table_dbstd_test set column15='Objective' where column15 like 'Objective%'; + +update mmt_staging2.stg_specific_table_dbstd_test set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_dbstd_test set column3 = TRIM (LEADING FROM column3 ); + +/* To process repeated keywords */ +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/*updating row numbers in mmt_config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_dbstd_test b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_staging2.stg_specific_table_dbstd_test a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update null for the last keyword as read end beacause of overlap of multiple formats*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Remarks'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine (RPM)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test condition'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Drawbar Performance Test Results (Selected Summary)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Drawbar Performance Test Results (Gear Performance Test)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test equipment’s used'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor specification'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Transmission'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_dbstd_test +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_dbstd_test a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Remarks'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/*selecting tactor make*/ +select column6 into __make from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' and trim(column4)='Make' ; + +select column6 into __model from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' and trim(column4)='Model'; + + +/*block starts - DBSTD_TEST_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_TEST_H1_BLOCK',__file_format,__sheet_mnemonic,1); + +insert into mmt_staging2.DBSTD_TEST_H1_INT (c1,c2) +select a.column3,column6 from mmt_staging2.stg_process_table_dbstd_test a where rank_tag='DBSTD_Test_H1'; + +insert into mmt_staging2.DBSTD_TEST_H1_INT (c1,c2) +select a.column9,column12 from mmt_staging2.stg_process_table_dbstd_test a where rank_tag='DBSTD_Test_H1'; + +insert into mmt_staging2.DBSTD_TEST_H1_INT (c1,c2) +select 'Objective',column15 +from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_Test_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_dbstd_test a +where column15='Objective' +and rank_tag='DBSTD_Test_H1' +); + +insert into mmt_staging2.DBSTD_TEST_H1_INT (c1,c2) +select 'Acceptance criteria',column15 +from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_Test_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_dbstd_test a +where column15='Acceptance criteria' +and rank_tag='DBSTD_Test_H1' +); + +insert into mmt_staging2.DBSTD_TEST_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_criteria +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.DBSTD_TEST_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text); + + + delete from mmt_staging2.DBSTD_TEST_H1_Block where dummy_f is null ; + execute 'update mmt_staging2.DBSTD_TEST_H1_Block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_TEST_H1_Block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_TEST_H1_Block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_TEST_H1_Block set make=__make; + update mmt_staging2.DBSTD_TEST_H1_Block set model=__model; + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_TEST_H1_BLOCK'); + + /* block DBSTD_test_engine_RPM_RPM_block */ + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_engine_RPM_RPM_block',__file_format,__sheet_mnemonic,2); + +insert into mmt_staging2.DBSTD_test_engine_RPM_RPM_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBSTD_test_engine_RPM_RPM_block +set low_idle_declared=(select column6 from +mmt_staging2.stg_process_table_dbstd_test where rank=2 and column3='Low Idle RPM' and rank_tag='DBSTD_test_engine_RPM') +where dummy_f='dummy'; + +update mmt_staging2.DBSTD_test_engine_RPM_RPM_block +set low_idle_observed=(select column8 from +mmt_staging2.stg_process_table_dbstd_test where rank=2 and column3='Low Idle RPM' and rank_tag='DBSTD_test_engine_RPM') +where dummy_f='dummy'; + +update mmt_staging2.DBSTD_test_engine_RPM_RPM_block +set high_idle_declared=(select column6 from +mmt_staging2.stg_process_table_dbstd_test where rank=3 and column3='High Idle RPM' and rank_tag='DBSTD_test_engine_RPM') +where dummy_f='dummy'; + +update mmt_staging2.DBSTD_test_engine_RPM_RPM_block +set high_idle_observed=(select column8 from +mmt_staging2.stg_process_table_dbstd_test where rank=3 and column3='High Idle RPM' and rank_tag='DBSTD_test_engine_RPM') +where dummy_f='dummy'; + + +execute 'update mmt_staging2.DBSTD_test_engine_RPM_RPM_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_RPM_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_RPM_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_engine_RPM_RPM_block set make=__make; + update mmt_staging2.DBSTD_test_engine_RPM_RPM_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_engine_RPM_RPM_block'); + + /* block DBSTD_test_engine_RPM_engine_to_PTO_block*/ + + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'dbstd_test_engine_rpm_engine_to_pto_block',__file_format,__sheet_mnemonic,3); +insert into mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block(dummy_f) values ('dummy'); + + +update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set rated_speed= +(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and rank=4 ) +where dummy_f='dummy'; + +update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set engine_to_PTO_ratio= +(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and rank=5 ) +where dummy_f='dummy'; + +update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set wheel_base_mm= +(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and rank=6 ) +where dummy_f='dummy'; + + +update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set engine_power_hp= +(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where a.file_format='DBSTD' and a.sheet_mnemonic='DBSTD_TEST' and a.rank_tag='DBSTD_test_engine_RPM' +and rank=7 ) +where dummy_f='dummy'; + +update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set PTO_Power_hp= +(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where a.file_format='DBSTD' and a.sheet_mnemonic='DBSTD_TEST' and a.rank_tag='DBSTD_test_engine_RPM' +and rank=8 ) +where dummy_f='dummy'; + + +execute 'update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set make=__make; + update mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'dbstd_test_engine_rpm_engine_to_pto_block'); + +/* block DBSTD_test_engine_RPM_required_pull_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_engine_RPM_required_pull_block',__file_format,__sheet_mnemonic,4); + +insert into mmt_staging2.DBSTD_test_engine_RPM_required_pull_block ( pull_type) values ('UB'), ('B'); + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set required_pull_in_kg=(select column7 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Required pull in (kg)') +where pull_type='UB'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set required_pull_in_kg=(select column9 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Required pull in (kg)') +where pull_type='B'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set required_power_in_hp=(select column7 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Required Power in hp') +where pull_type='UB'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set required_power_in_hp=(select column9 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Required Power in hp') +where pull_type='B'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set actual_pull_in_kg=(select column7 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Actual pull in (kg)') +where pull_type='UB'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set actual_pull_in_kg=(select column9 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Actual pull in (kg)') +where pull_type='B'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set actual_power_in_hp=(select column7 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='actual power in hp') +where pull_type='UB'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set actual_power_in_hp=(select column9 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='actual power in hp') +where pull_type='B'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set calculated_hitch_height_mm=(select column7 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Calculated hitch height (mm)') +where pull_type='UB'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set calculated_hitch_height_mm=(select column9 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Calculated hitch height (mm)') +where pull_type='B'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set actual_hitch_height_mm=(select column7 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Actual hitch height (mm)') +where pull_type='UB'; + +update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +set actual_hitch_height_mm=(select column9 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and column3='Actual hitch height (mm)') +where pull_type='B'; + + +execute 'update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block set make=__make; + update mmt_staging2.DBSTD_test_engine_RPM_required_pull_block set model=__model; + + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_engine_RPM_required_pull_block'); + + /* block DBSTD_test_engine_RPM_weight_block */ + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_engine_RPM_weight_block',__file_format,__sheet_mnemonic,5); + +insert into mmt_staging2.DBSTD_test_engine_RPM_weight_block( +weight_kg , +Front , +rear , +Total +) +select column10,column13,column17,column22 from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and rank in(2,3); + + +execute 'update mmt_staging2.DBSTD_test_engine_RPM_weight_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_weight_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_weight_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_engine_RPM_weight_block set make=__make; + update mmt_staging2.DBSTD_test_engine_RPM_weight_block set model=__model; +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_engine_RPM_weight_block'); + +/*block - rpm tyre details block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_engine_RPM_tyre_details_block',__file_format,__sheet_mnemonic,6); + +insert into mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int +( s_no,tyre_details,front,rear) + +select column10,column11,column15,column20 +from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_engine_RPM' +and rank >=5 and rank<=14; + + +execute 'update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int set make=__make; + update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int set model=__model; + +insert into mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block +( +dummy_f, +tyre_Make, +size, +Ply_Rating, +Load_Carrying_Capacity_in_Kg, +Pressure_kg_cm2, +Number_of_lug, +Number_of_no_load_lug_30m, +Lug_Height, +Dynamic_rolling_radius_mm, +Wheel_Rim_Make_Size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{front,rear}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[front::text,rear::text]) AS val + FROM mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int + ORDER BY generate_series(1,15),2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text + ,a_10 text); + + delete from mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block where dummy_f is null; + +execute 'update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block set make=__make; + update mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block set model=__model; + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_engine_RPM_tyre_details_block'); + + /* block DBSTD_test_test_condition_block */ + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_test_condition_block',__file_format,__sheet_mnemonic,7); + +insert into mmt_staging2.DBSTD_test_test_condition_block(c1,c2,c3) +select column3 c1,column10 c2,column15 c3 +from mmt_staging2.stg_process_table_dbstd_test a +where a.rank_tag='DBSTD_test_test_condition'; + + +execute 'update mmt_staging2.DBSTD_test_test_condition_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_test_condition_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_test_condition_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_test_condition_block set make=__make; + update mmt_staging2.DBSTD_test_test_condition_block set model=__model; + +update mmt_staging2.dbstd_test_test_condition_block +set c3='B' +where c2='Ballasted'; + +update mmt_staging2.dbstd_test_test_condition_block +set c3='UB' +where c2='Un-ballasted'; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_test_condition_block'); + +/* block DBSTD_test_drawbar_performance_selected_summary_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_drawbar_performance_selected_summary_block',__file_format,__sheet_mnemonic,8); + +insert into mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25) +select column3 c1, +column4 c2, +column5 c3, +column6 c4, +column7 c5, +column8 c6, +column9 c7, +column10 c8, +column11 c9, +column12 c10, +column13 c11, +column14 c12, +column15 c13, +column16 c14, +column17 c15, +column18 c16, +column19 c17, +column20 c18, +column21 c19, +column22 c20, +column23 c21, +column24 c22, +column25 c23, +column26 c24, +column27 c25 +from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_drawbar_performance_selected_summary' +and rank>3; + + +execute 'update mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block set make=__make; + update mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_drawbar_performance_selected_summary_block'); + +/* block DBSTD_test_drawbar_performance_gear_performance_block */ + + /* DBSTD_test_drawbar_performance_gear_performance_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_drawbar_performance_gear_performance_block',__file_format,__sheet_mnemonic,9); + +insert into mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block (c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25) +select column3 c1, +column4 c2, +column5 c3, +column6 c4, +column7 c5, +column8 c6, +column9 c7, +column10 c8, +column11 c9, +column12 c10, +column13 c11, +column14 c12, +column15 c13, +column16 c14, +column17 c15, +column18 c16, +column19 c17, +column20 c18, +column21 c19, +column22 c20, +column23 c21, +column24 c22, +column25 c23, +column26 c24, +column27 c25 +from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_drawbar_performance_gear_performance' +and rank>3; + + +execute 'update mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block set make=__make; + update mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block set model=__model; + + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_drawbar_performance_gear_performance_block'); + +/* block DBSTD_test_test_equipment_used_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_test_equipment_used_block',__file_format,__sheet_mnemonic,10); + + insert into mmt_staging2.DBSTD_test_test_equipment_used_block( s_no,instruments,instruments_no,cali_due_date) +select column3,column4,column8,column12 +from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_test_equipment' +and rank>2; + + + +execute 'update mmt_staging2.DBSTD_test_test_equipment_used_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_test_equipment_used_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_test_equipment_used_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_test_equipment_used_block set make=__make; + update mmt_staging2.DBSTD_test_test_equipment_used_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_test_equipment_used_block'); + +/* block DBSTD_test_measurement_uncertainty_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_measurement_uncertainty_block',__file_format,__sheet_mnemonic,11); + +insert into mmt_staging2.DBSTD_test_measurement_uncertainty_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBSTD_test_measurement_uncertainty_block set load_cell= +(select column20 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_test_equipment' and trim(column15)='Load cell'); + +update mmt_staging2.DBSTD_test_measurement_uncertainty_block set rpm_meter= +(select column20 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_test_equipment' and trim(column15)='RPM Meter'); + +update mmt_staging2.DBSTD_test_measurement_uncertainty_block set speed= +(select column20 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_test_equipment' and trim(column15)='Speed'); + + +update mmt_staging2.DBSTD_test_measurement_uncertainty_block set fuel_flow_meter= +(select column20 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_test_equipment' and trim(column15)='Fuel Flow meter'); + + + +execute 'update mmt_staging2.DBSTD_test_measurement_uncertainty_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_measurement_uncertainty_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_measurement_uncertainty_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_measurement_uncertainty_block set make=__make; + update mmt_staging2.DBSTD_test_measurement_uncertainty_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_measurement_uncertainty_block'); + + /* block DBSTD_test_tractor_specifications_engine_details_block */ + + /*tractor_specifications_engine_details_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_tractor_specifications_engine_details_block',__file_format,__sheet_mnemonic,12); + +insert into mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block(dummy_f) +values ('dummy'); + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set make_in_block=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='Make' +) +where dummy_f is not null; + + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set type=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='Type' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set model_in_block=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='Model' +) +where dummy_f is not null; + + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set serial_no=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='Serial No' +) +where dummy_f is not null; + + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set E_P_ratio=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='E P Ratio' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set rated_speed=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='Rated Speed' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set high_idle=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='High Idle' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set high_idle=(select column6 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='High Idle' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +set low_idle=(select column8 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column4)='High Idle' +) +where dummy_f is not null; + + +execute 'update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block set function_id='||p_function_id||''; + + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_tractor_specifications_engine_details_block'); + + /* block DBSTD_test_tractor_specifications_cylinders_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_tractor_specifications_cylinders_block',__file_format,__sheet_mnemonic,13); + +insert into mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block(dummy_f) +values ('dummy'); + +update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block +set number=(select column11 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column9)='Number' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block +set stroke=(select column11 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column9)='Stroke' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block +set bore=(select column11 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column9)='Bore' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block +set capacity=(select column11 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column9)='Capacity' +) +where dummy_f is not null; + + +execute 'update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block set make=__make; + update mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_tractor_specifications_cylinders_block'); + +/*block fuel_and_injection_block*/ + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_tractor_specifications_fuel_and_injection_block',__file_format,__sheet_mnemonic,14); + +insert into mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block(dummy_f) +values ('dummy'); + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_injection_pump=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Make, type and model of injection pump' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set capacity_of_fuel_tank_lit=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Capacity of fuel tank lit' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_injection_pump=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Make, type and model of injection pump' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Manufacturer_production_setting=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Manufacturer’s production setting' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_injectors=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Make, type and model of injectors' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_magneto_coil_and_distributor=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Make, type and model of magneto, coil and distributor' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Make_type_and_model_of_carburetor=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Make, type and model of carburetor' +) +where dummy_f is not null; + +update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +set Ignition_or_injection_timing_Manual_or_automatic=(select column17 from mmt_staging2.stg_process_table_dbstd_test a +where rank_tag='DBSTD_test_tractor_specifications' +and trim(column12)='Ignition or injection timing (Manual or automatic)' +) +where dummy_f is not null; + + +execute 'update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block set make=__make; + update mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_tractor_specifications_fuel_and_injection_block'); + + /*tractor_specifications_cleaner_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_tractor_specifications_cleaner_block',__file_format,__sheet_mnemonic,15); + +insert into mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block(cleaner_type) +values ('Air cleaner'),('Precleaner (if fitted)'); + +update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block +set type= +(select column23 from mmt_staging2.stg_process_table_dbstd_test a where + rank_tag='DBSTD_test_tractor_specifications' +and column21='Type' and rank=5) +where cleaner_type='Air cleaner'; + +update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block +set type= +(select column23 from mmt_staging2.stg_process_table_dbstd_test a where +rank_tag='DBSTD_test_tractor_specifications' +and column21='Type' and rank=9) +where cleaner_type='Precleaner (if fitted)'; + + +execute 'update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block set make=__make; + update mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_tractor_specifications_cleaner_block'); + + + /*transmission_clutch_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_transmission_clutch_block',__file_format,__sheet_mnemonic,16); + +insert into mmt_staging2.DBSTD_test_transmission_clutch_block(dummy_f) values ('dummy'); + + +update mmt_staging2.DBSTD_test_transmission_clutch_block a +set clutch_type=( +select column6 from mmt_staging2.stg_process_table_dbstd_test b +where b.column3='Type' and rank=2 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_clutch_block a +set steering_type=( +select column6 from mmt_staging2.stg_process_table_dbstd_test b +where b.column3='Type' and rank=5 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_clutch_block a +set diameter_of_disc_mm=( +select column6 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Diameter of disc, mm' and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + + +execute 'update mmt_staging2.DBSTD_test_transmission_clutch_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_transmission_clutch_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_transmission_clutch_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_transmission_clutch_block set make=__make; + update mmt_staging2.DBSTD_test_transmission_clutch_block set model=__model; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_transmission_clutch_block'); + + /*transmission_drawbar_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_transmission_drawbar_block',__file_format,__sheet_mnemonic,17); + +insert into mmt_staging2.DBSTD_test_transmission_drawbar_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBSTD_test_transmission_drawbar_block a +set type=( +select column8 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Type' and rank=7 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_drawbar_block a +set Height_above_ground_max_mm=( +select column8 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Height above ground (max) mm' and rank=9 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_drawbar_block a +set Height_above_ground_max_mm=( +select column8 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Height above ground (max) mm' and rank=9 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_drawbar_block a +set Height_above_ground_min_mm=( +select column8 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Height above ground (min) mm' and rank=11 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_drawbar_block a +set Position_related_to_PTO=( +select column8 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Position related to PTO' and rank=13 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_transmission_drawbar_block a +set Wheel_Base=( +select column8 from mmt_staging2.stg_process_table_dbstd_test b +where trim(b.column3)='Wheel Base' and rank=15 and b.rank_tag='DBSTD_test_transmission') +where dummy_F='dummy'; + + + +execute 'update mmt_staging2.DBSTD_test_transmission_drawbar_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_transmission_drawbar_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_transmission_drawbar_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_transmission_drawbar_block set make=__make; + update mmt_staging2.DBSTD_test_transmission_drawbar_block set model=__model; + + +update mmt_staging2.dbstd_test_transmission_drawbar_block a +set test_condition=b.c3 +from mmt_staging2.dbstd_test_test_condition_block b +where a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_transmission_drawbar_block'); + +/*transmission_speed_chart_desc_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_transmission_speed_chart_desc_block',__file_format,__sheet_mnemonic,18); + +insert into mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block +( +descr) +select column10 +from +mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_transmission' +and rank=1; + + +execute 'update mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block set make=__make; + update mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_transmission_speed_chart_desc_block'); + +/*transmission_speed_chart_desc_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_transmission_speed_chart_block',__file_format,__sheet_mnemonic,19); + +insert into mmt_staging2.DBSTD_test_transmission_speed_chart_block +(gear,forward,reverse) +select column10,column11, column13 from +mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_transmission' +and rank>=3; + +update mmt_staging2.dbstd_test_transmission_speed_chart_block a +set reverse= b.first_value from (SELECT + syspk, reverse, value_partition, first_value(reverse) over (partition by value_partition order by syspk) +FROM ( + SELECT + syspk, + reverse, + sum(case when reverse is null then 0 else 1 end) over (order by syspk) as value_partition + FROM mmt_staging2.dbstd_test_transmission_speed_chart_block + ORDER BY syspk ASC +) as q) b where a.syspk = b.syspk; + + +execute 'update mmt_staging2.dbstd_test_transmission_speed_chart_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.dbstd_test_transmission_speed_chart_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.dbstd_test_transmission_speed_chart_block set function_id='||p_function_id||''; + update mmt_staging2.dbstd_test_transmission_speed_chart_block set make=__make; + update mmt_staging2.dbstd_test_transmission_speed_chart_block set model=__model; + delete from mmt_staging2.dbstd_test_transmission_speed_chart_block where gear is null; + + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_transmission_speed_chart_block'); + +/*transmission_wheels_in*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_transmission_wheels_block',__file_format,__sheet_mnemonic,20); + + +insert into mmt_staging2.DBSTD_test_transmission_wheels_int(Descriptions,Steered_wheels,Driving_wheel) +select column15,column20,column23 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_transmission' +and rank>=3 and rank<=11; + +update mmt_staging2.DBSTD_test_transmission_wheels_int +set Driving_wheel=Steered_wheels +where trim(Descriptions)='Location of driving wheel' +and Driving_wheel =''; + +execute 'update mmt_staging2.DBSTD_test_transmission_wheels_int set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_transmission_wheels_int set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_transmission_wheels_int set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_transmission_wheels_int set make=__make; + update mmt_staging2.DBSTD_test_transmission_wheels_int set model=__model; + + +insert into mmt_staging2.dbstd_test_transmission_wheels_block + ( + dummy_f, + Location_of_driving_wheel, +Make_of_tyres, +types, +size, +Maximum_permissible_load_kg, +Ply_rating, +Track_width_max_mm, +Track_width_min_mm, +Inflation_pressure_kg_cm2 + + ) + SELECT * +FROM crosstab( + 'SELECT unnest(''{steered_wheels,driving_wheel}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[steered_wheels::text,driving_wheel::text]) AS val + FROM mmt_staging2.dbstd_test_transmission_wheels_int + ORDER BY generate_series(1,10),2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +delete from dbstd_test_transmission_wheels_block where dummy_f is null; + + +execute 'update mmt_staging2.dbstd_test_transmission_wheels_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.dbstd_test_transmission_wheels_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.dbstd_test_transmission_wheels_block set function_id='||p_function_id||''; + update mmt_staging2.dbstd_test_transmission_wheels_block set make=__make; + update mmt_staging2.dbstd_test_transmission_wheels_block set model=__model; + + +insert into mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int( Descriptions,Diesel_BS_IV,Engine_oil,Transmission_oil) +select column15,column18,column20,column23 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_transmission' +and rank>=14 and rank<=18; + + +execute 'update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int set make=__make; + update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_transmission_wheels_block'); + +/*transmission_fuel_lubricant*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_transmission_fuel_lubricant_block',__file_format,__sheet_mnemonic,21); + + +insert into mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block + ( + dummy_f, + Trade_name, +type, +Octane_Cetane_number, +Viscosity, +Density_at_15C +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{diesel_bs_iv,engine_oil,transmission_oil}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[diesel_bs_iv::text,engine_oil::text,transmission_oil::text]) AS val + FROM mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text); + + delete from DBSTD_test_transmission_fuel_lubricant_block where dummy_f is null; + +execute 'update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block set make=__make; + update mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_transmission_fuel_lubricant_block'); + +/*DBSTD_test_remarks_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_remarks_block',__file_format,__sheet_mnemonic,22); + +insert into mmt_staging2.DBSTD_test_remarks_block +( +remarks , +parameter , +acceptance_criteria, +observations +) +select column3,column13,column15,column23 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and rank>3 and rank<=5; + + +execute 'update mmt_staging2.DBSTD_test_remarks_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_remarks_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_remarks_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_remarks_block set make=__make; + update mmt_staging2.DBSTD_test_remarks_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_remarks_block'); + +/*DBSTD_test_remarks_footer_block*/ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'DBSTD_test_remarks_footer_block',__file_format,__sheet_mnemonic,23); + +insert into mmt_staging2.DBSTD_test_remarks_footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set prepared_by=( select column7 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set reviewed_by=( select column7 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and trim(column3)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set approved_by=( select column7 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column3 like 'THIS DOCUMENT%' ) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and rank=(select rank + 1 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column3 like 'THIS DOCUMENT%') ) +where dummy_F='dummy'; + + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set rev2=( select column9 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and rank=(select rank + 1 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column3 like 'THIS DOCUMENT%') ) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set rev3=( select column18 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and rank=(select rank + 1 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column3 like 'THIS DOCUMENT%') ) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set replaces=( select column23 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column23 like 'Replaces%') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set revision_no=( select column23 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column23 like 'Revision%') +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set date=( select column19 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and rank=(select rank+1 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and column23 like 'Revision%')) +where dummy_F='dummy'; + +update mmt_staging2.DBSTD_test_remarks_footer_block a +set date=( select column19 from mmt_staging2.stg_process_table_dbstd_test b +where b.rank_tag='DBSTD_test_remarks' +and rank=7 and column9 is not null) +where dummy_F='dummy'; + + +execute 'update mmt_staging2.DBSTD_test_remarks_footer_block set file_syspk='||p_file_syspk||''; + execute 'update mmt_staging2.DBSTD_test_remarks_footer_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.DBSTD_test_remarks_footer_block set function_id='||p_function_id||''; + update mmt_staging2.DBSTD_test_remarks_footer_block set make=__make; + update mmt_staging2.DBSTD_test_remarks_footer_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'DBSTD_test_remarks_footer_block'); + +execute 'update dbstd_test_transmission_fuel_lubricant_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_h1_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_engine_rpm_rpm_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_engine_rpm_engine_to_pto_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_engine_rpm_required_pull_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_engine_rpm_weight_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_engine_rpm_tyre_details_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_test_condition_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_drawbar_performance_selected_summary_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_drawbar_performance_gear_performance_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_test_equipment_used_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_measurement_uncertainty_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_tractor_specifications_engine_details_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_tractor_specifications_cylinders_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_tractor_specifications_fuel_and_injection_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_tractor_specifications_cleaner_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_transmission_clutch_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_transmission_drawbar_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_transmission_speed_chart_desc_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_transmission_speed_chart_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_transmission_wheels_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_transmission_fuel_lubricant_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_remarks_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; +execute 'update dbstd_test_remarks_footer_block set file_format='''||p_file_format||''' , sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +end +$$ LANGUAGE plpgsql; + + + + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_ODS.SQL new file mode 100644 index 0000000..80c3f2f --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_ODS.SQL @@ -0,0 +1,408 @@ +drop function if exists mmt_staging2.fn_IHT_BRT_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_BRT_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __brake_perf_test_condition_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + begin + +/************************************************************ +Function Name:fn_IHT_BRT_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_BRT +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_BRT_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_BRT'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_BRT'; +delete from mmt_ods.test_instance_drawbar_info where test_file_sheet_format='IHT_BRT'; +delete from mmt_ods.test_instance_weight_reaction where test_file_sheet_format='IHT_BRT'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_BRT'; +delete from mmt_ods.iht_brake_perf_test_condition where test_file_sheet_format='IHT_BRT'; +delete from mmt_ods.iht_brake_perf_test_results where test_file_sheet_format='IHT_BRT'; + + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +test_condition, +test_standard_desc, +test_standard_id, +acceptance_criteria, +remarks, +observations +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +to_date(sample_receipt_date,'DD-MM-YYYY'), +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +to_date(Test_Report_Date,'DD-MM-YYYY'), +No_of_Sample, +to_date(Test_Start_Date,'DD-MM-YYYY'), +to_date(Test_End_Date, 'DD-MM-YYYY'), +Tractor_Sr_No, +Test_Standard_Refer, +test_location, +Operator_Name, +Project_Group, +Objective, +condition, +test_standard, +test_standard_id::numeric, +acceptance_criteria, +remarks, +observations +from +mmt_staging2.IHT_BRT_H1_block; + +update mmt_ods.test_instance a +set +report_prepared_date=to_date(b.prepared_date,'DD-MM-YYYY'), +report_reviewed_date=to_date(b.reviewed_date,'DD-MM-YYYY'), +report_approved_date=to_date(b.approved_date,'DD-MM-YYYY'), +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.IHT_BRT_footer_block b +where a.test_file_sheet_format='IHT_BRT'; + + + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_use_type, +tyre_pressure_kg_per_cm2 +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +tyre_details, +tyre_make, +tyre_size, +ply_rating::numeric, +tyre_use_type, +pressure_kg_cm2::numeric +from mmt_staging2.IHT_BRT_tyre_details_block; + + + +insert into mmt_ods.test_instance_drawbar_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +weight_front_kg, +weight_rear_kg, +weight_total_kg, +status +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +test_condition, +front::numeric , +rear::numeric , +total::numeric , +status +from mmt_staging2.IHT_BRT_weight_block; + + +/*block */ + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_platform +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +platform +from mmt_staging2.iht_brt_h1_block; + +insert into mmt_ods.iht_brake_perf_test_condition +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +date_of_test, +time_of_test, +location_name, +test_mode +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::date, +column8, +column6, +column10 +from mmt_staging2.iht_brt_test_res_block where rank =1; + +insert into mmt_ods.iht_brake_perf_test_condition +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +date_of_test, +time_of_test, +location_name, +test_mode +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::date, +column6, +column8, +column10 +from mmt_staging2.iht_brt_test_res_block where rank =16; + +insert into mmt_ods.iht_brake_perf_test_condition +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +date_of_test, +location_name, +time_of_test, +test_mode +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::date, +column6, +column8, +column10 +from mmt_staging2.iht_brt_test_res_1_block where rank =1; + + +insert into mmt_ods.iht_brake_perf_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_mode, +srl_no, +trigger_speed_km_per_h, +brake_control_input_force_kg, +required_corrected_stopping_distance_m, +actual_stopping_distance_m, +deceleration_m_s2_v2_2s, +wind_velocity_kmph, +ambient_temp_c, +humidity_rh_pct, +observation +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3::numeric, +column4::numeric, +column5::numeric, +column6::numeric, +column7::numeric, +column8::numeric, +column9, +column10::numeric, +column11::numeric, +column12 +from mmt_staging2.iht_brt_test_res_block where ods_record =1; + +insert into mmt_ods.iht_brake_perf_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_mode, +srl_no, +trigger_speed_km_per_h, +brake_control_input_force_kg, +required_corrected_stopping_distance_m, +actual_stopping_distance_m, +deceleration_m_s2_v2_2s, +wind_velocity_kmph, +ambient_temp_c, +humidity_rh_pct, +observation +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3::numeric, +column4::numeric, +column5::numeric, +column6::numeric, +column7::numeric, +column8::numeric, +column9, +column10::numeric, +column11::numeric, +column12 +from mmt_staging2.iht_brt_test_res_1_block where column3 is not null and column4 is not null and ods_record =1; + +update mmt_ods.iht_brake_perf_test_results a +set brake_perf_test_condition_id=(select syspk +from mmt_ods.iht_brake_perf_test_condition b +where a.test_mode =b.test_mode); + +select file_syspk into __file_syspk from mmt_staging2.IHT_BRT_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_drawbar_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_brake_perf_test_condition +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_brake_perf_test_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_STG2.sql b/deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_STG2.sql new file mode 100644 index 0000000..c8825d1 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_BRT_STG2.sql @@ -0,0 +1,784 @@ +drop function if exists mmt_staging2.fn_IHT_BRT_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_BRT_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************ +Function Name:fn_IHT_BRT_block +Function Desc: This function populates data into staging 2 block +File Format: IHT +Sheet Format: IHT_BRT +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_BRT_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_IHT_BRT_block(1,2,'IHT','IHT_BRT',456) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.IHT_BRT_H1_Int; +truncate table mmt_staging2.IHT_BRT_H1_block; +truncate table mmt_staging2.IHT_BRT_Weight_Tyre_Int; +truncate table mmt_staging2.IHT_BRT_Weight_Block; +truncate table mmt_staging2.IHT_BRT_Tyre_Details_Block; +truncate table mmt_staging2.IHT_BRT_Test_Res_Block; +truncate table mmt_staging2.IHT_BRT_Test_Res_1_Block; +truncate table mmt_staging2.IHT_BRT_Footer_Block; +truncate table mmt_staging2.stg_specific_table_IHT_BRT; +truncate table mmt_staging2.stg_process_table_IHT_BRT; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for IHT */ +execute 'insert into mmt_staging2.stg_specific_table_IHT_BRT +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_IHT_BRT +set column11='Objective' where column11 like 'Objective%'; + +update mmt_staging2.stg_specific_table_IHT_BRT +set column10='Acceptance criteria' where column10 like 'Acceptance criteria%'; + + +update mmt_staging2.stg_specific_table_IHT_BRT +set column11='Condition' where column11 like 'Condition%'; + + +update mmt_staging2.stg_specific_table_IHT_BRT set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_IHT_BRT set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_IHT_BRT b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_IHT_BRT a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Prepared by'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ +execute 'insert into mmt_staging2.stg_process_table_IHT_BRT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_BRT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request No'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_BRT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_BRT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Date- 21-FEB-2021'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_BRT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_BRT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Date- 04-July-2019'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_IHT_BRT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_BRT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Weight (kg)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_IHT_BRT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_BRT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Remarks:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tractor model*/ +select column5 into __model from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_H1' and trim(column3)='Tractor Model'; + +/*block starts - IHT_BRT_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_BRT_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='IHT_BRT_H1_BLOCK'; +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select a.column3,column5 from mmt_staging2.stg_process_table_IHT_BRT a where rank_tag='IHT_BRT_H1' +and rank <=9; + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select a.column7,column9 from mmt_staging2.stg_process_table_IHT_BRT a where rank_tag='IHT_BRT_H1' +and rank <=9; + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select 'Objective',column11 +from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_BRT a +where column11='Objective' +and rank_tag='IHT_BRT_H1' +); + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select 'Acceptance criteria',column10 +from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_BRT a +where column10='Acceptance criteria' +and rank_tag='IHT_BRT_H1' +); + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select 'Condition',column11 +from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_BRT a +where column11='Condition' +and rank_tag='IHT_BRT_H1' +); + + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select 'Test std',column4 +from mmt_staging2.stg_process_table_IHT_BRT b +where b.column3='Test std' +and rank_tag='IHT_BRT_H1'; + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select 'Test std Id',column9 +from mmt_staging2.stg_process_table_IHT_BRT b +where b.column3='Test std' +and rank_tag='IHT_BRT_H1'; + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select split_part(column3,':',1),split_part(column3,':',2) +from mmt_staging2.stg_process_table_IHT_BRT +where rank_tag='IHT_BRT_Footer' and rank=1; + +insert into mmt_staging2.IHT_BRT_H1_INT (c1,c2) +select split_part(column3,':',1),split_part(column3,':',2) +from mmt_staging2.stg_process_table_IHT_BRT +where rank_tag='IHT_BRT_Footer' and rank=2; + +update mmt_staging2.IHT_BRT_H1_Int set model=__model; +execute 'update mmt_staging2.IHT_BRT_H1_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +insert into mmt_staging2.IHT_BRT_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +Test_Location, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Domestic_Export, +Operator_Name, +Project_Group, +Platform, +Objective, +Acceptance_Criteria, +condition, +Test_Standard, +Test_Standard_id, +Remarks, +Observations +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.IHT_BRT_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text, + a_18 text,a_19 text,a_20 text,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text); + + +delete from mmt_staging2.IHT_BRT_H1_Block where dummy_f is null ; +update mmt_staging2.IHT_BRT_H1_Block set model=__model; +execute 'update mmt_staging2.IHT_BRT_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_BRT_H1_Block'); + + +insert into mmt_staging2.IHT_BRT_Weight_Tyre_Int +( +column3,column4,column5,column6,column7,column8,column9, +column10,column11,column12,rank +) +select +column3,column4,column5,column6,column7,column8, +column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_Weight_Tyre' +order by rank; + + +update mmt_staging2.IHT_BRT_Weight_Tyre_Int set model=__model; +execute 'update mmt_staging2.IHT_BRT_Weight_Tyre_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/*block starts - IHT_BRT_Weight_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_BRT_Weight_Block',__file_format,__sheet_mnemonic,2); + v_block:='IHT_BRT_Weight_Block'; +insert into mmt_staging2.IHT_BRT_Weight_Block +( +dummy_f, +test_condition, +Front, +Rear, +Total +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column7::text]) AS val + FROM mmt_staging2.IHT_BRT_Weight_Tyre_Int where rank <>1 + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text); + +update mmt_staging2.IHT_BRT_Weight_Block set status= +(select column9 FROM mmt_staging2.IHT_BRT_Weight_Tyre_Int +where rank=3) where test_condition='Unballast'; + +update mmt_staging2.IHT_BRT_Weight_Block set status= +(select column9 FROM mmt_staging2.IHT_BRT_Weight_Tyre_Int +where rank=3) where test_condition='Max Ballast'; + +delete from mmt_staging2.IHT_BRT_Weight_Block where dummy_f is null ; +update mmt_staging2.IHT_BRT_Weight_Block set model=__model; +execute 'update mmt_staging2.IHT_BRT_Weight_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_BRT_Weight_Block'); + +/*block starts - IHT_BRT_Tyre_Details_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_BRT_Tyre_Details_Block',__file_format,__sheet_mnemonic,3); +v_block:='IHT_BRT_Tyre_Details_Block'; +insert into mmt_staging2.IHT_BRT_Tyre_Details_Block +( +dummy_f, +Tyre_Details, +Pressure_kg_cm2, +tyre_use_type, +Tyre_Make +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column11::text,column12::text]) AS val + FROM mmt_staging2.IHT_BRT_Weight_Tyre_Int where column11 is not null and column12 is not null + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text); + + +update mmt_staging2.IHT_BRT_Tyre_Details_Block +set tyre_size =(select split_part(Tyre_Make,'/ ',2) +from mmt_staging2.IHT_BRT_Tyre_Details_Block where tyre_details ='Front ') +where tyre_details ='Front '; + +update mmt_staging2.IHT_BRT_Tyre_Details_Block +set ply_rating =(select split_part(replace(Tyre_Make,'PR',''),'/ ',3) +from mmt_staging2.IHT_BRT_Tyre_Details_Block where tyre_details ='Front ') +where tyre_details ='Front '; + + +update mmt_staging2.IHT_BRT_Tyre_Details_Block +set tyre_make =(select split_part(Tyre_Make,'/ ',1) +from mmt_staging2.IHT_BRT_Tyre_Details_Block where tyre_details ='Front ') +where tyre_details ='Front '; + + +update mmt_staging2.IHT_BRT_Tyre_Details_Block +set tyre_size =(select split_part(Tyre_Make,'/ ',2) +from mmt_staging2.IHT_BRT_Tyre_Details_Block where tyre_details ='Rear') +where tyre_details ='Rear'; + +update mmt_staging2.IHT_BRT_Tyre_Details_Block +set ply_rating =(select split_part(replace(Tyre_Make,'PR',''),'/',3) +from mmt_staging2.IHT_BRT_Tyre_Details_Block where tyre_details ='Rear') +where tyre_details ='Rear'; + + +update mmt_staging2.IHT_BRT_Tyre_Details_Block +set tyre_make =(select split_part(Tyre_Make,'/ ',1) +from mmt_staging2.IHT_BRT_Tyre_Details_Block where tyre_details ='Rear') +where tyre_details ='Rear'; + +delete from mmt_staging2.IHT_BRT_Tyre_Details_Block where dummy_f is null ; +update mmt_staging2.IHT_BRT_Tyre_Details_Block set model=__model; +execute 'update mmt_staging2.IHT_BRT_Tyre_Details_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_BRT_Tyre_Details_Block'); + + +/*block starts - IHT_BRT_Test_Res_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_BRT_Test_Res_Block',__file_format,__sheet_mnemonic,4); +v_block:='IHT_BRT_Test_Res_Block'; +insert into mmt_staging2.IHT_BRT_Test_Res_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_Test_Res' +order by rank; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column3 =(select split_part(column3,'- ',2) +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=1) +where rank=1; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column6 =(select split_part(column6,'-',2) +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=1) +where rank=1; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column8 =(select split_part(column8,'-',2) +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=1) +where rank=1; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column3 =(select split_part(column3,'- ',2) +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=16) +where rank=16; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column6 =(select split_part(column6,'- ',2) +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=16) +where rank=16; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column8 =(select split_part(column8,'-',2) +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=16) +where rank=16; + +update mmt_staging2.IHT_BRT_Test_Res_Block a +set column2=(select column10 +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=1) where a.rank=3; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column2= b.first_value from (SELECT +rank,column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column2, +sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank<=15; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column9= b.first_value from (SELECT +rank,column9, value_partition, first_value(column9) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column9, +sum(case when column9 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=3 and a.rank<=15; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column10= b.first_value from (SELECT +rank,column10, value_partition, first_value(column10) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column10, +sum(case when column10 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=3 and a.rank<=15; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column11= b.first_value from (SELECT +rank,column11, value_partition, first_value(column11) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column11, +sum(case when column11 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=3 and a.rank<=15; + +update mmt_staging2.IHT_BRT_Test_Res_Block +set column2=(select column10 +from mmt_staging2.IHT_BRT_Test_Res_Block where rank=16) where rank=18; + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column2= b.first_value from (SELECT +rank,column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column2, +sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=18; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column9= b.first_value from (SELECT +rank,column9, value_partition, first_value(column9) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column9, +sum(case when column9 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=18; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column10= b.first_value from (SELECT +rank,column10, value_partition, first_value(column10) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column10, +sum(case when column10 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=18; + + + update mmt_staging2.IHT_BRT_Test_Res_Block a + set column11= b.first_value from (SELECT +rank,column11, value_partition, first_value(column11) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column11, +sum(case when column11 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank >=18; + +update mmt_staging2.IHT_BRT_Test_Res_Block set ods_record =0 where rank in (1,3,2,17,16,18); + +update mmt_staging2.IHT_BRT_Test_Res_Block set model=__model; +execute 'update mmt_staging2.IHT_BRT_Test_Res_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_BRT_Test_Res_Block'); + + +/*block starts - IHT_BRT_Test_Res_1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_BRT_Test_Res_1_Block',__file_format,__sheet_mnemonic,5); +v_block:='IHT_BRT_Test_Res_1_Block'; +insert into mmt_staging2.IHT_BRT_Test_Res_1_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12, +rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12, +rank +from mmt_staging2.stg_process_table_IHT_BRT a +where rank_tag='IHT_BRT_Test_Res_1' +order by rank; + +update mmt_staging2.IHT_BRT_Test_Res_1_Block +set column3 =(select split_part(column3,'- ',2) +from mmt_staging2.IHT_BRT_Test_Res_1_Block where rank=1) +where rank=1; + +update mmt_staging2.IHT_BRT_Test_Res_1_Block +set column6 =(select split_part(column6,'-',2) +from mmt_staging2.IHT_BRT_Test_Res_1_Block where rank=1) +where rank=1; + +update mmt_staging2.IHT_BRT_Test_Res_1_Block +set column8 =(select split_part(column8,'-',2) +from mmt_staging2.IHT_BRT_Test_Res_1_Block where rank=1) +where rank=1; + + +update mmt_staging2.IHT_BRT_Test_Res_1_Block set ods_record =0 where rank in (1,2,3,13); + +update mmt_staging2.IHT_BRT_Test_Res_1_Block +set column2=(select column10 +from mmt_staging2.IHT_BRT_Test_Res_1_Block where rank=1) where rank=3; + + update mmt_staging2.IHT_BRT_Test_Res_1_Block a + set column2= b.first_value from (SELECT +rank,column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column2, +sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_BRT_Test_Res_1_Block +ORDER BY rank ASC +) as q) b where a.rank=b.rank and a.rank<=15; + +update mmt_staging2.IHT_BRT_Test_Res_1_Block set model=__model; +execute 'update mmt_staging2.IHT_BRT_Test_Res_1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_BRT_Test_Res_1_Block'); + +/*block starts - IHT_BRT_Footer_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_BRT_Footer_block',__file_format,__sheet_mnemonic,6); +v_block:='IHT_BRT_Footer_block'; + +insert into mmt_staging2.IHT_BRT_Footer_block(dummy_f) values ('dummy'); + + +update mmt_staging2.IHT_BRT_Footer_block a +set prepared_by=( select column6 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set reviewed_by=( select column6 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and trim(column3)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set approved_by=( select column6 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=7 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=8 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_BRT_Footer_block a +set rev2=( select column7 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=8 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set rev3=( select column11 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=8 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set replaces=( select column12 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set revision_no=( select column12 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=5) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set prepared_date=( select column11 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set reviewed_date=( select column11 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=4) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block a +set approved_date=( select column11 from mmt_staging2.stg_process_table_IHT_BRT b +where b.rank_tag='IHT_BRT_Footer' +and rank=5) +where dummy_F='dummy'; + +update mmt_staging2.IHT_BRT_Footer_block set model=__model; +execute 'update mmt_staging2.IHT_BRT_Footer_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_BRT_Footer_block'); + +v_context := ''; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context); +return v_context; + +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_ODS.SQL new file mode 100644 index 0000000..3ef3fad --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_ODS.SQL @@ -0,0 +1,305 @@ +drop function if exists mmt_staging2.fn_IHT_CGM_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_CGM_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + begin + +/************************************************************ +Function Name:fn_IHT_CGM_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_CGM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_CGM_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_CGM'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_CGM'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_CGM'; +delete from mmt_ods.test_instance_weight_reaction where test_file_sheet_format='IHT_CGM'; +delete from mmt_ods.iht_cgm_lifting_angle_load_details where test_file_sheet_format='IHT_CGM'; +delete from mmt_ods.iht_cgm_results where test_file_sheet_format='IHT_CGM'; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +acceptance_criteria, +remarks +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as Sample_Receipt_Date, +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +date '1899-12-30' + Test_Report_Date::int * interval '1' day as Test_Report_Date, +No_of_Sample, +date '1899-12-30' + Test_Start_Date::int * interval '1' day as Test_Start_Date, +date '1899-12-30' + Test_End_Date::int * interval '1' day as Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +from mmt_staging2.IHT_CGM_H1_block; + +update mmt_ods.test_instance a +set +report_prepared_date=to_date(b.prepared_date,'DD-MM-YYYY'), +report_reviewed_date=to_date(b.reviewed_date,'DD-MM-YYYY'), +report_approved_date=to_date(b.approved_date,'DD-MM-YYYY'), +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.IHT_CGM_footer_block b +where a.test_file_sheet_format ='IHT_CGM'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_cm2, +tyre_static_rolling_radius_mm, +tyre_dynamic_rolling_radius_mm, +tyre_wheel_rim_make_and_size +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +tyre_details, +tyre_make, +tyre_size, +ply_rating::numeric, +load_carrying_capacity, +Pressure_kg_cm2::numeric , +Dynamic_rolling_radius::numeric , +Static_rolling_radius::numeric , +wheel_rim_make_size +from mmt_staging2.IHT_CGM_tyre_details_block; + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +wheel_base_mm, +rear_tractor_width_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +wheel_base::numeric , +rear_track_width::numeric +from mmt_staging2.IHT_CGM_wheel_block; + + +/*block */ + +insert into mmt_ods.test_instance_weight_reaction +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +total_weight_kg, +front_reaction_kg, +rear_reaction_kg, +left_reaction_fl_rl_kg, +right_reaction_fr_rr_kg, +front_left_reaction_kg, +front_right_reactionkg, +rear_left_reaction_kg, +rear_right_reactionkg, +distance_of_lifting_point_from_rear_axle_mm_d1 +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Weight_Reaction, +Total_Weight_kg::numeric, +Front_Reaction_kg::numeric , +Rear_Reaction_kg::numeric , +Left_Reaction_FL_RL_kg::numeric , +Right_reaction_FR_RR_kg::numeric , +Front_Left_Reaction_kg::numeric , +Front_Right_Reaction_kg::numeric , +Rear_Left_Reaction_kg::numeric , +Rear_Right_Reaction_kg::numeric , +Distance_of_lifting_point_from_rear_axle_mm_d1::numeric +from mmt_staging2.IHT_CGM_weight_block; + + +insert into mmt_ods.iht_cgm_lifting_angle_load_details +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +angle, +value_in_tan, +diff_of_tan_value, +load_kn, +load_kg, +diff_in_load_kg, +vertical_co_ordinate_z_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::numeric, +column4::numeric , +column5::numeric, +column7::numeric, +column8::numeric, +column9::numeric, +column10::numeric +from mmt_staging2.iht_cgm_lifting_block where ods_record=1; + +insert into mmt_ods.iht_cgm_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +horizontal_distance_from_rac_x_mm, +lateral_co_ordinate_in_horizontal_plane_y_mm, +vertical_co_ordinate_z_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +determination_of_horizontal_distance_from_rac_x::numeric , +determination_of_lateral_coordinate_in_horizontal_plane_y::numeric , +determination_of_vertical_coordinate_z::numeric +from mmt_staging2.iht_cgm_results_block where ods_record=1; + + +select file_syspk into __file_syspk from mmt_staging2.IHT_CGM_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_weight_reaction +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_cgm_lifting_angle_load_details +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_cgm_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_STG2.sql b/deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_STG2.sql new file mode 100644 index 0000000..24caabe --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_CGM_STG2.sql @@ -0,0 +1,563 @@ +drop function if exists mmt_staging2.fn_IHT_CGM_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_CGM_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************ +Function Name:fn_IHT_CGM_block +Function Desc: This function populates data into staging 2 block +File Format: IHT +Sheet Format: IHT_CGM +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_CGM_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_IHT_CGM_block(1,2,'IHT','IHT_CGM',456) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.IHT_CGM_H1_Int; +truncate table mmt_staging2.IHT_CGM_H1_block; +truncate table mmt_staging2.IHT_CGM_Weight_Tyre_Int; +truncate table mmt_staging2.IHT_CGM_Weight_Block; +truncate table mmt_staging2.IHT_CGM_Wheel_Block; +truncate table mmt_staging2.IHT_CGM_Tyre_Details_Block; +truncate table mmt_staging2.IHT_CGM_Lifting_Block; +truncate table mmt_staging2.IHT_CGM_Results_Block; +truncate table mmt_staging2.IHT_CGM_Footer_Block; +truncate table mmt_staging2.stg_specific_table_IHT_CGM; +truncate table mmt_staging2.stg_process_table_IHT_CGM; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for IHT */ +execute 'insert into mmt_staging2.stg_specific_table_IHT_CGM +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_IHT_CGM +set column15='Objective' where column15 like 'Objective%'; + +update mmt_staging2.stg_specific_table_IHT_CGM +set column15='Acceptance criteria' where column15 like 'Acceptance criteria%'; + +update mmt_staging2.stg_specific_table_IHT_CGM set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_IHT_CGM set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_IHT_CGM b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_IHT_CGM a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Remarks:'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ +execute 'insert into mmt_staging2.stg_process_table_IHT_CGM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_CGM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_CGM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_CGM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Weight Reaction'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_CGM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_CGM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Lifting Angle & Load'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_IHT_CGM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_CGM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Remarks:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tractor model*/ +select column6 into __model from mmt_staging2.stg_process_table_IHT_CGM a +where rank_tag='IHT_CGM_H1' and trim(column3)='Tractor Model'; + +/*block starts - IHT_CGM_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='IHT_CGM_H1_BLOCK'; + +insert into mmt_staging2.IHT_CGM_H1_INT (c1,c2) +select a.column3,column6 from mmt_staging2.stg_process_table_IHT_CGM a where rank_tag='IHT_CGM_H1'; + +insert into mmt_staging2.IHT_CGM_H1_INT (c1,c2) +select a.column9,column12 from mmt_staging2.stg_process_table_IHT_CGM a where rank_tag='IHT_CGM_H1'; + +insert into mmt_staging2.IHT_CGM_H1_INT (c1,c2) +select 'Objective',column15 +from mmt_staging2.stg_process_table_IHT_CGM a +where rank_tag='IHT_CGM_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_CGM a +where column15='Objective' +and rank_tag='IHT_CGM_H1' +); + +insert into mmt_staging2.IHT_CGM_H1_INT (c1,c2) +select 'Acceptance criteria',column15 +from mmt_staging2.stg_process_table_IHT_CGM a +where rank_tag='IHT_CGM_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_CGM a +where column15='Acceptance criteria' +and rank_tag='IHT_CGM_H1' +); + +insert into mmt_staging2.IHT_CGM_H1_INT (c1,c2) +select split_part(column3,':',1),split_part(column3,':',2) +from mmt_staging2.stg_process_table_IHT_CGM +where rank_tag='IHT_CGM_Footer' and rank=1; + + +update mmt_staging2.IHT_CGM_H1_Int set model=__model; +execute 'update mmt_staging2.IHT_CGM_H1_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +insert into mmt_staging2.IHT_CGM_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.IHT_CGM_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text, + a_18 text,a_19 text); + + +delete from mmt_staging2.IHT_CGM_H1_Block where dummy_f is null ; +update mmt_staging2.IHT_CGM_H1_Block set model=__model; +execute 'update mmt_staging2.IHT_CGM_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_H1_Block'); + + +insert into mmt_staging2.IHT_CGM_Weight_Tyre_Int +( +column3,column6,column10,column11,column13,column15,column17,column19, +column20,rank +) +select +column3,column6,column10,column11,column13,column15,column17,column19, +column20,rank +from mmt_staging2.stg_process_table_IHT_CGM a +where rank_tag='IHT_CGM_Weight_Tyre' +order by rank; + +update mmt_staging2.IHT_CGM_Weight_Tyre_Int set model=__model; +execute 'update mmt_staging2.IHT_CGM_Weight_Tyre_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_CGM_Weight_Tyre_Int set ods_record = 0 where rank=3; + +/*block starts - IHT_CGM_Weight_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_Weight_Block',__file_format,__sheet_mnemonic,2); +v_block:='IHT_CGM_Weight_Block'; + +insert into mmt_staging2.IHT_CGM_Weight_Block +( +dummy_f, +Weight_Reaction, +Total_Weight_kg, +Front_Reaction_kg, +Rear_Reaction_kg, +Left_Reaction_FL_RL_kg, +Right_reaction_FR_RR_kg, +Front_Left_Reaction_kg, +Front_Right_Reaction_kg, +Rear_Left_Reaction_kg, +Rear_Right_Reaction_kg, +Distance_of_lifting_point_from_rear_axle_mm_d1 +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column6::text]) AS val + FROM mmt_staging2.IHT_CGM_Weight_Tyre_Int where ods_record=1 + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text, + a_10 text,a_11 text); + +delete from mmt_staging2.IHT_CGM_Weight_Block where dummy_f is null ; +update mmt_staging2.IHT_CGM_Weight_Block set model=__model; +execute 'update mmt_staging2.IHT_CGM_Weight_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_Weight_Block'); + +/*block starts - IHT_CGM_Tyre_Details_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_Tyre_Details_Block',__file_format,__sheet_mnemonic,3); +v_block:='IHT_CGM_Tyre_Details_Block'; +insert into mmt_staging2.IHT_CGM_Tyre_Details_Block +( +dummy_f, +Tyre_Details, +Tyre_Make, +Tyre_size, +Ply_Rating, +Load_Carrying_Capacity, +Pressure_kg_cm2, +Dynamic_rolling_radius, +Static_rolling_radius, +Wheel_rim_Make_size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column15,column19}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column15::text,column19::text]) AS val + FROM mmt_staging2.IHT_CGM_Weight_Tyre_Int where rank between 4 and 12 + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +delete from mmt_staging2.IHT_CGM_Tyre_Details_Block where dummy_f is null ; +update mmt_staging2.IHT_CGM_Tyre_Details_Block set model=__model; +execute 'update mmt_staging2.IHT_CGM_Tyre_Details_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_Tyre_Details_Block'); + + +/*block starts - IHT_CGM_Wheel_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_Wheel_Block',__file_format,__sheet_mnemonic,4); +v_block:='IHT_CGM_Wheel_Block'; +insert into mmt_staging2.IHT_CGM_Wheel_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_CGM_Wheel_Block +set Wheel_Base=(select column13 from +mmt_staging2.IHT_CGM_Weight_Tyre_Int +where rank=1 and column10='Wheel Base') +where dummy_f='dummy'; + +update mmt_staging2.IHT_CGM_Wheel_Block +set Rear_Track_Width=(select column20 from +mmt_staging2.IHT_CGM_Weight_Tyre_Int +where rank=1 and column17='Rear Track Width') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_CGM_Wheel_Block set model=__model; +execute 'update mmt_staging2.IHT_CGM_Wheel_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_Wheel_Block'); + +/*block starts - IHT_CGM_Lifting_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_Lifting_Block',__file_format,__sheet_mnemonic,5); +v_block:='IHT_CGM_Lifting_Block'; + +insert into mmt_staging2.IHT_CGM_Lifting_Block +( +column3,column4,column5,column6,column7, +column8,column9,column10,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,column10,rank +from mmt_staging2.stg_process_table_IHT_CGM a +where rank_tag='IHT_CGM_Lifting' +order by rank; + + +update mmt_staging2.IHT_CGM_Lifting_Block set model=__model; +execute 'update mmt_staging2.IHT_CGM_Lifting_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_CGM_Lifting_Block set ods_record =0 where rank not in (3,4,5,6,7,8,9); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_Lifting_Block'); + + +/*block starts - IHT_CGM_Results_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_Results_Block',__file_format,__sheet_mnemonic,6); +v_block:='IHT_CGM_Results_Block'; +insert into mmt_staging2.IHT_CGM_Results_Block (dummy_f) values('dummy'); + +update mmt_staging2.IHT_CGM_Results_Block +set Determination_of_Horizontal_Distance_from_RAC_X= +(select column10 from mmt_staging2.IHT_CGM_Lifting_Block +where rank=12) where dummy_f='dummy'; + +update mmt_staging2.IHT_CGM_Results_Block +set Determination_of_Lateral_CoOrdinate_in_Horizontal_Plane_Y= +(select column10 from mmt_staging2.IHT_CGM_Lifting_Block +where rank=13) where dummy_f='dummy'; + +update mmt_staging2.IHT_CGM_Results_Block +set Determination_of_Vertical_CoOrdinate_Z= +(select column10 from mmt_staging2.IHT_CGM_Lifting_Block +where rank=14) where dummy_f='dummy'; + + +update mmt_staging2.IHT_CGM_Results_Block set model=__model; +execute 'update mmt_staging2.IHT_CGM_Results_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_Results_Block'); + + +/*block starts - IHT_CGM_Footer_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_CGM_Footer_block',__file_format,__sheet_mnemonic,8); +v_block='IHT_CGM_Footer_block'; +insert into mmt_staging2.IHT_CGM_Footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_CGM_Footer_block a +set prepared_by=( select column7 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set reviewed_by=( select column7 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and trim(column3)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set approved_by=( select column7 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=7 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_CGM_Footer_block a +set rev2=( select column9 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=7 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set rev3=( select column18 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=7 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set replaces=( select column19 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set revision_no=( select column19 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=4) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set prepared_date=( select column16 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set reviewed_date=( select column16 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block a +set approved_date=( select column16 from mmt_staging2.stg_process_table_IHT_CGM b +where b.rank_tag='IHT_CGM_Footer' +and rank=4) +where dummy_F='dummy'; + +update mmt_staging2.IHT_CGM_Footer_block set model=__model; +execute 'update mmt_staging2.IHT_CGM_Footer_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_CGM_Footer_block'); +v_context := ''; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_ODS.SQL new file mode 100644 index 0000000..472c86d --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_ODS.SQL @@ -0,0 +1,401 @@ +drop function if exists mmt_staging2.fn_IHT_EMT_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_EMT_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + begin + +/************************************************************ +Function Name:fn_IHT_EMT_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_EMT +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_EMT_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.test_instance_weight_reaction where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.iht_steering_effort where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.iht_pedal_effort where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.iht_clutch_pedal_effort where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.iht_brake_pedal_effort where test_file_sheet_format='IHT_EMT'; +delete from mmt_ods.iht_gear_effort where test_file_sheet_format='IHT_EMT'; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +acceptance_criteria, +remarks +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as Sample_Receipt_Date, +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +date '1899-12-30' + Test_Report_Date::int * interval '1' day as Test_Report_Date, +No_of_Sample, +date '1899-12-30' + Test_Start_Date ::int * interval '1' day as Test_Start_Date, +date '1899-12-30' + Test_End_Date ::int * interval '1' day as Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +from mmt_staging2.IHT_EMT_H1_block; + +update mmt_ods.test_instance a +set +report_prepared_date=to_date(b.prepared_date,'DD-MM-YYYY'), +report_reviewed_date=to_date(b.reviewed_date,'DD-MM-YYYY'), +report_approved_date=to_date(b.approved_date,'DD-MM-YYYY'), +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.IHT_EMT_footer_block b +where a.test_file_sheet_format ='IHT_EMT'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_cm2, +tyre_static_rolling_radius_mm, +tyre_dynamic_rolling_radius_mm, +tyre_wheel_rim_make_and_size +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +tyre_details, +tyre_make, +tyre_size, +ply_rating::numeric, +load_carrying_capacity, +Pressure_kg_cm2::numeric , +Dynamic_rolling_radius::numeric , +Static_rolling_radius::numeric , +wheel_rim_make_size +from mmt_staging2.IHT_EMT_tyre_details_block where ods_record =1; + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +wheel_base_mm, +turning_circle_diameter_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +wheel_base::numeric , +tcd::numeric +from mmt_staging2.IHT_EMT_wheel_block; + + +/*block */ + +insert into mmt_ods.test_instance_weight_reaction +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +total_weight_kg, +front_reaction_kg, +rear_reaction_kg, +left_reaction_fl_rl_kg, +right_reaction_fr_rr_kg, +front_left_reaction_kg, +front_right_reactionkg, +rear_left_reaction_kg, +rear_right_reactionkg, +distance_of_lifting_point_from_rear_axle_mm_d1 +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Weight_Reaction, +Total_Weight_kg::numeric, +Front_Reaction_kg::numeric , +Rear_Reaction_kg::numeric , +Left_Reaction_FL_RL_kg::numeric , +Right_reaction_FR_RR_kg::numeric , +Front_Left_Reaction_kg::numeric , +Front_Right_Reaction_kg::numeric , +Rear_Left_Reaction_kg::numeric , +Rear_Right_Reaction_kg::numeric , +Distance_of_lifting_point_from_rear_axle_mm_d1::numeric +from mmt_staging2.IHT_EMT_weight_block; + + +insert into mmt_ods.iht_steering_effort +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_speed_kmph, +max_angle_lh, +max_angle_rh, +max_effort_lh, +max_effort_rh +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3, +column4::numeric, +column5::numeric, +column6::numeric, +column8::numeric +from mmt_staging2.iht_emt_steering_block where ods_record=1; + +insert into mmt_ods.iht_pedal_effort +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +parameters, +efforts_kg, +travel_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3::numeric , +column4::numeric +from mmt_staging2.iht_emt_pedal_block where ods_record=1; + +insert into mmt_ods.iht_gear_effort +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +parameters, +efforts_kg +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column5, +column8::numeric +from mmt_staging2.iht_emt_pedal_block where ods_record=1; + +insert into mmt_ods.iht_brake_pedal_effort +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +pedal_effort_kg, +pedal_travel_lh_mm, +pedal_travel_rh_mm, +pedal_travel_latched_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2::numeric, +column3::numeric, +column4::numeric , +column5::numeric, +column6::numeric +from mmt_staging2.iht_emt_brake_pedal_block where ods_record=1; + +insert into mmt_ods.iht_clutch_pedal_effort +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +pedal_effort_kg, +pedal_travel_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column7::numeric, +column8::numeric, +column9::numeric +from mmt_staging2.iht_emt_brake_pedal_block where ods_record=1; + +select file_syspk into __file_syspk from mmt_staging2.IHT_EMT_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_weight_reaction +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_brake_pedal_effort +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_pedal_effort +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_steering_effort +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_gear_effort +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_clutch_pedal_effort +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + + +end +$$ LANGUAGE plpgsql; + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_STG2.sql b/deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_STG2.sql new file mode 100644 index 0000000..0c1dde2 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_EMT_STG2.sql @@ -0,0 +1,607 @@ +drop function if exists mmt_staging2.fn_IHT_EMT_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_EMT_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************ +Function Name:fn_IHT_EMT_block +Function Desc: This function populates data into staging 2 block +File Format: IHT +Sheet Format: IHT_EMT +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_EMT_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_IHT_EMT_block(1,2,'IHT','IHT_EMT',456) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.IHT_EMT_H1_Int; +truncate table mmt_staging2.IHT_EMT_H1_block; +truncate table mmt_staging2.IHT_EMT_Weight_Tyre_Int; +truncate table mmt_staging2.IHT_EMT_Weight_Block; +truncate table mmt_staging2.IHT_EMT_Wheel_Block; +truncate table mmt_staging2.IHT_EMT_Tyre_Details_Block; +truncate table mmt_staging2.IHT_EMT_Steering_Block; +truncate table mmt_staging2.IHT_EMT_Pedal_Block; +truncate table mmt_staging2.IHT_EMT_Brake_Pedal_Block; +truncate table mmt_staging2.IHT_EMT_Footer_Block; +truncate table mmt_staging2.stg_specific_table_IHT_EMT; +truncate table mmt_staging2.stg_process_table_IHT_EMT; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for IHT */ +execute 'insert into mmt_staging2.stg_specific_table_IHT_EMT +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_IHT_EMT +set column14='Objective' where column14 like 'Objective%'; + +update mmt_staging2.stg_specific_table_IHT_EMT +set column14='Acceptance criteria' where column14 like 'Acceptance criteria%'; + +update mmt_staging2.stg_specific_table_IHT_EMT set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_IHT_EMT set column2 = TRIM (LEADING FROM column2 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_IHT_EMT b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_IHT_EMT a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Remarks:'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ +execute 'insert into mmt_staging2.stg_process_table_IHT_EMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_EMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_EMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_EMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Weight Reaction'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_EMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_EMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Steering effort'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_EMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_EMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Pedal Effort'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_EMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_EMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Brake Pedal Effort'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_IHT_EMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_EMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Remarks:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tractor model*/ +select column5 into __model from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_H1' and trim(column2)='Tractor Model'; + +/*block starts - IHT_EMT_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='IHT_EMT_H1_BLOCK'; +insert into mmt_staging2.IHT_EMT_H1_INT (c1,c2) +select a.column2,column5 from mmt_staging2.stg_process_table_IHT_EMT a where rank_tag='IHT_EMT_H1'; + +insert into mmt_staging2.IHT_EMT_H1_INT (c1,c2) +select a.column8,column11 from mmt_staging2.stg_process_table_IHT_EMT a where rank_tag='IHT_EMT_H1'; + +insert into mmt_staging2.IHT_EMT_H1_INT (c1,c2) +select 'Objective',column14 +from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_EMT a +where column14='Objective' +and rank_tag='IHT_EMT_H1' +); + +insert into mmt_staging2.IHT_EMT_H1_INT (c1,c2) +select 'Acceptance criteria',column14 +from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_EMT a +where column14='Acceptance criteria' +and rank_tag='IHT_EMT_H1' +); + +insert into mmt_staging2.IHT_EMT_H1_INT (c1,c2) +select split_part(column2,':',1),split_part(column2,':',2) +from mmt_staging2.stg_process_table_IHT_EMT +where rank_tag='IHT_EMT_Footer' and rank=1; + + +update mmt_staging2.IHT_EMT_H1_Int set model=__model; +execute 'update mmt_staging2.IHT_EMT_H1_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +insert into mmt_staging2.IHT_EMT_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.IHT_EMT_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text, + a_18 text,a_19 text); + + +delete from mmt_staging2.IHT_EMT_H1_Block where dummy_f is null ; +update mmt_staging2.IHT_EMT_H1_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_H1_Block'); + + +insert into mmt_staging2.IHT_EMT_Weight_Tyre_Int +( +column2,column5,column9,column10,column12,column14,column16,column18, +column19,rank +) +select +column2,column5,column9,column10,column12,column14,column16,column18, +column19,rank +from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_Weight_Tyre' +order by rank; + +update mmt_staging2.IHT_EMT_Weight_Tyre_Int set model=__model; +execute 'update mmt_staging2.IHT_EMT_Weight_Tyre_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/*block starts - IHT_EMT_Weight_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Weight_Block',__file_format,__sheet_mnemonic,2); + v_block:='IHT_EMT_Weight_Block'; + +insert into mmt_staging2.IHT_EMT_Weight_Block +( +dummy_f, +Weight_Reaction, +Total_Weight_kg, +Front_Reaction_kg, +Rear_Reaction_kg, +Left_Reaction_FL_RL_kg, +Right_reaction_FR_RR_kg, +Front_Left_Reaction_kg, +Front_Right_Reaction_kg, +Rear_Left_Reaction_kg, +Rear_Right_Reaction_kg, +Distance_of_lifting_point_from_rear_axle_mm_d1 +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text]) AS val + FROM mmt_staging2.IHT_EMT_Weight_Tyre_Int + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text, + a_10 text,a_11 text); + +delete from mmt_staging2.IHT_EMT_Weight_Block where dummy_f is null ; +update mmt_staging2.IHT_EMT_Weight_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Weight_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_Weight_Block'); + +/*block starts - IHT_EMT_Tyre_Details_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Tyre_Details_Block',__file_format,__sheet_mnemonic,3); +v_block:='IHT_EMT_Tyre_Details_Block'; + +insert into mmt_staging2.IHT_EMT_Tyre_Details_Block +( +dummy_f, +Tyre_Details, +Tyre_Make, +Tyre_size, +Ply_Rating, +Load_Carrying_Capacity, +Pressure_kg_cm2, +Dynamic_rolling_radius, +Static_rolling_radius, +Wheel_rim_Make_size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column14,column18}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column14::text,column18::text]) AS val + FROM mmt_staging2.IHT_EMT_Weight_Tyre_Int where rank between 3 and 11 + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +delete from mmt_staging2.IHT_EMT_Tyre_Details_Block where dummy_f is null ; +update mmt_staging2.IHT_EMT_Tyre_Details_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Tyre_Details_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_Tyre_Details_Block'); + + +/*block starts - IHT_EMT_Wheel_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Wheel_Block',__file_format,__sheet_mnemonic,4); +v_block:='IHT_EMT_Wheel_Block'; +insert into mmt_staging2.IHT_EMT_Wheel_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_EMT_Wheel_Block +set Wheel_Base=(select column12 from +mmt_staging2.IHT_EMT_Weight_Tyre_Int +where rank=1 and column9='Wheel Base') +where dummy_f='dummy'; + +update mmt_staging2.IHT_EMT_Wheel_Block +set TCD=(select replace(column19,'mm','') from +mmt_staging2.IHT_EMT_Weight_Tyre_Int +where rank=1 and column16='TCD') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_EMT_Wheel_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Wheel_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_Wheel_Block'); + +/*block starts - IHT_EMT_Steering_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Steering_Block',__file_format,__sheet_mnemonic,5); +v_block:='IHT_EMT_Steering_Block'; + +insert into mmt_staging2.IHT_EMT_Steering_Block +( +column2,column3,column4,column5,column6, +column8,rank +) +select +column2,column3,column4,column5,column6, +column8,rank +from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_Steering' +order by rank; + + +update mmt_staging2.IHT_EMT_Steering_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Steering_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_EMT_Steering_Block set ods_record =0 where rank in (1,2,3); + + +/*block starts - IHT_EMT_Pedal_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Pedal_Block',__file_format,__sheet_mnemonic,6); +v_block:='IHT_EMT_Pedal_Block'; +insert into mmt_staging2.IHT_EMT_Pedal_Block +( +column2,column3,column4,column5,column6, +column8,rank +) +select +column2,column3,column4,column5,column6, +column8,rank +from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_Pedal' +order by rank; + + +update mmt_staging2.IHT_EMT_Pedal_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Pedal_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_EMT_Pedal_Block set ods_record =0 where rank in (1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_Pedal_Block'); + +/*block starts - IHT_EMT_Brake_Pedal_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Brake_Pedal_Block',__file_format,__sheet_mnemonic,7); +v_block:='IHT_EMT_Brake_Pedal_Block'; +insert into mmt_staging2.IHT_EMT_Brake_Pedal_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_IHT_EMT a +where rank_tag='IHT_EMT_Brake_Pedal' +order by rank; + + + +update mmt_staging2.IHT_EMT_Brake_Pedal_Block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Brake_Pedal_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.IHT_EMT_Brake_Pedal_Block set ods_record =0 where rank in (1,2,3); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_Brake_Pedal_Block'); + +/*block starts - IHT_EMT_Footer_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_EMT_Footer_block',__file_format,__sheet_mnemonic,8); +v_block:='IHT_EMT_Footer_block'; +insert into mmt_staging2.IHT_EMT_Footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_EMT_Footer_block a +set prepared_by=( select column6 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and trim(column2)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set reviewed_by=( select column6 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and trim(column2)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set approved_by=( select column6 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and trim(column2)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set comments=( select column2 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=5 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set rev1=( select column2 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=6 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_EMT_Footer_block a +set rev2=( select column8 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set rev3=( select column17 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set replaces=( select column18 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set revision_no=( select column18 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set prepared_date=( select column15 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set reviewed_date=( select column15 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block a +set approved_date=( select column15 from mmt_staging2.stg_process_table_IHT_EMT b +where b.rank_tag='IHT_EMT_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_EMT_Footer_block set model=__model; +execute 'update mmt_staging2.IHT_EMT_Footer_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_EMT_Footer_block'); +v_context := ''; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_ODS.SQL new file mode 100644 index 0000000..8a343a5 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_ODS.SQL @@ -0,0 +1,384 @@ +drop function if exists mmt_staging2.fn_IHT_HAM_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_HAM_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + begin + +/************************************************************ +Function Name:fn_IHT_HAM_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_HAM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_HAM_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_atmospheric_info where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_atmospheric_info where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_drawbar_info where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.test_instance_weight_reaction where test_file_sheet_format='IHT_HAM'; +delete from mmt_ods.iht_hot_air_mapping_results where test_file_sheet_format='IHT_HAM'; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +acceptance_criteria, +test_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as Sample_Receipt_Date, +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +date '1899-12-30' + Test_Report_Date::int * interval '1' day as Test_Report_Date, +No_of_Sample, +date '1899-12-30' + Test_Start_Date::int * interval '1' day as Test_Start_Date, +date '1899-12-30' + Test_End_Date::int * interval '1' day as Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_facility, +Operator_Name, +Project_Group, +Objective, +Condition +from + mmt_staging2.IHT_HAM_H1_block; + +update mmt_ods.test_instance a +set report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.IHT_HAM_footer_block b +where a.test_file_sheet_format='IHT_HAM'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_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 +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Tyre_Make, +Tyre_size, +Ply_Rating::numeric , +Load_Carrying_Capacity, +pressure_kg_cm2::numeric , +No_of_lug::numeric, +Number_of_no_load_lug_30m::numeric, +Lug_Height::numeric, +Dynamic_rolling_radius::numeric , +Wheel_rim_Make_size +from mmt_staging2.IHT_HAM_tyre_details_block; + + + insert into mmt_ods.test_instance_engine_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +low_idle_declared, +low_idle_observed, +high_idle_declared, +high_idle_observed, +rated_rpm, +rated_rpm_observed, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +low_idle_declared, +low_idle_observed::numeric, +high_idle_declared, +high_idle_observed::numeric, +rated_rpm_declared::numeric, +rated_rpm_observed::numeric, +engine_to_pto_ratio +from mmt_staging2.IHT_HAM_engine_rpm_block; + + insert into mmt_ods.test_instance_weight_reaction + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +front_reaction_kg, +rear_reaction_kg, +total_weight_kg +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +test_condition, +Front_weight::numeric, +Rear_weight::numeric, +Total_weight::numeric +from mmt_staging2.IHT_HAM_weight_block; + + +/*block */ + +insert into mmt_ods.test_instance_atmospheric_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +ambient_temp_c, +humidity_pct, +wind_velocity_kmph, +date, +start_time, +end_time +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Ambient_temp_C, +humidity, +wind_velocity, +date, +start_time, +end_time +from mmt_staging2.IHT_HAM_atmos_cond_block; + +insert into mmt_ods.test_instance_drawbar_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +required_pull_in_kg, +required_power_in_hp, +actual_pull_in_kg, +actual_power_in_hp, +calculated_hitch_height_mm, +actual_hitch_height_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +test_condition, +Required_pull_in_kg::numeric , +Required_Power_in_hp::numeric , +Actual_pull_in_kg::numeric , +actual_power_in_hp::numeric , +Calculated_hitch_heigh_mm::numeric , +Actual_hitch_height_mm::numeric +from mmt_staging2.iht_ham_drawbar_block; + +insert into mmt_ods.iht_hot_air_mapping_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +gear, +load_kg, +speed_kmph, +speed_rpm, +ambient_measured_temp_c, +head_measured_temp_c, +head_roa_c, +chest_measured_temp_c, +chest_roa_c, +lh_leg_measured_temp_c, +lh_leg_roa_c, +rh_leg_measured_temp_c, +rh_leg_roa_c, +lh_hand_measured_temp_c, +lh_hand_roa_c, +rh_hand_measured_temp_c, +rh_hand_roa_c, +hood_gas_spring_rh_side_measured_temp_c, +hood_gas_spring_rh_side_roa_c, +hood_foam_top_measured_temp_c, +hood_foam_top_roa_c, +hood_foam_middle_measured_temp_c, +hood_foam_middle_roa_c, +hood_foam_bottom_measured_temp_c, +hood_foam_bottom_roa_c, +outside_hood_top_measured_temp_c, +outside_hood_top_roa_c, +outside_hood_middle_measured_temp_c, +outside_hood_middle_roa_c, +outside_hood_bottom_measured_temp_c, +outside_hood_bottom_roa_c, +time_of_test, +time_diff_h_min +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column7::numeric,column8::numeric ,column9::numeric , +column10::numeric ,column11::numeric ,column12::numeric , +column13::numeric ,column14::numeric ,column15::numeric , +column16::numeric ,column17::numeric ,column18::numeric , +column19::numeric ,column20::numeric ,column21::numeric , +column22::numeric ,column23::numeric ,column24::numeric , +column25::numeric ,column26::numeric ,column27::numeric , +column28::numeric ,column29::numeric ,column30::numeric , +column31::numeric ,column32::numeric ,column33::numeric , +column34 ,column36::numeric +from mmt_staging2.iht_ham_results_block ihrb where ods_record=1; + + +select to_char(to_timestamp((-0.74861111111109402)* 60),'HH12:MIPM'); + +select to_char(to_timestamp((4.8611111111110938)* 60),'HH12:MI'); + +select file_syspk into __file_syspk from mmt_staging2.IHT_HAM_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_weight_reaction +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_atmospheric_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_drawbar_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_hot_air_mapping_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_STG2.sql b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_STG2.sql new file mode 100644 index 0000000..f0779ad --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HAM_STG2.sql @@ -0,0 +1,785 @@ +drop function if exists mmt_staging2.fn_IHT_HAM_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_HAM_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + + begin + +/************************************************************ +Function Name:fn_IHT_HAM_block +Function Desc: This function populates data into staging 2 block +File Format: IHT +Sheet Format: IHT_HAM +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_HAM_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_IHT_HAM_block(1,2,'IHT','IHT_HAM',456) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.IHT_HAM_h1_block; +truncate table mmt_staging2.IHT_HAM_H1_Int; +truncate table mmt_staging2.IHT_HAM_H1_block; +truncate table mmt_staging2.IHT_HAM_Tyre_Details_Block; +truncate table mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int; +truncate table mmt_staging2.IHT_HAM_Engine_RPM_Block; +truncate table mmt_staging2.IHT_HAM_Tractor_Block; +truncate table mmt_staging2.IHT_HAM_Weight_Block; +truncate table mmt_staging2.IHT_HAM_Drawbar_Block; +truncate table mmt_staging2.IHT_HAM_Atmos_Cond_Block; +truncate table mmt_staging2.IHT_HAM_Results_Block; +truncate table mmt_staging2.IHT_HAM_Footer_Block; +truncate table mmt_staging2.stg_specific_table_IHT_HAM; +truncate table mmt_staging2.stg_process_table_IHT_HAM; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for IHT */ +execute 'insert into mmt_staging2.stg_specific_table_IHT_HAM +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_IHT_HAM set column13='Objective' +where column13 like 'Objective%'; + +update mmt_staging2.stg_specific_table_IHT_HAM set column13='Acceptance Criteria' +where column13 like 'Acceptance Criteria%'; + +update mmt_staging2.stg_specific_table_IHT_HAM set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_IHT_HAM set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_IHT_HAM b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_IHT_HAM a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Prepared by'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ +execute 'insert into mmt_staging2.stg_process_table_IHT_HAM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HAM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_HAM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HAM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine (RPM)'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_HAM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HAM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Atmospheric condition'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_HAM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HAM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Condition'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_HAM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HAM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Prepared By'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tractor model*/ +select column6 into __model from mmt_staging2.stg_process_table_IHT_HAM a +where rank_tag='IHT_HAM_H1' and trim(column3)='Tractor Model'; + +/*block starts - IHT_HAM_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='IHT_HAM_H1_BLOCK'; + +insert into mmt_staging2.IHT_HAM_H1_INT (c1,c2) +select a.column3,column6 from mmt_staging2.stg_process_table_IHT_HAM a where rank_tag='IHT_HAM_H1'; + +insert into mmt_staging2.IHT_HAM_H1_INT (c1,c2) +select a.column10,column14 from mmt_staging2.stg_process_table_IHT_HAM a where rank_tag='IHT_HAM_H1'; + +insert into mmt_staging2.IHT_HAM_H1_INT (c1,c2) +select 'Objective',column13 +from mmt_staging2.stg_process_table_IHT_HAM a +where rank_tag='IHT_HAM_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_HAM a +where column13='Objective' +and rank_tag='IHT_HAM_H1' +); + +insert into mmt_staging2.IHT_HAM_H1_INT (c1,c2) +select 'Acceptance Criteria',column8 +from mmt_staging2.stg_process_table_IHT_HAM a +where rank_tag='IHT_HAM_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_HAM a +where column8='Acceptance_Criteria' +and rank_tag='IHT_HAM_H1' +); + +insert into mmt_staging2.IHT_HAM_H1_INT (c1,c2) +select split_part(column3,':',1),split_part(column3,':',2) +from mmt_staging2.stg_process_table_IHT_HAM +where rank_tag='IHT_HAM_Footer'; + +update mmt_staging2.IHT_HAM_H1_Int set model=__model; +execute 'update mmt_staging2.IHT_HAM_H1_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +insert into mmt_staging2.IHT_HAM_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Facility, +Operator_Name, +Project_Group, +Test_standard_refer, +Objective, +Acceptance_Criteria +Remarks +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.IHT_HAM_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text + a_19 text ); + + + + +delete from mmt_staging2.IHT_HAM_H1_Block where dummy_f is null ; +update mmt_staging2.IHT_HAM_H1_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_H1_Block'); + +insert into mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +( +column3,column6,column10,column14, +column15,column16,column21,column22, +column27,column30,column32,rank +) +select +column3,column6,column10,column14, +column15,column16,column21,column22, +column27,column30,column32,rank +from mmt_staging2.stg_process_table_IHT_HAM a +where rank_tag='IHT_HAM_Engine_Tyre_Weight' +order by rank; + + +update mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int set model=__model; +execute 'update mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*block starts - IHT_HAM_Tyre_Details_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Tyre_Details_Block',__file_format,__sheet_mnemonic,2); +v_block:='IHT_HAM_Tyre_Details_Block'; +insert into mmt_staging2.IHT_HAM_Tyre_Details_Block +( +dummy_f, +Tyre_Details, +Tyre_Make, +Tyre_size, +Ply_Rating, +Load_Carrying_Capacity, +pressure_kg_cm2, +No_of_lug, +Number_of_no_load_lug_30m, +Lug_Height, +Dynamic_rolling_radius, +Wheel_rim_Make_size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column22,column30}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column22::text,column30::text]) AS val + FROM mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int where rank between 4 and 14 + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text, + a_8 text,a_9 text,a_10 text,a_11 text); + + + +delete from mmt_staging2.IHT_HAM_Tyre_Details_Block where dummy_f is null ; +update mmt_staging2.IHT_HAM_Tyre_Details_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Tyre_Details_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Tyre_Details_Block'); + + +/*block starts - IHT_HAM_Engine_RPM_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); +v_block:='IHT_HAM_Engine_RPM_Block'; +insert into mmt_staging2.IHT_HAM_Engine_RPM_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set low_idle_declared=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=2 and column3='Low Idle RPM') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set low_idle_observed=(select column10 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=2 and column3='Low Idle RPM') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set high_idle_declared=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=3 and column10='High Idle RPM') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set high_idle_observed=(select column10 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=3 and column3='High Idle RPM') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set rated_rpm_declared=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=4 and column3='Rated RPM') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set rated_rpm_observed=(select column10 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=4 and column3='Rated RPM') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Engine_RPM_Block +set Engine_to_PTO_Ratio=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=5 and column3='Engine to PTO Ratio') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_HAM_Engine_RPM_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Engine_RPM_Block'); + + +/*block starts -IHT_HAM_Drawbar_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Drawbar_Block',__file_format,__sheet_mnemonic,4); +v_block:='IHT_HAM_Drawbar_Block'; + +insert into mmt_staging2.IHT_HAM_Drawbar_Block +(test_condition) values +select column6 from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank between 9 and 14; + + +insert into mmt_staging2.IHT_HAM_Drawbar_Block +(test_condition) values +select column14 from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank between 9 and 14; + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Required_pull_in_kg = (select column8 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='UB' and rank =9) + + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Required_Power_in_hp = (select column8 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='UB' and rank =10) + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Actual_pull_in_kg = (select column8 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='UB' and rank =11) + + +update mmt_staging2.IHT_HAM_Drawbar_Block +set actual_power_in_hp = (select column8 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='UB' and rank =12) + + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Calculated_hitch_heigh_mm = (select column8 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='UB' and rank =13) + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Actual_hitch_height_mm = (select column8 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='UB' and rank =14) + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Required_pull_in_kg = (select column14 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='Ballast' and rank =9) + + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Required_Power_in_hp = (select column14 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='Ballast' and rank =10) + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Actual_pull_in_kg = (select column14 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='Ballast' and rank =11) + + +update mmt_staging2.IHT_HAM_Drawbar_Block +set actual_power_in_hp = (select column14 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='Ballast' and rank =12) + + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Calculated_hitch_heigh_mm = (select column14 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='Ballast' and rank =13) + +update mmt_staging2.IHT_HAM_Drawbar_Block +set Actual_hitch_height_mm = (select column14 +from mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where test_condition='Ballast' and rank =14) + +update mmt_staging2.IHT_HAM_Drawbar_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Drawbar_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Drawbar_Block'); + +/*block starts - IHT_HAM_Tractor_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Tractor_Block',__file_format,__sheet_mnemonic,5); +v_block:='IHT_HAM_Tractor_Block'; + +insert into mmt_staging2.IHT_HAM_Tractor_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_HAM_Tractor_Block +set Wheel_Base_mm=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=5 and column3='Wheel Base (mm)') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_HAM_Tractor_Block +set Engine_Power_hp=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=6 and column3='Engine Power hp') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Tractor_Block +set PTO_Power_hp=(select column6 from +mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +where rank=7 and column3='PTO Power hp') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_HAM_Tractor_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Tractor_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Tractor_Block'); + +/*block starts -IHT_HAM_Weight_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Weight_Block',__file_format,__sheet_mnemonic,6); +v_block:='IHT_HAM_Weight_Block'; + +insert into mmt_staging2.IHT_HAM_Weight_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_HAM_Weight_Block +set test_condition=(select column14 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=2 ) +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set test_condition=(select column14 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=3) +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set Front_weight=(select column21 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=2 and column14='Unballast') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set Front_weight=(select column21 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=3 and column14='Ballast') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set Rear_weight=(select column27 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=2 and column14='Unballast') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set Rear_weight=(select column27 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=3 and column14='Ballast') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set Total_weight=(select column32 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=2 and column14='Unballast') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HAM_Weight_Block +set Total_weight=(select column32 from +mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where rank=3 and column14='Ballast') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_HAM_Weight_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Weight_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Weight_Block'); + + +/*block starts - IHT_HAM_Atmos_Cond_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Atmos_Cond_Block',__file_format,__sheet_mnemonic,7); + v_block:='IHT_HAM_Atmos_Cond_Block'; +insert into mmt_staging2.IHT_HAM_Atmos_Cond_Block +( +dummy_f, +Ambient_temp_C, +humidity, +wind_velocity, +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column9}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column9::text]) AS val + FROM mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int where rank in (15,16,17) + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text); + +update mmt_staging2.IHT_HAM_Atmos_Cond_Block set date= +select where column8 +FROM mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where column7='Date' and rank=15; + +update mmt_staging2.IHT_HAM_Atmos_Cond_Block set start_time= +select where column8 +FROM mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where column7='Start Time' and rank=16; + +update mmt_staging2.IHT_HAM_Atmos_Cond_Block set end_time= +select where column8 +FROM mmt_staging2.IHT_HAM_Engine_RPM_Atmos_Int +where column7='End Time' and rank=17; + + +delete from mmt_staging2.IHT_HAM_Atmos_Cond_Block where dummy_f is null ; +update mmt_staging2.IHT_HAM_Atmos_Cond_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Atmos_Cond_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Atmos_Cond_Block'); + + +/*block starts - IHT_HAM_Results_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Results_Block',__file_format,__sheet_mnemonic,8); +v_block:='IHT_HAM_Results_Block'; +insert into mmt_staging2.IHT_HAM_Results_Block +( +column7,column8,column9, +column10,column11,column12, +column13,column14,column15, +column16,column17,column18, +column19,column20,column21, +column22,column23,column24, +column25,column26,column27, +column28,column29,column30, +column31,column32,column33, +column34,column35,column36,rank +) +select +column7,column8,column9, +column10,column11,column12, +column13,column14,column15, +column16,column17,column18, +column19,column20,column21, +column22,column23,column24, +column25,column26,column27, +column28,column29,column30, +column31,column32,column33, +column34,column35,column36,rank +from mmt_staging2.stg_process_table_IHT_HAM a +where rank_tag='IHT_HAM_Results' +order by rank; + + +update mmt_staging2.IHT_HAM_Results_Block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Results_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Results_Block'); + +/*block starts - IHT_HAM_Footer_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HAM_Footer_block',__file_format,__sheet_mnemonic,8); +v_block:='IHT_HAM_Footer_block'; + +insert into mmt_staging2.IHT_HAM_Footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_HAM_Footer_block a +set prepared_by=( select column7 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set reviewed_by=( select column7 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and trim(column3)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set approved_by=( select column7 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=5 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=6 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_HAM_Footer_block a +set rev2=( select column16 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=6 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_HAM_Footer_block a +set replaces=( select column35 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set revision_no=( select column35 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set prepared_date=( select column17 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set reviewed_date=( select column17 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block a +set approved_date=( select column17 from mmt_staging2.stg_process_table_IHT_HAM b +where b.rank_tag='IHT_HAM_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HAM_Footer_block set model=__model; +execute 'update mmt_staging2.IHT_HAM_Footer_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HAM_Footer_block'); + +v_context := ''; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_ODS.SQL new file mode 100644 index 0000000..f79391a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_ODS.SQL @@ -0,0 +1,269 @@ +drop function if exists mmt_staging2.fn_IHT_HLS_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_HLS_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + begin + +/************************************************************ +Function Name:fn_IHT_HLS_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_HLS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_HLS_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_HLS'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_HLS'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_HLS'; +delete from mmt_ods.test_instance_weight_reaction where test_file_sheet_format='IHT_HLS'; +delete from mmt_ods.iht_hyd_lift_sensitivity where test_file_sheet_format='IHT_HLS'; + + + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +acceptance_criteria, +remarks +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as Sample_Receipt_Date, +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +date '1899-12-30' + Test_Report_Date::int * interval '1' day as Test_Report_Date, +No_of_Sample, +to_date(Test_Start_Date,'DD-MM-YYYY'), +to_date(Test_End_Date, 'DD-MM-YYYY'), +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +from mmt_staging2.IHT_HLS_H1_block; + +update mmt_ods.test_instance a +set +report_prepared_date=to_date(b.prepared_date,'DD-MM-YYYY'), +report_reviewed_date=to_date(b.reviewed_date,'DD-MM-YYYY'), +report_approved_date=to_date(b.approved_date,'DD-MM-YYYY'), +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.IHT_HLS_footer_block b +where a.test_file_sheet_format ='IHT_HLS'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_cm2, +tyre_static_rolling_radius_mm, +tyre_dynamic_rolling_radius_mm, +tyre_wheel_rim_make_and_size +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +tyre_details, +tyre_make, +tyre_size, +ply_rating::numeric, +load_carrying_capacity, +Pressure_kg_cm2::numeric , +Dynamic_rolling_radius::numeric , +Static_rolling_radius::numeric , +wheel_rim_make_size +from mmt_staging2.IHT_HLS_tyre_details_block; + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +wheel_base_mm, +rear_tractor_width_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +wheel_base::numeric , +rear_track_width::numeric +from mmt_staging2.iht_hls_wheel_block; + + +/*block */ + +insert into mmt_ods.test_instance_weight_reaction +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +total_weight_kg, +front_reaction_kg, +rear_reaction_kg, +left_reaction_fl_rl_kg, +right_reaction_fr_rr_kg, +front_left_reaction_kg, +front_right_reactionkg, +rear_left_reaction_kg, +rear_right_reactionkg, +distance_of_lifting_point_from_rear_axle_mm_d1 +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Weight_Reaction, +Total_Weight_kg::numeric, +Front_Reaction_kg::numeric , +Rear_Reaction_kg::numeric , +Left_Reaction_FL_RL_kg::numeric , +Right_reaction_FR_RR_kg::numeric , +Front_Left_Reaction_kg::numeric , +Front_Right_Reaction_kg::numeric , +Rear_Left_Reaction_kg::numeric , +Rear_Right_Reaction_kg::numeric , +Distance_of_lifting_point_from_rear_axle_mm_d1::numeric +from mmt_staging2.iht_hls_weight_block; + + +insert into mmt_ods.iht_hyd_lift_sensitivity +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tpl_load, +engine_rpm_type, +lifting_time_sec, +lowering_time_sec +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +TPL_load, +Engine_RPM, +Lifting_time_Sec::numeric , +Lowering_time_Sec::numeric +from mmt_staging2.iht_hls_numeric_block where ods_record=1; + +select file_syspk into __file_syspk from mmt_staging2.IHT_HLS_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_weight_reaction +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_hyd_lift_sensitivity +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_STG2.sql b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_STG2.sql new file mode 100644 index 0000000..ebc7c5c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_HLS_STG2.sql @@ -0,0 +1,567 @@ +drop function if exists mmt_staging2.fn_IHT_HLS_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_HLS_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************ +Function Name:fn_IHT_HLS_block +Function Desc: This function populates data into staging 2 block +File Format: IHT +Sheet Format: IHT_HLS +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_HLS_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_IHT_HLS_block(1,2,'IHT','IHT_HLS',456) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.IHT_HLS_H1_Int; +truncate table mmt_staging2.IHT_HLS_H1_block; +truncate table mmt_staging2.IHT_HLS_Weight_Tyre_Int; +truncate table mmt_staging2.IHT_HLS_Weight_Block; +truncate table mmt_staging2.IHT_HLS_Wheel_Block; +truncate table mmt_staging2.IHT_HLS_Numeric_Int; +truncate table mmt_staging2.IHT_HLS_Numeric_Block; +truncate table mmt_staging2.IHT_HLS_Tyre_Details_Block; +truncate table mmt_staging2.IHT_HLS_Footer_Block; +truncate table mmt_staging2.stg_specific_table_IHT_HLS; +truncate table mmt_staging2.stg_process_table_IHT_HLS; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for IHT */ +execute 'insert into mmt_staging2.stg_specific_table_IHT_HLS +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_IHT_HLS +set column15='Objective' where column15 like 'Objective%'; + +update mmt_staging2.stg_specific_table_IHT_HLS +set column15='Acceptance Criteria' where column15 like 'Acceptance Criteria%'; + +update mmt_staging2.stg_specific_table_IHT_HLS set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_IHT_HLS set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_IHT_HLS b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_IHT_HLS a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Prepared by'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ +execute 'insert into mmt_staging2.stg_process_table_IHT_HLS +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HLS a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_HLS +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HLS a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Weight Reaction'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_HLS +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HLS a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Numerical data'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_IHT_HLS +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_HLS a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Prepared By'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tractor model*/ +select column6 into __model from mmt_staging2.stg_process_table_IHT_HLS a +where rank_tag='IHT_HLS_H1' and trim(column3)='Tractor Model'; + +/*block starts - IHT_HLS_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HLS_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='IHT_HLS_H1_BLOCK'; + +insert into mmt_staging2.IHT_HLS_H1_INT (c1,c2) +select a.column3,column6 from mmt_staging2.stg_process_table_IHT_HLS a where rank_tag='IHT_HLS_H1'; + +insert into mmt_staging2.IHT_HLS_H1_INT (c1,c2) +select a.column9,column12 from mmt_staging2.stg_process_table_IHT_HLS a where rank_tag='IHT_HLS_H1'; + +insert into mmt_staging2.IHT_HLS_H1_INT (c1,c2) +select 'Objective',column15 +from mmt_staging2.stg_process_table_IHT_HLS a +where rank_tag='IHT_HLS_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_HLS a +where column15='Objective' +and rank_tag='IHT_HLS_H1' +); + +insert into mmt_staging2.IHT_HLS_H1_INT (c1,c2) +select 'Acceptance criteria',column15 +from mmt_staging2.stg_process_table_IHT_HLS a +where rank_tag='IHT_HLS_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_HLS a +where column15='Acceptance criteria' +and rank_tag='IHT_HLS_H1' +); + +insert into mmt_staging2.IHT_HLS_H1_INT (c1,c2) +select split_part(column3,':',1),split_part(column3,':',2) +from mmt_staging2.stg_process_table_IHT_HLS +where rank_tag='IHT_HLS_Numeric' and rank=6; + + +update mmt_staging2.IHT_HLS_H1_Int set model=__model; +execute 'update mmt_staging2.IHT_HLS_H1_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +insert into mmt_staging2.IHT_HLS_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.IHT_HLS_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text, + a_18 text,a_19 text); + + +delete from mmt_staging2.IHT_HLS_H1_Block where dummy_f is null ; +update mmt_staging2.IHT_HLS_H1_Block set model=__model; +execute 'update mmt_staging2.IHT_HLS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HLS_H1_Block'); + + +insert into mmt_staging2.IHT_HLS_Weight_Tyre_Int +( +column3,column6,column10,column13,column15,column17,column19, +column20,rank +) +select +column3,column6,column10,column13,column15,column17,column19, +column20,rank +from mmt_staging2.stg_process_table_IHT_HLS a +where rank_tag='IHT_HLS_Weight_Tyre' +order by rank; + +update mmt_staging2.IHT_HLS_Weight_Tyre_Int set model=__model; +execute 'update mmt_staging2.IHT_HLS_Weight_Tyre_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/*block starts - IHT_HLS_Weight_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HLS_Weight_Block',__file_format,__sheet_mnemonic,2); + v_block:='IHT_HLS_Weight_Block'; +insert into mmt_staging2.IHT_HLS_Weight_Block +( +dummy_f, +Weight_Reaction, +Total_Weight_kg, +Front_Reaction_kg, +Rear_Reaction_kg, +Left_Reaction_FL_RL_kg, +Right_reaction_FR_RR_kg, +Front_Left_Reaction_kg, +Front_Right_Reaction_kg, +Rear_Left_Reaction_kg, +Rear_Right_Reaction_kg, +Distance_of_lifting_point_from_rear_axle_mm_d1 +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column6::text]) AS val + FROM mmt_staging2.IHT_HLS_Weight_Tyre_Int + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text, + a_10 text,a_11 text); + +delete from mmt_staging2.IHT_HLS_Weight_Block where dummy_f is null ; +update mmt_staging2.IHT_HLS_Weight_Block set model=__model; +execute 'update mmt_staging2.IHT_HLS_Weight_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HLS_Weight_Block'); + +/*block starts - IHT_HLS_Tyre_Details_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HLS_Tyre_Details_Block',__file_format,__sheet_mnemonic,3); +v_block:='IHT_HLS_Tyre_Details_Block'; +insert into mmt_staging2.IHT_HLS_Tyre_Details_Block +( +dummy_f, +Tyre_Details, +Tyre_Make, +Tyre_size, +Ply_Rating, +Load_Carrying_Capacity, +Pressure_kg_cm2, +Dynamic_rolling_radius, +Static_rolling_radius, +Wheel_rim_Make_size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column15,column19}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column15::text,column19::text]) AS val + FROM mmt_staging2.IHT_HLS_Weight_Tyre_Int where rank between 3 and 11 + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +delete from mmt_staging2.IHT_HLS_Tyre_Details_Block where dummy_f is null ; +update mmt_staging2.IHT_HLS_Tyre_Details_Block set model=__model; +execute 'update mmt_staging2.IHT_HLS_Tyre_Details_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HLS_Tyre_Details_Block'); + + +/*block starts - IHT_HLS_Wheel_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HLS_Wheel_Block',__file_format,__sheet_mnemonic,4); +v_block:='IHT_HLS_Wheel_Block'; +insert into mmt_staging2.IHT_HLS_Wheel_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_HLS_Wheel_Block +set Wheel_Base=(select column13 from +mmt_staging2.IHT_HLS_Weight_Tyre_Int +where rank=1 and column10='Wheel Base') +where dummy_f='dummy'; + +update mmt_staging2.IHT_HLS_Wheel_Block +set Rear_Track_Width=(select column20 from +mmt_staging2.IHT_HLS_Weight_Tyre_Int +where rank=1 and column17='Rear Track Width') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_HLS_Wheel_Block set model=__model; +execute 'update mmt_staging2.IHT_HLS_Wheel_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HLS_Wheel_Block'); + + +/* insert IHT_HLS_Numeric_Int*/ + +insert into mmt_staging2.IHT_HLS_Numeric_Int +( +column3,column4,column5,column6,column7, +column8,rank +) +select +column3,column4,column5,column6,column7, +column8,rank +from mmt_staging2.stg_process_table_IHT_HLS a +where rank_tag='IHT_HLS_Numeric' +order by rank; + + +update mmt_staging2.IHT_HLS_Numeric_Int set model=__model; +execute 'update mmt_staging2.IHT_HLS_Numeric_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_HLS_Numeric_Int set ods_record =0 where rank in (1,6); + + +/*block starts - IHT_HLS_Numeric_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HLS_Numeric_Block',__file_format,__sheet_mnemonic,5); +v_block:='IHT_HLS_Numeric_Block'; +insert into mmt_staging2.IHT_HLS_Numeric_Block +( +dummy_f, +TPL_load, +Engine_RPM, +Lifting_time_Sec, +Lowering_time_Sec +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column8::text]) AS val + FROM mmt_staging2.IHT_HLS_Numeric_Int + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text); + + update mmt_staging2.iht_hls_numeric_block a + set TPL_load= b.first_value from (SELECT +rank,TPL_load, value_partition, first_value(TPL_load) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +TPL_load, +sum(case when TPL_load is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.iht_hls_numeric_block +ORDER BY rank ASC +) as q) b; + +delete from mmt_staging2.IHT_HLS_Numeric_Block where dummy_f is null; +update mmt_staging2.IHT_HLS_Numeric_Block set model=__model; +execute 'update mmt_staging2.IHT_HLS_Numeric_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HLS_Numeric_Block'); + +/*block starts - IHT_HLS_Footer_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_HLS_Footer_block',__file_format,__sheet_mnemonic,6); +v_block:='IHT_HLS_Footer_block'; +insert into mmt_staging2.IHT_HLS_Footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_HLS_Footer_block a +set prepared_by=( select column7 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set reviewed_by=( select column7 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and trim(column3)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set approved_by=( select column7 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=5 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=6 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_HLS_Footer_block a +set rev2=( select column9 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set rev3=( select column18 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set replaces=( select column19 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set revision_no=( select column19 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set prepared_date=( select column16 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set reviewed_date=( select column16 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block a +set approved_date=( select column16 from mmt_staging2.stg_process_table_IHT_HLS b +where b.rank_tag='IHT_HLS_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_HLS_Footer_block set model=__model; +execute 'update mmt_staging2.IHT_HLS_Footer_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_HLS_Footer_block'); +v_context := ''; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_NST_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_NST_ODS.SQL new file mode 100644 index 0000000..b2a0ddc --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_NST_ODS.SQL @@ -0,0 +1,499 @@ +drop function if exists mmt_staging2.fn_IHT_NST_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_NST_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + begin + +/************************************************************ +Function Name:fn_IHT_NST_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_NST +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_NST_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_NST'; +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='IHT_NST'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_NST'; +delete from mmt_ods.test_instance_atmospheric_info where test_file_sheet_format='IHT_NST'; +delete from mmt_ods.iht_noise_measurement_results where test_file_sheet_format='IHT_NST'; +delete from mmt_ods.iht_noise_measurement_test where test_file_sheet_format='IHT_NST'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_NST'; + + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +test_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as Sample_Receipt_Date, +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +date '1899-12-30' + Test_Report_Date::int * interval '1' day as Test_Report_Date, +No_of_Sample, +date '1899-12-30' + Test_Start_Date::int * interval '1' day as Test_Start_Date, +date '1899-12-30' + Test_End_Date::int * interval '1' day as Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_facility, +Operator_Name, +Project_Group, +Objective, +Condition +from + mmt_staging2.IHT_NST_H1_block; + +update mmt_ods.test_instance a +set report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.iht_nst_footer_block b +where a.test_file_sheet_format='IHT_NST'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_wheel_rim_make_and_size +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +tyre_details, +tyre_make, +tyre_size, +ply_rating::numeric , +load_carrying_capacity, +wheel_rim_make_size +from mmt_staging2.iht_nst_tyre_details_block; + + + insert into mmt_ods.test_instance_engine_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +low_idle_declared, +low_idle_observed, +high_idle_declared, +high_idle_observed, +rated_rpm, +rated_rpm_observed, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +low_idle_declared, +low_idle_observed::numeric, +high_idle_declared, +high_idle_observed::numeric, +rated_rpm_declared::numeric, +rated_rpm_observed::numeric, +engine_to_pto_ratio +from mmt_staging2.iht_nst_engine_rpm_block; + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +weight_reactions_front_kg, +tractor_weight_front_observed_kg, +tractor_weight_front_remark, +weight_reactions_rear_kg, +tractor_weight_rear_observed_kg, +tractor_weight_rear_remark, +tractor_weight_total_kg, +tractor_weight_total_observed_kg, +tractor_weight_total_remark +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +front_weight_declared::numeric , +front_weight_observed::numeric, +front_weight_remark, +rear_weight_declared::numeric, +rear_weight_observed::numeric, +rear_weight_remark, +total_weight_declared::numeric, +total_weight_observed::numeric, +total_weight_remark +from mmt_staging2.iht_nst_weight_block; + + +/*block */ + +insert into mmt_ods.test_instance_atmospheric_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +ambient_temp_c, +humidity_pct, +pressure_kpa, +background_noise_dba, +wind_velocity_kmph +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +ambient_temp_c::numeric, +humidity::numeric, +pressure_kpa::numeric, +background_noise::numeric, +wind_velocity +from mmt_staging2.iht_nst_atmos_cond_block; + +insert into mmt_ods.iht_noise_measurement_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_type, +test_mode, +gear, +noise_level_1_db_a, +noise_level_2_db_a, +noise_level_3_db_a +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column1, +column2, +column3, +column4::numeric, +column5::numeric, +column6::numeric +from mmt_staging2.iht_nst_stand_noise_block where ods_record=1; + +update mmt_ods.iht_noise_measurement_results +set test_condition = (select column4 +from mmt_staging2.iht_nst_stand_noise_block +where rank=3); + +insert into mmt_ods.iht_noise_measurement_test +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_type, +test_mode +) +select +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_type, +test_mode +from mmt_ods.iht_noise_measurement_results where test_type='BY STANDARD NOISE'; + +update mmt_ods.iht_noise_measurement_test +set acceptance_criteria=b.acceptance_criteria, +remarks =b.remarks +from mmt_staging2.iht_nst_stand_noise_block b +where b.column1 ='BY STANDARD NOISE' and test_type='BY STANDARD NOISE'; + +insert into mmt_ods.iht_noise_measurement_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_type, +test_mode, +gear, +noise_level_1_db_a, +noise_level_2_db_a, +noise_level_3_db_a +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column1, +column2, +column3, +column7::numeric, +column8::numeric, +column9::numeric +from mmt_staging2.iht_nst_stand_noise_block where ods_record=1; + +update mmt_ods.iht_noise_measurement_results +set test_condition = (select column7 +from mmt_staging2.iht_nst_stand_noise_block +where rank=3) where test_condition is null; + +insert into mmt_ods.iht_noise_measurement_test +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_type, +test_mode +) +select +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_type, +test_mode +from mmt_ods.iht_noise_measurement_results where test_type='BY STANDARD NOISE'; + +update mmt_ods.iht_noise_measurement_test +set acceptance_criteria=b.acceptance_criteria, +remarks =b.remarks +from mmt_staging2.iht_nst_stand_noise_block b +where b.column1 ='BY STANDARD NOISE' and test_type='BY STANDARD NOISE'; + + + +insert into mmt_ods.iht_noise_measurement_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_type, +test_mode, +gear, +load_kg, +speed_kmph, +speed_rpm, +noise_level_1_db_a, +noise_level_2_db_a, +noise_level_3_db_a +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column1, +column2, +column3, +column4::numeric, +column5::numeric, +column6::numeric, +column7::numeric, +column8::numeric, +column9::numeric +from mmt_staging2.iht_nst_oel_noise_block where ods_record=1; + +insert into mmt_ods.iht_noise_measurement_test +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_type, +test_mode +) +select +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +test_type, +test_mode +from mmt_ods.iht_noise_measurement_results where test_type ='OEL Noise'; + +update mmt_ods.iht_noise_measurement_test +set acceptance_criteria=b.acceptance_criteria, +remarks =b.remarks +from mmt_staging2.iht_nst_oel_noise_block b +where b.column1 ='OEL Noise' and test_type='OEL Noise'; + +delete from mmt_ods.iht_noise_measurement_test a +using mmt_ods.iht_noise_measurement_test b +where (a.syspk < b.syspk and +a.test_condition is not null and +a.test_condition =b.test_condition and +a.test_mode =b.test_mode and a.test_type=b.test_type) or +(a.syspk < b.syspk and a.test_condition is null and a.test_mode =b.test_mode and a.test_type=b.test_type); + +update mmt_ods.iht_noise_measurement_results a +set noise_measurement_id =(select syspk +from mmt_ods.iht_noise_measurement_test b +where (a.test_condition =b.test_condition and a.test_condition is not null and +a.test_mode =b.test_mode and a.test_type=b.test_type) or +(a.test_condition is null and a.test_mode =b.test_mode and a.test_type=b.test_type)); + +select file_syspk into __file_syspk from mmt_staging2.IHT_NST_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_atmospheric_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_noise_measurement_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_noise_measurement_test +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_ODS.SQL b/deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_ODS.SQL new file mode 100644 index 0000000..1d43d81 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_ODS.SQL @@ -0,0 +1,347 @@ +drop function if exists mmt_staging2.fn_IHT_SLL_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_SLL_ODS() + RETURNS void AS $$ + declare __test_instance_id int; + declare __file_syspk int; + begin + +/************************************************************ +Function Name:fn_IHT_SLL_ODS +Function Desc: This function populates data into ODS +File Format: IHT +Sheet Format: IHT_SLL +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_SLL_ODS() +***************************************************************/ +delete from mmt_ods.test_instance where test_file_sheet_format='IHT_SLL'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='IHT_SLL'; +delete from mmt_ods.test_instance_tyre_info where test_file_sheet_format='IHT_SLL'; +delete from mmt_ods.test_instance_weight_reaction where test_file_sheet_format='IHT_SLL'; +delete from mmt_ods.iht_gear_max_speed where test_file_sheet_format='IHT_SLL'; +delete from mmt_ods.iht_speed_lead_lag_measurement where test_file_sheet_format='IHT_SLL'; + + + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +job_order_no, +sample_receipt_date, +test_report_no, +generation, +customer_name, +test_engineer, +test_report_date, +no_of_sample, +test_start_date, +test_end_date, +tractor_sr_no, +test_standard_ref, +test_location_name, +test_operator, +project_group, +objective_of_test, +acceptance_criteria, +remarks +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Test_Request_no, +date '1899-12-30' + sample_receipt_date::int * interval '1' day as Sample_Receipt_Date, +Test_report_No, +Generation, +Customer_Name, +Test_Engineer, +date '1899-12-30' + Test_Report_Date::int * interval '1' day as Test_Report_Date, +No_of_Sample, +to_date(Test_Start_Date,'DD-MM-YYYY'), +to_date(Test_End_Date, 'DD-MM-YYYY'), +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +from mmt_staging2.IHT_SLL_H1_block; + +update mmt_ods.test_instance a +set +report_prepared_date=to_date(b.prepared_date,'DD-MM-YYYY'), +report_reviewed_date=to_date(b.reviewed_date,'DD-MM-YYYY'), +report_approved_date=to_date(b.approved_date,'DD-MM-YYYY'), +report_prepared_by=b.prepared_by, +report_reviewed_by=b.reviewed_by, +report_approved_by=b.approved_by, +report_template_replaces=b.replaces, +report_title=b.comments, +report_template_no=b.rev1, +report_template_rev_date=b.rev2, +report_template_rev_no= b.rev3 +from mmt_staging2.IHT_SLL_footer_block b +where a.test_file_sheet_format ='IHT_SLL'; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tyre_type, +tyre_make, +tyre_size, +tyre_ply_rating, +tyre_load_carrying_capacity, +tyre_pressure_kg_per_cm2, +tyre_static_rolling_radius_mm, +tyre_dynamic_rolling_radius_mm, +tyre_wheel_rim_make_and_size +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +tyre_details, +tyre_make, +tyre_size, +ply_rating::numeric, +load_carrying_capacity, +Pressure_kg_cm2::numeric , +Dynamic_rolling_radius::numeric , +Static_rolling_radius::numeric , +wheel_rim_make_size +from mmt_staging2.IHT_SLL_tyre_details_block; + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +wheel_base_mm, +rear_tractor_width_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +wheel_base::numeric , +rear_track_width::numeric +from mmt_staging2.IHT_SLL_wheel_block; + + +/*block */ + +insert into mmt_ods.test_instance_weight_reaction +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +total_weight_kg, +front_reaction_kg, +rear_reaction_kg, +left_reaction_fl_rl_kg, +right_reaction_fr_rr_kg, +front_left_reaction_kg, +front_right_reactionkg, +rear_left_reaction_kg, +rear_right_reactionkg, +distance_of_lifting_point_from_rear_axle_mm_d1 +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Weight_Reaction, +Total_Weight_kg::numeric, +Front_Reaction_kg::numeric , +Rear_Reaction_kg::numeric , +Left_Reaction_FL_RL_kg::numeric , +Right_reaction_FR_RR_kg::numeric , +Front_Left_Reaction_kg::numeric , +Front_Right_Reaction_kg::numeric , +Rear_Left_Reaction_kg::numeric , +Rear_Right_Reaction_kg::numeric , +Distance_of_lifting_point_from_rear_axle_mm_d1::numeric +from mmt_staging2.IHT_SLL_weight_block; + + +insert into mmt_ods.iht_gear_max_speed +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +gear, +low_1000_rpm, +rated_2300_rpm, +specification, +high_2500_rpm, +actual_speed_pct, +diff_in_speed_kmph +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3, +column4::numeric , +column5::numeric, +column6::numeric, +column7::numeric, +column8::numeric, +column9::numeric +from mmt_staging2.iht_sll_forward_block where ods_record=1; + +insert into mmt_ods.iht_gear_max_speed +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +gear, +low_1000_rpm, +rated_2300_rpm, +specification, +high_2500_rpm, +actual_speed_pct, +diff_in_speed_kmph +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3, +column4::numeric , +column5::numeric, +column6::numeric, +column7::numeric, +column8::numeric, +column9::numeric +from mmt_staging2.iht_sll_reverse_block where ods_record=1; + +insert into mmt_ods.iht_speed_lead_lag_measurement +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +gear, +engine_rpm, +wheel_drive_type, +no_of_revolution_front, +ratio, +lead_lag_pct +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3, +column4::numeric , +column5, +column6::numeric, +column7::numeric, +column8 +from mmt_staging2.iht_sll_lead_lag_block where ods_record=1; + +select file_syspk into __file_syspk from mmt_staging2.IHT_SLL_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_weight_reaction +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_gear_max_speed +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.iht_speed_lead_lag_measurement +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_STG2.sql b/deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_STG2.sql new file mode 100644 index 0000000..23824ae --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/IHT/IHT_SLL_STG2.sql @@ -0,0 +1,664 @@ +drop function if exists mmt_staging2.fn_IHT_SLL_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_IHT_SLL_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************ +Function Name:fn_IHT_SLL_block +Function Desc: This function populates data into staging 2 block +File Format: IHT +Sheet Format: IHT_SLL +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_IHT_SLL_block(p_client_id,p_function_id, p_file_format, +p_sheet_mnemonic, p_file_syspk) +Function call ex: select mmt_staging2.fn_IHT_SLL_block(1,2,'IHT','IHT_SLL',456) +***************************************************************/ + + +SET search_path TO mmt_staging2; + +/* to process multiple files - re-runnability*/ + +truncate table mmt_staging2.IHT_SLL_H1_Int; +truncate table mmt_staging2.IHT_SLL_H1_block; +truncate table mmt_staging2.IHT_SLL_Weight_Tyre_Int; +truncate table mmt_staging2.IHT_SLL_Weight_Block; +truncate table mmt_staging2.IHT_SLL_Wheel_Block; +truncate table mmt_staging2.IHT_SLL_Tyre_Details_Block; +truncate table mmt_staging2.IHT_SLL_Forward_Block; +truncate table mmt_staging2.IHT_SLL_Reverse_Block; +truncate table mmt_staging2.IHT_SLL_Lead_Lag_Block; +truncate table mmt_staging2.IHT_SLL_Footer_Block; +truncate table mmt_staging2.stg_specific_table_IHT_SLL; +truncate table mmt_staging2.stg_process_table_IHT_SLL; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for IHT */ +execute 'insert into mmt_staging2.stg_specific_table_IHT_SLL +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_IHT_SLL +set column15='Objective' where column15 like 'Objective%'; + +update mmt_staging2.stg_specific_table_IHT_SLL +set column15='Acceptance criteria' where column15 like 'Acceptance criteria%'; + +update mmt_staging2.stg_specific_table_IHT_SLL set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_IHT_SLL set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_IHT_SLL b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_IHT_SLL a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Remarks:'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ +execute 'insert into mmt_staging2.stg_process_table_IHT_SLL +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_SLL a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Request no.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_SLL +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_SLL a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Weight Reaction'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_SLL +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_SLL a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''DHRUV EXPORT EACH GEAR MAX SPEED - FORWARD'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_SLL +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_SLL a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''DHRUV EXPORT EACH GEAR MAX SPEED REVERSE'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_IHT_SLL +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_SLL a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Lead / Lag Measurement on Dhruv Export 4WD'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_IHT_SLL +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_IHT_SLL a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Remarks:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*selecting tractor model*/ +select column6 into __model from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_H1' and trim(column3)='Tractor Model'; + +/*block starts - IHT_SLL_H1_BLOCK */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_H1_BLOCK',__file_format,__sheet_mnemonic,1); +v_block:='IHT_SLL_H1_BLOCK'; + +insert into mmt_staging2.IHT_SLL_H1_INT (c1,c2) +select a.column3,column6 from mmt_staging2.stg_process_table_IHT_SLL a where rank_tag='IHT_SLL_H1'; + +insert into mmt_staging2.IHT_SLL_H1_INT (c1,c2) +select a.column9,column12 from mmt_staging2.stg_process_table_IHT_SLL a where rank_tag='IHT_SLL_H1'; + +insert into mmt_staging2.IHT_SLL_H1_INT (c1,c2) +select 'Objective',column15 +from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_SLL a +where column15='Objective' +and rank_tag='IHT_SLL_H1' +); + +insert into mmt_staging2.IHT_SLL_H1_INT (c1,c2) +select 'Acceptance criteria',column15 +from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_H1' +and row_number= +( +select row_number+1 from +mmt_staging2.stg_process_table_IHT_SLL a +where column15='Acceptance criteria' +and rank_tag='IHT_SLL_H1' +); + +insert into mmt_staging2.IHT_SLL_H1_INT (c1,c2) +select split_part(column3,':',1),split_part(column3,':',2) +from mmt_staging2.stg_process_table_IHT_SLL +where rank_tag='IHT_SLL_Footer' and rank=1; + + +update mmt_staging2.IHT_SLL_H1_Int set model=__model; +execute 'update mmt_staging2.IHT_SLL_H1_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +insert into mmt_staging2.IHT_SLL_H1_Block +( +dummy_f, +Test_Request_no, +Sample_Receipt_Date, +Test_report_No, +Tractor_Model, +Generation, +Customer_Name, +Test_Engineer, +Test_Report_Date, +No_of_Sample, +Test_Start_Date, +Test_End_Date, +Tractor_Sr_No, +Test_Standard_Refer, +Test_Location, +Operator_Name, +Project_Group, +Objective, +Acceptance_Criteria, +Remarks +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c2::text]) AS val + FROM mmt_staging2.IHT_SLL_H1_INT + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text, + a_18 text,a_19 text); + + +delete from mmt_staging2.IHT_SLL_H1_Block where dummy_f is null ; +update mmt_staging2.IHT_SLL_H1_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_H1_Block'); + + +insert into mmt_staging2.IHT_SLL_Weight_Tyre_Int +( +column3,column6,column10,column11,column13,column15,column17,column19, +column20,rank +) +select +column3,column6,column10,column11,column13,column15,column17,column19, +column20,rank +from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_Weight_Tyre' +order by rank; + +update mmt_staging2.IHT_SLL_Weight_Tyre_Int set model=__model; +execute 'update mmt_staging2.IHT_SLL_Weight_Tyre_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/*block starts - IHT_SLL_Weight_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Weight_Block',__file_format,__sheet_mnemonic,2); +v_block:='IHT_SLL_Weight_Block'; +insert into mmt_staging2.IHT_SLL_Weight_Block +( +dummy_f, +Weight_Reaction, +Total_Weight_kg, +Front_Reaction_kg, +Rear_Reaction_kg, +Left_Reaction_FL_RL_kg, +Right_reaction_FR_RR_kg, +Front_Left_Reaction_kg, +Front_Right_Reaction_kg, +Rear_Left_Reaction_kg, +Rear_Right_Reaction_kg, +Distance_of_lifting_point_from_rear_axle_mm_d1 +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column6::text]) AS val + FROM mmt_staging2.IHT_SLL_Weight_Tyre_Int + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text, + a_10 text,a_11 text); + +delete from mmt_staging2.IHT_SLL_Weight_Block where dummy_f is null ; +update mmt_staging2.IHT_SLL_Weight_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Weight_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_Weight_Block'); + +/*block starts - IHT_SLL_Tyre_Details_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Tyre_Details_Block',__file_format,__sheet_mnemonic,3); +v_block:='IHT_SLL_Tyre_Details_Block'; +insert into mmt_staging2.IHT_SLL_Tyre_Details_Block +( +dummy_f, +Tyre_Details, +Tyre_Make, +Tyre_size, +Ply_Rating, +Load_Carrying_Capacity, +Pressure_kg_cm2, +Dynamic_rolling_radius, +Static_rolling_radius, +Wheel_rim_Make_size +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column15,column19}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column15::text,column19::text]) AS val + FROM mmt_staging2.IHT_SLL_Weight_Tyre_Int where rank between 3 and 11 + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +delete from mmt_staging2.IHT_SLL_Tyre_Details_Block where dummy_f is null ; +update mmt_staging2.IHT_SLL_Tyre_Details_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Tyre_Details_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_Tyre_Details_Block'); + + +/*block starts - IHT_SLL_Wheel_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Wheel_Block',__file_format,__sheet_mnemonic,4); +v_block:='IHT_SLL_Wheel_Block'; +insert into mmt_staging2.IHT_SLL_Wheel_Block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_SLL_Wheel_Block +set Wheel_Base=(select column13 from +mmt_staging2.IHT_SLL_Weight_Tyre_Int +where rank=1 and column10='Wheel Base') +where dummy_f='dummy'; + +update mmt_staging2.IHT_SLL_Wheel_Block +set Rear_Track_Width=(select column20 from +mmt_staging2.IHT_SLL_Weight_Tyre_Int +where rank=1 and column17='Rear Track Width') +where dummy_f='dummy'; + + +update mmt_staging2.IHT_SLL_Wheel_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Wheel_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_Wheel_Block'); + +/*block starts - IHT_SLL_Forward_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Forward_Block',__file_format,__sheet_mnemonic,5); +v_block:='IHT_SLL_Forward_Block'; + +insert into mmt_staging2.IHT_SLL_Forward_Block +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_Forward' +order by rank; + +update mmt_staging2.IHT_SLL_Forward_Block +set column2=(select split_part(column3,'-',2) +from mmt_staging2.IHT_SLL_Forward_Block where rank =1); + +update mmt_staging2.IHT_SLL_Forward_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Forward_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_SLL_Forward_Block set ods_record =0 where rank in (1,2); + + +/*block starts - IHT_SLL_Forward_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Forward_Block',__file_format,__sheet_mnemonic,6); + +v_block:='IHT_SLL_Forward_Block'; + +insert into mmt_staging2.IHT_SLL_Reverse_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_Reverse' +order by rank; + +update mmt_staging2.iht_sll_reverse_block +set column2=(select split_part(column3,' ',7) +from mmt_staging2.iht_sll_reverse_block where rank =1); + +update mmt_staging2.IHT_SLL_Reverse_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Reverse_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.IHT_SLL_Reverse_Block set ods_record =0 where rank in (1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_Reverse_Block'); + +/*block starts - IHT_SLL_Lead_Lag_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Lead_Lag_Block',__file_format,__sheet_mnemonic,7); +v_block='IHT_SLL_Lead_Lag_Block'; +insert into mmt_staging2.IHT_SLL_Lead_Lag_Block +( +column3,column4,column5,column6,column7, +column8,rank +) +select +column3,column4,column5,column6,column7, +column8,rank +from mmt_staging2.stg_process_table_IHT_SLL a +where rank_tag='IHT_SLL_Lead_Lag' +order by rank; + + +update mmt_staging2.IHT_SLL_Lead_Lag_Block a + set column3= b.first_value from (SELECT +rank, column3, value_partition, first_value(column3) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column3, +sum(case when column3 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_SLL_Lead_Lag_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.IHT_SLL_Lead_Lag_Block a + set column4= b.first_value from (SELECT +rank, column4, value_partition, first_value(column4) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column4, +sum(case when column4 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_SLL_Lead_Lag_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + +update mmt_staging2.IHT_SLL_Lead_Lag_Block a + set column7= b.first_value from (SELECT +rank, column7, value_partition, first_value(column7) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column7, +sum(case when column7 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_SLL_Lead_Lag_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + +update mmt_staging2.IHT_SLL_Lead_Lag_Block a + set column8= b.first_value from (SELECT +rank, column8, value_partition, first_value(column8) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column8, +sum(case when column8 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.IHT_SLL_Lead_Lag_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.IHT_SLL_Lead_Lag_Block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Lead_Lag_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +update mmt_staging2.IHT_SLL_Lead_Lag_Block set ods_record =0 where rank in (1,2,3); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_Lead_Lag_Block'); + +/*block starts - IHT_SLL_Footer_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'IHT_SLL_Footer_block',__file_format,__sheet_mnemonic,8); +v_block:='IHT_SLL_Footer_block'; +insert into mmt_staging2.IHT_SLL_Footer_block(dummy_f) values ('dummy'); + +update mmt_staging2.IHT_SLL_Footer_block a +set prepared_by=( select column7 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and trim(column3)='Prepared by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set reviewed_by=( select column7 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and trim(column3)='Reviewed by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set approved_by=( select column7 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and trim(column3)='Approved by' ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set comments=( select column3 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=5 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set rev1=( select column3 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=6 ) +where dummy_F='dummy'; + + +update mmt_staging2.IHT_SLL_Footer_block a +set rev2=( select column9 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set rev3=( select column18 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=6 ) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set replaces=( select column19 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set revision_no=( select column19 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set prepared_date=( select column16 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=1) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set reviewed_date=( select column16 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=2) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block a +set approved_date=( select column16 from mmt_staging2.stg_process_table_IHT_SLL b +where b.rank_tag='IHT_SLL_Footer' +and rank=3) +where dummy_F='dummy'; + +update mmt_staging2.IHT_SLL_Footer_block set model=__model; +execute 'update mmt_staging2.IHT_SLL_Footer_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'IHT_SLL_Footer_block'); +v_context := ''; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_ODS.SQL new file mode 100644 index 0000000..2b97dc4 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_ODS.SQL @@ -0,0 +1,241 @@ +drop function if exists mmt_staging2.fn_BUDNI_ARC_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_ARC_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin +__file_syspk := p_file_syspk; +/************************************************************ +Function Name:fn_BUDNI_ARC_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_ARC +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_ARC_ODS() +***************************************************************/ +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_ARC'; +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_ARC'; +-- delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_ARC'; +--delete from mmt_ods.budni_air_cleaner_perf_results where test_file_sheet_format='BUDNI_ARC'; +--delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_ARC'; + + +SET search_path TO mmt_staging2; + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +ballast_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +FIP_type, +steering_type, +Ballast_Condition +from mmt_staging2.BUDNI_ARC_Spec_H1_block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +type_of_road +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +type_of_track +from + mmt_staging2.BUDNI_ARC_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int, +engine_to_pto_ratio engine_to_pto_ratio_540_pto +from mmt_staging2.BUDNI_ARC_Spec_H1_block; + + +/*block */ + +insert into mmt_ods.budni_air_cleaner_perf_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +atm_condtion_temperature_c, +atm_condition_pressure_kpa, +atm_condition_relative_humidity_pct, +atm_condtion_mass_of_oil_before_test, +position_of_tractor, +loss_of_oil_g, +oil_pull_over_pct, +engine_oil_pressure +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Temperature_C, +Pressure_kPa, +Relative_humidity::numeric, +Mass_of_oil_before_test::numeric, +Position_of_tractor, +Loss_of_oil::numeric, +Oil_pull_Over::numeric, +Engine_oil_pressure +from mmt_staging2.budni_arc_perf_atmos_meas_test_block where ods_record=1 +order by rank; + + + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +sequence_number, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::int, +column4, +column5, +column6, +column7, +column8, +column9 +from mmt_staging2.BUDNI_ARC_test_obs_summary_block where ods_record=1; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_ARC_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_air_cleaner_perf_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_ARC' ,null,'ods', 'fn_BUDNI_ARC_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_ARC' ,null,'ods', 'fn_BUDNI_ARC_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_STG2.sql new file mode 100644 index 0000000..1e36143 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_ARC_STG2.sql @@ -0,0 +1,315 @@ +drop function if exists mmt_staging2.fn_BUDNI_ARC_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_ARC_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + +/*********************************************************************************** +Function Name:fn_BUDNI_ARC_Block +Function Desc: This function populates data into staging2 blocks +File Format:BUDNI +Sheet Format: BUDNI_ARC +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_SUM_Block (20,1,'BUDNI','BUDNI_ARC',273); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.BUDNI_ARC_Spec_H1_Block; +truncate mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block; +truncate mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block; +truncate mmt_staging2.stg_specific_table_BUDNI_ARC; +truncate mmt_staging2.stg_process_table_BUDNI_ARC; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI*/ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_ARC +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_BUDNI_ARC set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_BUDNI_ARC set column3 = TRIM (LEADING FROM column3 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_ARC b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_ARC a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_ARC b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_staging2.stg_specific_table_BUDNI_ARC a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''AIR CLEANER OIL PULL OVER TEST Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_ARC +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_ARC a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_ARC +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_ARC a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Atmospheric conditions:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_ARC +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_ARC a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''AIR CLEANER OIL PULL OVER TEST Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_ARC a +where rank_tag='BUDNI_ARC_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_ARC a +where rank_tag='BUDNI_ARC_Spec_H1' and rank=3; + + + +/* blocks data loading start - BUDNI_ARC_Spec_H1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_ARC_Spec_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_ARC_Spec_H1_Block'; + +insert into mmt_staging2.BUDNI_ARC_Spec_H1_block +( +make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,rank) +select column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_ARC where rank_tag='BUDNI_ARC_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_ARC_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_ARC_Spec_H1_block a +set FIP_type=column3,steering_type=column4,Engine_to_PTO_ratio= column5,Ballast_Condition=column6, +Test_Engine_Set_RPM=column7,Type_of_track=column8 +from mmt_staging2.stg_process_table_BUDNI_ARC b +where b.rank_tag='BUDNI_ARC_Spec_H1' +and b.rank=5 +and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_ARC_Spec_H1_Block +set ods_record=0 where rank in(1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_ARC_Spec_H1_block'); + + + +/* blocks data loading start - BUDNI_ARC_Perf_Atmos_Meas_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_ARC_Perf_Atmos_Meas_Test_Block',__file_format,__sheet_mnemonic,2); + +v_block:='BUDNI_ARC_Perf_Atmos_Meas_Test_Block'; + +insert into mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block +( +Position_of_tractor, +Loss_of_oil, +Oil_pull_Over, +Engine_oil_pressure, +rank +) +select +column3,column6,column7,column8,rank +from mmt_staging2.stg_process_table_BUDNI_ARC a +where rank_tag ='BUDNI_ARC_Perf_Atmos_Meas_Test' and rank in (5,6,7,8,9) +order by rank; + + + +update mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block a +set +Temperature_C=column3, +Pressure_kPa=column4 , +Relative_humidity=column5, +Mass_of_oil_before_test=column6 +from mmt_staging2.stg_process_table_BUDNI_ARC b +where b.rank_tag ='BUDNI_ARC_Perf_Atmos_Meas_Test' +and b.rank =3 +and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_ARC_Perf_Atmos_Meas_Test_Block'); + + + +/* blocks data loading start - BUDNI_ARC_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_ARC_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,3); + +v_block:='BUDNI_ARC_Test_Obs_Summary_Block'; + +insert into mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_ARC a +where rank_tag='BUDNI_ARC_Test_Obs_Summary' and rank in (1,2,3) +order by rank; + + +update mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block +set ods_record=0 where +rank in(1,2); + + +update mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_ARC_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_ARC_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_ARC_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_ODS.SQL new file mode 100644 index 0000000..47f5449 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_ODS.SQL @@ -0,0 +1,499 @@ +drop function if exists mmt_staging2.fn_BUDNI_BRK_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_BRK_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_BUDNI_BRK_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_BRK +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_BRK_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_BRK'; +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_BRK'; +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_BRK'; +--delete from mmt_ods.budni_brake_perf_parking_brake_test_results +--where test_file_sheet_format='BUDNI_BRK'; +--delete from mmt_ods.budni_brake_perf_service_brake_test_results +--where test_file_sheet_format='BUDNI_BRK'; +--delete from mmt_ods.budni_test_observations +--where test_file_sheet_format='BUDNI_BRK'; + + +SET search_path TO mmt_staging2; + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +brake_type, +brake_free_play_lh, +brake_free_play_rh, +unballasted_max_speed_kmph, +road_ballasted_max_speed_kmph +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::numeric tractor_engine_hp, +Type_of_brake, +brake_free_play_lh::numeric , +brake_free_play_rh::numeric , +maximum_attainable_speed_kmph_unballasted::numeric , +maximum_attainable_speed_kmph_ballasted::numeric +from mmt_staging2.BUDNI_BRK_Spec_H1_block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +type_of_road +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +type_of_track +from + mmt_staging2.BUDNI_BRK_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int +from mmt_staging2.BUDNI_BRK_Spec_H1_block; + + +/*block */ + +insert into mmt_ods.budni_brake_perf_service_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +braking_device_control_force_n, +mean_deceleration_msec2, +stopping_dist_m +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +Braking_device_control_force_N::numeric , +Mean_deceleration_m_sec2::numeric , +Stopping_distance_m ::numeric +from mmt_staging2.budni_brk_service_cold_ballasted_25kmph_block; + +insert into mmt_ods.budni_brake_perf_service_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +braking_device_control_force_n, +mean_deceleration_msec2, +stopping_dist_m +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +Braking_device_control_force_N::numeric , +Mean_deceleration_m_sec2::numeric , +Stopping_distance_m ::numeric +from mmt_staging2.budni_brk_service_cold_ballasted_maximum_block; + +insert into mmt_ods.budni_brake_perf_service_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +braking_device_control_force_n, +mean_deceleration_msec2, +stopping_dist_m +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +Braking_device_control_force_N::numeric , +Mean_deceleration_m_sec2::numeric , +Stopping_distance_m ::numeric +from mmt_staging2.budni_brk_service_cold_standard_25kmph_block; + +insert into mmt_ods.budni_brake_perf_service_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +braking_device_control_force_n, +mean_deceleration_msec2, +stopping_dist_m +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +Braking_device_control_force_N::numeric , +Mean_deceleration_m_sec2::numeric , +Stopping_distance_m ::numeric +from mmt_staging2.budni_brk_service_cold_standard_maximum_block; + + +insert into mmt_ods.budni_brake_perf_service_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +braking_device_control_force_n, +mean_deceleration_msec2, +stopping_dist_m +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +Braking_device_control_force_N::numeric , +Mean_deceleration_m_sec2::numeric , +Stopping_distance_m ::numeric +from mmt_staging2.budni_brk_service_fade_standard_maximum_block; + +insert into mmt_ods.budni_brake_perf_service_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +braking_device_control_force_n, +mean_deceleration_msec2, +stopping_dist_m +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +brake_test_type, +brake_test_name, +speed_condition, +ballast_condition, +Braking_device_control_force_N::numeric , +Mean_deceleration_m_sec2::numeric , +Stopping_distance_m ::numeric +from mmt_staging2.budni_brk_service_fade_ballasted_25kmph_block; + + + +update mmt_ods.budni_brake_perf_service_brake_test_results +set max_dev_of_tractor_from_its_org_course_m =column3, +abnormal_vibration=column5, +the_brakes_were_heated_by =column7 +from mmt_staging2.budni_brk_other_observations_Block where ods_record =1; + +insert into mmt_ods.budni_brake_perf_parking_brake_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +particulars +from mmt_staging2.budni_brk_parking_barke_test_block where particulars is not null; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set braking_device_control_force_n_facing_up = (select +Braking_device_control_force::numeric +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing up' and particulars='18 percent slope') +where test_condition='18 percent slope'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set braking_device_control_force_n_facing_down = (select +Braking_device_control_force::numeric +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing Down' and particulars='18 percent slope') +where test_condition='18 percent slope'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set efficacy_of_parking_brake_facing_down = (select +Efficacy_of_parking_brake +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing Down' and particulars='18 percent slope') +where test_condition='18 percent slope'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set efficacy_of_parking_brake_facing_up = (select +Efficacy_of_parking_brake +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing up' and particulars='18 percent slope') +where test_condition='18 percent slope'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set braking_device_control_force_n_facing_up = (select +Braking_device_control_force::numeric +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing up' and particulars='12 percent slope with trailer of 2.55 tonnes.') +where test_condition='12 percent slope with trailer of 2.55 tonnes.'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set braking_device_control_force_n_facing_down = (select +Braking_device_control_force::numeric +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing Down' and particulars='12 percent slope with trailer of 2.55 tonnes.') +where test_condition='12 percent slope with trailer of 2.55 tonnes.'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set efficacy_of_parking_brake_facing_down = (select +Efficacy_of_parking_brake +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing Down' and particulars='12 percent slope with trailer of 2.55 tonnes.') +where test_condition='12 percent slope with trailer of 2.55 tonnes.'; + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set efficacy_of_parking_brake_facing_up = (select +Efficacy_of_parking_brake +from mmt_staging2.budni_brk_parking_barke_test_block +where facing='Facing up' and particulars='12 percent slope with trailer of 2.55 tonnes.') +where test_condition='12 percent slope with trailer of 2.55 tonnes.'; + +delete from mmt_ods.budni_brake_perf_parking_brake_test_results a +using mmt_ods.budni_brake_perf_parking_brake_test_results b +where a.syspk < b.syspk and a.test_condition =b.test_condition ; + + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3, +column4, +column5, +column6, +column7, +column8 +from mmt_staging2.BUDNI_BRK_test_obs_summary_block where ods_record=1; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_BRK_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_brake_perf_parking_brake_test_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_brake_perf_service_brake_test_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_BRK' ,null,'ods', 'fn_BUDNI_BRK_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_BRK' ,null,'ods', 'fn_BUDNI_BRK_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_STG2.sql new file mode 100644 index 0000000..a530c62 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_BRK_STG2.sql @@ -0,0 +1,720 @@ +drop function if exists mmt_staging2.fn_BUDNI_BRK_Block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_BRK_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + declare __characteristic_1 text; + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + +/*********************************************************************************** +Function Name:fn_BUDNI_BRK_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format: BUDNI_BRK +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_BRK_Block(20,1,'BUDNI','BUDNI_BRK',273); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate table mmt_staging2.BUDNI_BRK_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int; +truncate table mmt_staging2.budni_brk_service_cold_ballasted_maximum_block; +truncate table mmt_staging2.budni_brk_service_cold_standard_25kmph_block; +truncate table mmt_staging2.budni_brk_service_cold_standard_maximum_block; +truncate table mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block; +truncate table mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block; +truncate table mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block; +truncate table mmt_staging2.BUDNI_BRK_other_observations_Block; +truncate table mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int; +truncate table mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block; +truncate table mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block; +truncate table mmt_staging2.stg_specific_table_BUDNI_BRK; +truncate table mmt_staging2.stg_process_table_BUDNI_BRK; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI*/ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_BRK +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +execute 'update mmt_staging2.stg_specific_table_BUDNI_BRK set column2 = TRIM (TRAILING FROM column2 )'; +execute 'update mmt_staging2.stg_specific_table_BUDNI_BRK set column2 = TRIM (LEADING FROM column2 )'; + + +execute 'update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified)'; +execute 'update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified)' ; +execute 'update mmt_ods.mmt_config set F1_source=F1_modified' ; +execute 'update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source)'; +execute 'update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source)' ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_BRK b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_BRK a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Brake Performance Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_BRK +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_BRK a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_BRK +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_BRK a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''1) Service Barke Testing'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_BRK +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_BRK a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''2) Parking Brake Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_BRK +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_BRK a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Brake Performance Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_BRK a +where rank_tag='BUDNI_BRK_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_BRK a +where rank_tag='BUDNI_BRK_Spec_H1' and rank=3; + + +/* blocks data loading start - BUDNI_BRK_Spec_H1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_Spec_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_BRK_Spec_H1_Block'; + +insert into mmt_staging2.BUDNI_BRK_Spec_H1_block +( +make,model,tractor_HP,rated_rpm,Type_of_brake , +Type_of_track,rank) +select column3,column4,column5,column6,column7,column8,rank +from mmt_staging2.stg_process_table_BUDNI_BRK where rank_tag='BUDNI_BRK_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_BRK_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_BRK_Spec_H1_block a +set brake_free_play_lh=column3,brake_free_play_rh=column4, +maximum_attainable_speed_kmph_unballasted=column5, +maximum_attainable_speed_kmph_ballasted=column6 +from mmt_staging2.stg_process_table_BUDNI_BRK b +where b.rank_tag='BUDNI_BRK_Spec_H1' +and b.rank=6 +and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_Spec_H1_block'); + +insert into mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +( +column3, +column4, +column5, +column6, +column7, +column8, +column9, +rank +) +select +column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_BRK a +where rank_tag ='BUDNI_BRK_Service_Barke_Test' +order by rank; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column2=(select column3 from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +where rank=1) where rank=3; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column3=(select column3 from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +where rank=2) where rank=3; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column3=(select column3 from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +where rank=3)where rank=10; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column5=(select column5 from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +where rank=18)where rank=17; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column3=(select column3 from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +where rank=17)where rank=22; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column3=null where rank =1; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +set column3=null where rank =2; + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int + set column5 =null where rank=18; + + +update mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int a +set column2= b.first_value from (SELECT + rank, column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column2, + sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.budni_brk_service_barke_test_int set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_BRK_Service_Barke_Test_int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* blocks data loading start - BUDNI_BRK_service_cold_standard_maximum_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_service_cold_standard_maximum_Block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_BRK_service_cold_standard_maximum_Block'; + +insert into mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block +( +dummy_f, +Braking_device_control_force_N, +Mean_deceleration_m_sec2, +Stopping_distance_m +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int where rank in (4,5,6) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text); + +update mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +update mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block a +set brake_test_type =column2, +brake_test_name =column3, +speed_condition =column5 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=3 and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block a +set ballast_condition =column3 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=4 and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_service_cold_standard_maximum_Block'); + + +/* blocks data loading start - BUDNI_BRK_service_cold_ballasted_maximum_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_service_cold_ballasted_maximum_Block',__file_format,__sheet_mnemonic,3); +v_block:='BUDNI_BRK_service_cold_ballasted_maximum_Block'; +insert into mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block +( +dummy_f, +Braking_device_control_force_N, +Mean_deceleration_m_sec2, +Stopping_distance_m +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int where rank in (7,8,9) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text); + + + +update mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +update mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block a +set brake_test_type =column2, +brake_test_name =column3, +speed_condition =column5 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=3 and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block a +set ballast_condition =column3 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=7 and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_service_cold_ballasted_maximum_Block'); + + +/* blocks data loading start - BUDNI_BRK_service_cold_standard_25kmph_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_service_cold_standard_25kmph_Block',__file_format,__sheet_mnemonic,4); +v_block:='BUDNI_BRK_service_cold_standard_25kmph_Block'; + +insert into mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block +( +dummy_f, +Braking_device_control_force_N, +Mean_deceleration_m_sec2, +Stopping_distance_m +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int where rank in (11,12,13) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text); + + + update mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block a +set brake_test_type =column2, +brake_test_name =column3, +speed_condition =column5 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=10 and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block a +set ballast_condition =column3 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=11 and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_service_cold_standard_25kmph_Block'); + + +/* blocks data loading start - BUDNI_BRK_service_cold_ballasted_25kmph_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_service_cold_ballasted_25kmph_Block',__file_format,__sheet_mnemonic,5); +v_block:='BUDNI_BRK_service_cold_ballasted_25kmph_Block'; + +insert into mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block +( +dummy_f, +Braking_device_control_force_N, +Mean_deceleration_m_sec2, +Stopping_distance_m +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int where rank in (14,15,16) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text); + +update mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block a +set brake_test_type =column2, +brake_test_name =column3, +speed_condition =column5 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=10 and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block a +set ballast_condition =column3 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=14 and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_service_cold_ballasted_25kmph_Block'); + + +/* blocks data loading start - BUDNI_BRK_service_fade_standard_maximum_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_service_fade_standard_maximum_Block',__file_format,__sheet_mnemonic,6); +v_block:='BUDNI_BRK_service_fade_standard_maximum_Block'; + + insert into mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block +( +dummy_f, +Braking_device_control_force_N, +Mean_deceleration_m_sec2, +Stopping_distance_m +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int where rank in (19,20,21) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text); + +update mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block a +set brake_test_type =column2, +brake_test_name =column3, +speed_condition =column5 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=17 and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block a +set ballast_condition =column3 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=19 and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_service_fade_standard_maximum_Block'); + + +/* blocks data loading start - BUDNI_BRK_service_fade_ballasted_25kmph_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_service_fade_ballasted_25kmph_Block',__file_format,__sheet_mnemonic,7); +v_block:='BUDNI_BRK_service_fade_ballasted_25kmph_Block'; + + insert into mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block +( +dummy_f, +Braking_device_control_force_N, +Mean_deceleration_m_sec2, +Stopping_distance_m +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int where rank in (23,24,25) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text); + +update mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block a +set brake_test_type =column2, +brake_test_name =column3, +speed_condition =column5 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=22 and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block a +set ballast_condition =column3 +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int b +where b.rank=23 and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_service_fade_ballasted_25kmph_Block'); + +/* blocks data loading start - BUDNI_BRK_other_observations_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_other_observations_Block',__file_format,__sheet_mnemonic,8); +v_block:='BUDNI_BRK_other_observations_Block'; + +insert into mmt_staging2.BUDNI_BRK_other_observations_Block +( +column3, +column5, +column7, +rank +) +select +column3, +column5, +column7, +rank +from mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +where rank in (26,27,28) order by rank; + +update mmt_staging2.BUDNI_BRK_other_observations_Block +set ods_record=0 where rank in (26,27); + +update mmt_staging2.BUDNI_BRK_other_observations_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_BRK_other_observations_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_other_observations_Block'); + + +insert into mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int +( +column3, +column5, +column6, +column7, +column8, +rank +) +select +column3,column5,column6,column7,column8,rank +from mmt_staging2.stg_process_table_BUDNI_BRK a +where rank_tag ='BUDNI_BRK_Parking_Brake_Test' +order by rank; + +update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int +set column6=column5 where rank=2; + +update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int +set column8=column7 where rank=2; + +update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int +set column6=column5 where rank=5; + +update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int +set column8=column7 where rank=5; + +update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* blocks data loading start -BUDNI_BRK_Parking_Barke_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_Parking_Barke_Test_Block',__file_format,__sheet_mnemonic,9); +v_block:='BUDNI_BRK_Parking_Barke_Test_Block'; +insert into mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block +( +dummy_f, +particulars, +facing, +Braking_device_control_force, +Efficacy_of_parking_brake +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int where rank <> 1 + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text); + +update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block set make=__make,model=__model; +delete from mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block where dummy_f is null; +execute 'update mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_Parking_Barke_Test_Block'); + +/* blocks data loading start - BUDNI_BRK_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_BRK_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,10); +v_block:='BUDNI_BRK_Test_Obs_Summary_Block'; + +insert into mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_BRK a +where rank_tag='BUDNI_BRK_Test_Obs_Summary' and rank <=7 +order by rank; + +select column3 into __characteristic_1 from mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block +where rank=3; + +update mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block set +column3=concat(__characteristic_1,'-',column3) where rank in (4,5); + + +update mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block +set ods_record=0 where +rank in(1,2,3); + + + +update mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_BRK_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_BRK_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_BRK_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_ODS.SQL new file mode 100644 index 0000000..18dec7a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_ODS.SQL @@ -0,0 +1,192 @@ +drop function if exists mmt_staging2.fn_BUDNI_DBP_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_DBP_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin +__file_syspk := p_file_syspk; +/************************************************************ +Function Name:fn_BUDNI_DBP_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_DBP +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_DBP_ODS() +***************************************************************/ +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_DBP'; +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_DBP'; +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_DBP'; +--delete from mmt_ods.budni_drawbar_perf_results where test_file_sheet_format='BUDNI_DBP'; + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +configuration, +Transmission_type, + Wheel_Drive_Type, + Steering_type, + hitch_height_mm, + Ballast_condition + ) + select + client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, + column3, + column4, + column7, + column8, + column9, + column11, + column13::int, + column14 + from mmt_staging2.BUDNI_DBP_Spec_H1_Block where ods_record =1 ; + + insert into mmt_ods.test_instance + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +type_of_road + ) + select + client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, + column3, + column4, + column15 + from mmt_staging2.BUDNI_DBP_Spec_H1_Block where ods_record =1 ; + +insert into mmt_ods.test_instance_engine_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +Rated_RPM, +engine_to_pto_ratio_540_pto + ) + select + client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, + column3, + column4, + column6::int, + column12 + from mmt_staging2.BUDNI_DBP_Spec_H1_Block where ods_record =1 ; + + +insert into mmt_ods.budni_drawbar_perf_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condtion, +gear_used, +travel_speed_km_per_hr, +drawbar_power_kw, +drawbar_pull_kn, +engine_speed_rpm, +wheel_slippage_pct , +fuel_consumption_kg_per_kwh, +fuel_consumption_ltr_per_hr , +specific_energy_kwh_per_ltr, +atmosp_conditions_temp_c, +atmosp_conditions_pressure_kpa, +atmosp_conditions_rh_pct, +temp_fuel_c, +temp_trans_oil_c, +temp_coolant_c, +temp_engine_oil_c +) +select +client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +column2,column3,column4::float,column5::float,column6::float,column7::float, +column8::float,column9::float,column10::float,column11::float,column12,column13, +column14,column15,column16,column17,column18 +from mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block where ods_record = 1; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_DBP_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_drawbar_perf_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_DBP' ,null,'ods', 'fn_BUDNI_DBP_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_DBP' ,null,'ods', 'fn_BUDNI_DBP_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_STG2.sql new file mode 100644 index 0000000..26f67c6 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_DBP_STG2.sql @@ -0,0 +1,267 @@ +drop function if exists mmt_staging2.fn_BUDNI_DBP_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_DBP_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + + +/*********************************************************************************** +Function Name:fn_BUDNI_DBP_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format: BUDNI_DBP +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_DBP_Block(20,1,'BUDNI','BUDNI_DBP',261); +************************************************************************************/ + + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.BUDNI_DBP_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block; +truncate table mmt_staging2.stg_specific_table_budni_dbp; +truncate table mmt_staging2.stg_process_table_budni_dbp; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_budni_dbp +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_budni_dbp set column3 = TRIM (TRAILING FROM column3 ); + +update mmt_staging2.stg_specific_table_budni_dbp set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_budni_dbp b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_budni_dbp a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Tractor Drawbar Performance Report.'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_budni_dbp +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_dbp a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_budni_dbp +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_dbp a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Drawbar Performance Report.'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_budni_dbp a +where rank_tag='BUDNI_DBP_Spec_H1' and rank=2; + +select column4 into __model from mmt_staging2.stg_process_table_budni_dbp a +where rank_tag='BUDNI_DBP_Spec_H1' and rank=2; + + +/* blocks data loading start - BUDNI_DBP_Spec_H1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_DBP_Spec_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_DBP_Spec_H1_Block'; + +insert into mmt_staging2.BUDNI_DBP_Spec_H1_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,column13, +column14,column15,rank +) +select +column2,column3,column4,column5,column6,column7,column8,column9,column10, +column11,column12,column13,column14,column15,rank +from mmt_staging2.stg_process_table_budni_dbp +where rank_tag='BUDNI_DBP_Spec_H1'; + + +update mmt_staging2.BUDNI_DBP_Spec_H1_Block +set ods_record=0 where rank in +(select distinct first_value(b.rank) +over (partition by b.column2 order by b.syspk) from mmt_staging2.BUDNI_DBP_Spec_H1_Block b); + + +execute 'update mmt_staging2.BUDNI_DBP_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_DBP_Spec_H1_Block'); + + +/* blocks data loading start - BUDNI_DBP_Spec_H1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_DBP_Drawbar_Perf_Block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_DBP_Drawbar_Perf_Block'; + +insert into mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,column13, +column14,column15,column16,column17,column18,column19,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,column13,column14, +column15,column16,column17,column18,column19,rank +from mmt_staging2.stg_process_table_budni_dbp a +where rank_tag='BUDNI_DBP_Drawbar_Perf' +order by rank; + + + +update mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +update mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block +set column2= column3 where column3 like 'i%'; + +update mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block +set column3=null +where column3 like 'i%'; + +update mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block a + set column2= b.first_value from (SELECT +rank, column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column2, +sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + + + +update mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block +set ods_record=0 where column4 is null or +rank in +(select distinct first_value(b.rank) +over (partition by b.column2 order by b.syspk) from mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block b); + +delete from mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block a +using mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block b +where a.column2 like 'iV%' and b.column2 like 'iV%' +and a.column2 =b.column2 and a.syspk>=b.syspk + 2; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_DBP_Drawbar_Perf_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_DBP_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_DBP_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_ODS.SQL new file mode 100644 index 0000000..c2b2552 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_ODS.SQL @@ -0,0 +1,397 @@ +drop function if exists mmt_staging2.fn_budni_fld_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_budni_fld_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + __file_syspk := p_file_syspk; +/************************************************************ +Function Name:fn_BUDNI_FLD_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_FLD +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_FLD_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_FLD'; +-- +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_FLD'; +-- +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_FLD'; +-- +--delete from mmt_ods.test_instance_implement_info where test_file_sheet_format='BUDNI_FLD'; +-- +--delete from mmt_ods.budni_field_perf_results where test_file_sheet_format='BUDNI_FLD'; +-- +--delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_FLD'; + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +ballast_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +FIP_type, +steering_type, +Ballast_Condition +from mmt_staging2.budni_fld_Spec_H1_block; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model +from + mmt_staging2.budni_fld_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int, +engine_to_pto_ratio engine_to_pto_ratio_540_pto +from mmt_staging2.budni_fld_Spec_H1_block; + +insert into mmt_ods.test_instance_implement_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +name_of_implement, +make_of_implement, +type_of_implement, +no_of_disc_blades_bottoms, +type_of_disc_blades_bottoms, +size_of_bottoms_blades_mm, +size_of_bottoms_blades2_mm, +size_of_bottoms_blades3_mm, +spacing_of_bottoms_flanges_mm, +span_for_mounted_implement_mm, +mast_height_for_mounted_implement_mm, +length_mm, +width_mm, +height_mm, +gross_mass_kg +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +items, +Make, +type, +No_of_Disc_blades, +Type_of_Disc_blades, +Size_of_bottoms_blades_1_mm::numeric, +Size_of_bottoms_blades_2_mm::numeric, +Size_of_bottoms_blades_3_mm::numeric, +Spacing_of_bottoms_flanges_mm::numeric, +Lower_hitch_point_span_mm::numeric, +Mast_height_mm, +Overall_dimensions_mm_length::numeric, +Overall_dimensions_mm_Width::numeric, +Overall_dimensions_mm_Height::numeric, +Gross_mass_kg::numeric +from mmt_staging2.BUDNI_FLD_Impl_Test_Block +order by rank; + + + +insert into mmt_ods.test_instance_implement_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +name_of_implement, +type_of_implement, +cage_wheel_dia_mm, +cage_wheel_width_mm, +no_and_types_of_lugs, +size_of_angle_section_mm, +size_of_angle_section2_mm, +size_of_angle_section3_mm, +length_of_lugs_mm, +spacing_of_lugs_mm, +cage_wheel_weight_kg +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +Items, +type, +Dia_mm::numeric, +Width_mm::numeric, +No_and_types_of_lugs, +Size_of_angle_section_1_mm::numeric, +Size_of_angle_section_2_mm::numeric, +Size_of_angle_section_3_mm::numeric, +Length_of_lugs_mm::numeric, +Spacing_of_lugs_mm::numeric, +Weight_of_each_cage_wheels_kg::numeric +from mmt_staging2.BUDNI_FLD_Cage_Wheel_Block +order by rank; + + + +insert into mmt_ods.budni_field_perf_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +operation_type, +type_of_soil, +avg_soil_moisture_pct_, +bulk_density_of_soil_g_per_cc, +cone_index_kgf_per_sq_cm, +gear_used, +avg_speed_of_operation_kmph, +avg_wheel_slip_pct, +avg_depth_of_cut_cm, +avg_working_width_cm, +area_covered_ha_per_hr, +fuel_consumption_ltr_per_hr, +fuel_consumption_ltr_per_ha, +avg_draft_of_implement_kn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +Parameter_operation, +Type_of_soil, +Av_soil_moisture_Av_depth_of_standing_water_cm, +Bulk_density_of_soil_g_cc, +Cone_index_kgf_sq_cm_Puddling_index, +Gear_used, +Av_speed_of_operation_kmph, +Av_wheel_slip_Av_Travel_reduction, +Av_depth_of_cut_cm_Av_Depth_of_puddle_cm, +Av_working_width_cm, +Area_covered_ha_h, +Fuel_consumption_l_h, +Fuel_consumption_l_ha, +Av_draft_of_implement_kN +from mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block where parameter_operation <> 'Puddling'; + +insert into mmt_ods.budni_field_perf_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +operation_type, +type_of_soil, +avg_depth_of_standing_water_cm , +bulk_density_of_soil_g_per_cc, +puddling_index_pct, +gear_used, +avg_speed_of_operation_kmph, +avg_travel_reduction_pct, +avg_depth_of_puddle_cm, +avg_working_width_cm, +area_covered_ha_per_hr, +fuel_consumption_ltr_per_hr, +fuel_consumption_ltr_per_ha, +avg_draft_of_implement_kn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +Parameter_operation, +Type_of_soil, +Av_soil_moisture_Av_depth_of_standing_water_cm, +Bulk_density_of_soil_g_cc, +Cone_index_kgf_sq_cm_Puddling_index, +Gear_used, +Av_speed_of_operation_kmph, +Av_wheel_slip_Av_Travel_reduction, +Av_depth_of_cut_cm_Av_Depth_of_puddle_cm, +Av_working_width_cm, +Area_covered_ha_h, +Fuel_consumption_l_h, +Fuel_consumption_l_ha, +Av_draft_of_implement_kN +from mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block where parameter_operation ='Puddling'; + + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3, +column4, +column5, +column6, +column7, +column8, +column9 +from mmt_staging2.budni_fld_test_obs_summary_block where ods_record=1; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_FLD_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_implement_info +set test_instance_id=__test_instance_id +--tractor_model =__model, +--tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_field_perf_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_FLD' ,null,'ods', 'fn_BUDNI_FLD_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_FLD' ,null,'ods', 'fn_BUDNI_FLD_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_STG2.sql new file mode 100644 index 0000000..6ff9891 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_FLD_STG2.sql @@ -0,0 +1,594 @@ +drop function if exists mmt_staging2.fn_BUDNI_FLD_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_FLD_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + +/*********************************************************************************** +Function Name:fn_BUDNI_FLD_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format: BUDNI_FLD +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_FLD_Block(20,1,'BUDNI','BUDNI_FLD',261) +************************************************************************************/ + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ + +truncate table mmt_staging2.BUDNI_FLD_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_FLD_Impl_Test_Int; +truncate table mmt_staging2.BUDNI_FLD_Impl_Test_Block; +truncate table mmt_staging2.BUDNI_FLD_Cage_Wheel_Block; +truncate table mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int; +truncate table mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block; +truncate table mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block; +truncate table mmt_staging2.stg_specific_table_BUDNI_FLD; +truncate table mmt_staging2.stg_process_table_BUDNI_FLD; + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_FLD +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_BUDNI_FLD set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_BUDNI_FLD set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_FLD b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_FLD a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Field Performance Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_FLD +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_FLD a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_FLD +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_FLD a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''BRIEF SPECIFICATION OF IMPLEMENTS USED DURING FIELD TEST'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_FLD +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_FLD a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''SUMMARY OF FIELD PERFORMANCE TEST'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_FLD +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_FLD a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Field Performance Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_FLD a +where rank_tag='BUDNI_FLD_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_FLD a +where rank_tag='BUDNI_FLD_Spec_H1' and rank=3; + +/* blocks data loading start - BUDNI_FLD_Spec_H1_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_FLD_Spec_H1_block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_FLD_Spec_H1_block'; + +insert into mmt_staging2.BUDNI_FLD_Spec_H1_block +( +make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,rank) +select column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_FLD where rank_tag='BUDNI_FLD_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_FLD_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_FLD_Spec_H1_block a +set FIP_type=column3,steering_type=column4,Engine_to_PTO_ratio= column5,Ballast_Condition=column6, +Test_Engine_Set_RPM=column7 +from mmt_staging2.stg_process_table_BUDNI_FLD b +where b.rank_tag='BUDNI_FLD_Spec_H1' +and b.rank=5 +and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_FLD_Spec_H1_block'); + + +insert into mmt_staging2.BUDNI_FLD_Impl_Test_Int +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_FLD a +where rank_tag ='BUDNI_FLD_Impl_Test' and rank <> 1 +order by rank; + + +update mmt_staging2.BUDNI_FLD_Impl_Test_Int a +set column3= b.first_value from (SELECT + rank, column3, value_partition, first_value(column3) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column3, + sum(case when column3 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank and a.rank <> 13 ; + +update mmt_staging2.BUDNI_FLD_Impl_Test_Int a +set column4= b.first_value from (SELECT + rank, column4, value_partition, first_value(column4) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column4, + sum(case when column4 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank and a.rank <> 13 ; + + +update mmt_staging2.BUDNI_FLD_Impl_Test_Int a +set column5= b.first_value from (SELECT + rank, column5, value_partition, first_value(column5) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column5, + sum(case when column5 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank and a.rank <> 13 ; + + +update mmt_staging2.BUDNI_FLD_Impl_Test_Int a +set column6= b.first_value from (SELECT + rank, column6, value_partition, first_value(column6) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column6, + sum(case when column6 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank and a.rank <> 13; + + + +update mmt_staging2.BUDNI_FLD_Impl_Test_Int a +set column7= b.first_value from (SELECT + rank, column7, value_partition, first_value(column7) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column7, + sum(case when column7 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + +update mmt_staging2.BUDNI_FLD_Impl_Test_Int a +set column8= b.first_value from (SELECT + rank, column8, value_partition, first_value(column8) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column8, + sum(case when column8 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + + +execute 'update mmt_staging2.BUDNI_FLD_Impl_Test_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* blocks data loading - BUDNI_FLD_Impl_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_FLD_Impl_Test_Block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_FLD_Impl_Test_Block'; + +insert into mmt_staging2.BUDNI_FLD_Impl_Test_Block +( +dummy_f, +items, +Make, +type, +No_of_Disc_blades, +Type_of_Disc_blades, +Size_of_bottoms_blades_1_mm, +Size_of_bottoms_blades_2_mm, +Size_of_bottoms_blades_3_mm, +Spacing_of_bottoms_flanges_mm, +Lower_hitch_point_span_mm, +Mast_height_mm, +Overall_dimensions_mm, +Overall_dimensions_mm_length, +Overall_dimensions_mm_Width, +Overall_dimensions_mm_Height, +Gross_mass_kg +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text]) AS val + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int where ods_record=1 + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text); + + + delete from mmt_staging2.BUDNI_FLD_Impl_Test_Block where dummy_f is null; + +execute 'update mmt_staging2.BUDNI_FLD_Impl_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_FLD_Impl_Test_Block'); + + +/* blocks data loading - BUDNI_FLD_Cage_Wheel_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_FLD_Cage_Wheel_Block',__file_format,__sheet_mnemonic,3); +v_block:='BUDNI_FLD_Cage_Wheel_Block'; + + insert into mmt_staging2.BUDNI_FLD_Cage_Wheel_Block +( +dummy_f, +Items, +type, +Dia_mm, +Width_mm, +No_and_types_of_lugs, +Size_of_angle_section_1_mm, +Size_of_angle_section_2_mm, +Size_of_angle_section_3_mm, +Length_of_lugs_mm, +Spacing_of_lugs_mm, +Weight_of_each_cage_wheels_kg +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column9}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column9::text]) AS val + FROM mmt_staging2.BUDNI_FLD_Impl_Test_Int where ods_record=1 + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text, + a_10 text,a_11 text); + + delete from mmt_staging2.BUDNI_FLD_Cage_Wheel_Block where dummy_f is null; + + +execute 'update mmt_staging2.BUDNI_FLD_Cage_Wheel_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_FLD_Cage_Wheel_Block'); + + + +insert into mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int +( +column3,column4,column5,column6,column7,rank +) +select +column3,column4,column5,column6,column7,rank +from mmt_staging2.stg_process_table_BUDNI_FLD a +where rank_tag ='BUDNI_FLD_Sum_Perf_Test' and rank <> 1 +order by rank,column3 ; + +update mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +/* blocks data loading - BUDNI_FLD_Sum_Perf_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_FLD_Sum_Perf_Test_Block',__file_format,__sheet_mnemonic,4); +v_block:='BUDNI_FLD_Sum_Perf_Test_Block'; + + insert into mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block +( +dummy_f, +Parameter_operation, +Type_of_soil, +Av_soil_moisture_Av_depth_of_standing_water_cm, +Bulk_density_of_soil_g_cc, +Cone_index_kgf_sq_cm_Puddling_index, +Gear_used, +Av_speed_of_operation_kmph, +Av_wheel_slip_Av_Travel_reduction, +Av_depth_of_cut_cm_Av_Depth_of_puddle_cm, +Av_working_width_cm, +Area_covered_ha_h, +Fuel_consumption, +Fuel_consumption_l_h, +Fuel_consumption_l_ha, +Av_draft_of_implement_kN +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int where ods_record=1 + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + + + +delete from mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block where dummy_f is null; + +update mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_FLD_Sum_Perf_Test_Block'); + + + +/* blocks data loading - BUDNI_FLD_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_FLD_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,5); +v_block:='BUDNI_FLD_Test_Obs_Summary_Block'; + +insert into mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_FLD a +where rank_tag='BUDNI_FLD_Test_Obs_Summary' and rank <=6; + + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block +set ods_record=0 +where rank in (1,2); + + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block a +set column4= b.first_value from (SELECT + rank, column4, value_partition, first_value(column4) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column4, + sum(case when column4 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block a +set column5= b.first_value from (SELECT + rank, column5, value_partition, first_value(column5) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column5, + sum(case when column5 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block a +set column6= b.first_value from (SELECT + rank, column6, value_partition, first_value(column6) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column6, + sum(case when column6 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block a +set column7= b.first_value from (SELECT + rank, column7, value_partition, first_value(column7) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column7, + sum(case when column7 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block a +set column8= b.first_value from (SELECT + rank, column8, value_partition, first_value(column8) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column8, + sum(case when column8 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block a +set column9= b.first_value from (SELECT + rank, column9, value_partition, first_value(column9) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column9, + sum(case when column9 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + + +update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_FLD_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_FLD_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_FLD_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_ODS.SQL new file mode 100644 index 0000000..e62fd5a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_ODS.SQL @@ -0,0 +1,368 @@ +drop function if exists mmt_staging2.fn_BUDNI_HDL_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_HDL_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin +__file_syspk := p_file_syspk; +/************************************************************ +Function Name:fn_BUDNI_HDL_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_HDL +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_HDL_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.test_instance_engine_info +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.test_instance_tractor_info +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.test_instance_tractor_info_misc +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.budni_hydraulic_maint_of_lift_load_results +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.budni_hydraulic_power_test_results +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.budni_hydraulic_lifting_capacity_test_results +--where test_file_sheet_format='BUDNI_HDL'; +-- +--delete from mmt_ods.budni_test_observations +--where test_file_sheet_format='BUDNI_HDL'; + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +steering_type +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int, +steering_type +from mmt_staging2.BUDNI_HDL_Spec_H1_block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model +from + mmt_staging2.BUDNI_HDL_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +rated_rpm::int +from mmt_staging2.BUDNI_HDL_Spec_H1_block; + +insert into mmt_ods.test_instance_tractor_info_misc + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +hydraulic_type, +pump_speed_at_rated_engine_speed_rpm, +oil, +lift_rod_type_lh, +lift_rod_type_rh, +lift_rod_length_lh, +lift_rod_length_rh, +lower_link_length_lh, +lower_link_length_rh, +pump_hp +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +hydraulic_type, +Pump_speed_at_rated_engine_speed_rpm::numeric, +Oil, +Lift_Rod_type_LH, +Lift_Rod_type_RH, +Lift_Rod_Length_LH::numeric, +Lift_Rod_Length_RH::numeric, +Lower_link_Length_LH::numeric, +Lower_link_Length_RH::numeric, +Pump_HP::numeric +from mmt_staging2.BUDNI_HDL_Spec_H1_block; + + +/*block */ + +insert into mmt_ods.budni_hydraulic_power_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +pump_dlvry_rate_at_min_pressure_engine_speed_l_per_min, +max_hydraulic_power_kw, +pump_dlvry_rate_at_max_hydraulic_power_lmin, +pressure_at_max_hydraulic_power_mpa, +sustained_pressure_of_the_open_relief_valve_mpa, +tapping_point_relief_valve_test, +tapping_point_pump_perf_test, +tapping_point_temperature_of_hydraulic_fluid_c +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +Pump_delivery_rate_at_minimum_pressure_and_rated_engine_speed_l_min::numeric, +Maximum_hydraulic_power_kW::numeric, + Pump_delivery_rate_at_maximum_hydraulic_power_l_min::numeric, + Pressure_at_maximum_hydraulic_power_MPa::numeric, + Sustained_pressure_of_the_open_relief_valve_MPa::numeric, +tapping_point_relief_valve_test, +tapping_point_Pump_performance_test, +tapping_point_Temperature_of_hydraulic_fluid_C +from mmt_staging2.budni_hdl_power_test_block where ods_record=1 +order by rank; + + +insert into mmt_ods.budni_hydraulic_maint_of_lift_load_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +force_applied_at_the_frame_kn, +temp_of_hydraulic_fluid_at_the_start_of_test_c, +elapsed_time_min, +cumulative_drop_in_height_of_lift_mm +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +Force_applied_at_the_frame_kN::numeric, +Temperature_of_hydraulic_fluid_at_the_start_of_test_C, +Elapsed_time_minute::numeric, +Cumulative_drop_in_height_of_lift_mm::numeric +from mmt_staging2.budni_hdl_maintenance_of_lift_load_block; + +/*block */ +insert into mmt_ods.budni_hydraulic_lifting_capacity_test_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +test_condition, +height_of_lower_hitch_pt_above_ground_in_down_position_mm, +vertical_move_ment_with_lifting_forces_mm, +max_force_exerted_through_full_range_kn, +corresponding_pressure_mpa, +moment_about_rear_axle_kn_m, +max_tilt_angle_of_mast_from_vertical_degrees +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +column5, +column6::numeric, +column7::numeric, +column8::numeric, +column9::numeric, +column10::numeric, +column11::numeric +from mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block +where ods_record=1; + + +/* block */ + + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3,column4,column7,column8,column10,column11,column12 +from mmt_staging2.budni_hdl_test_obs_summary_block +where ods_record=1 +; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_FLD_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info_misc +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_hydraulic_maint_of_lift_load_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_hydraulic_power_test_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_hydraulic_lifting_capacity_test_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_HDL' ,null,'ods', 'fn_BUDNI_HDL_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_HDL' ,null,'ods', 'fn_BUDNI_HDL_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_STG2.sql new file mode 100644 index 0000000..114f4c4 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HDL_STG2.sql @@ -0,0 +1,554 @@ +drop function if exists mmt_staging2.fn_budni_hdl_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_budni_hdl_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + declare __characteristic_A text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + +/*********************************************************************************** +Function Name:fn_budni_hdl_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format: BUDNI_HDL +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_FLD_Block(20,1,'BUDNI','BUDNI_FLD',261); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_budni_hdl; +truncate table mmt_staging2.stg_process_table_budni_hdl; +truncate table mmt_staging2.budni_hdl_Spec_H1_Block; +truncate table mmt_staging2.budni_hdl_power_test_Block; +truncate table mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block; +truncate table mmt_staging2.budni_hdl_Maintenance_of_lift_load_int; +truncate table mmt_staging2.budni_hdl_Maintenance_of_lift_load_Block; +truncate table mmt_staging2.budni_hdl_Test_Obs_Summary_Block; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_budni_hdl +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_budni_hdl set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_budni_hdl set column3 = TRIM (LEADING FROM column3 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_budni_hdl b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_budni_hdl a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Power Lift and Hydraulic Pump Performance Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_budni_hdl +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_hdl a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_budni_hdl +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_hdl a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''A) Hydraulic power test:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_budni_hdl +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_hdl a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tapping Point'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_budni_hdl +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_hdl a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''C) Maintenance of lift load:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_budni_hdl +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_hdl a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Power Lift and Hydraulic Pump Performance Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_budni_hdl a +where rank_tag='BUDNI_HDL_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_budni_hdl a +where rank_tag='BUDNI_HDL_Spec_H1' and rank=3; + + + +/* blocks data loading start - budni_hdl_Spec_H1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_HDL_Spec_H1_block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_HDL_Spec_H1_block'; +insert into mmt_staging2.budni_hdl_Spec_H1_Block +( +make, +model, +tractor_HP, +rated_rpm, +hydraulic_type, +Pump_speed_at_rated_engine_speed_rpm, +Steering_Type, +Oil,rank +) +select +column3,column4,column5,column6,column7,column8,column9,column10,rank +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag='BUDNI_HDL_Spec_H1' and rank=3; + + +execute 'update mmt_staging2.budni_hdl_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +update mmt_staging2.BUDNI_HDL_Spec_H1_block a +set Lift_Rod_type_LH =column3, +Lift_Rod_type_RH= column4, +Lift_Rod_Length_LH=column5, +Lift_Rod_Length_RH=column6, +Lower_link_Length_LH=column7, +Lower_link_Length_RH=column8, +Pump_HP=column9 +from mmt_staging2.stg_process_table_budni_hdl b +where b.rank_tag='BUDNI_HDL_Spec_H1' +and b.rank=6 +and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_HDL_Spec_H1_block'); + + +/* blocks data loading - budni_hdl_power_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'budni_hdl_power_test_block',__file_format,__sheet_mnemonic,2); +v_block:='budni_hdl_power_test_block'; +insert into mmt_staging2.budni_hdl_power_test_block (dummy_f) values('dummy'); + +update mmt_staging2.budni_hdl_power_test_block +set Pump_delivery_rate_at_minimum_pressure_and_rated_engine_speed_l_min= (select column3 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Power_Test' and rank=3) +where dummy_f='dummy'; + + +update mmt_staging2.budni_hdl_power_test_block +set Maximum_hydraulic_power_kW= (select column5 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Power_Test' and rank=3) +where dummy_f='dummy'; + + +update mmt_staging2.budni_hdl_power_test_block +set Pump_delivery_rate_at_maximum_hydraulic_power_l_min= (select column7 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Power_Test' and rank=3) +where dummy_f='dummy'; + + +update mmt_staging2.budni_hdl_power_test_block +set Pressure_at_maximum_hydraulic_power_MPa= (select column9 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Power_Test' and rank=3) +where dummy_f='dummy'; + + +update mmt_staging2.budni_hdl_power_test_block +set Sustained_pressure_of_the_open_relief_valve_MPa= (select column11 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Power_Test' and rank=3) +where dummy_f='dummy'; + + + +update mmt_staging2.budni_hdl_power_test_block +set tapping_point_relief_valve_test = (select column4 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Lifting_Capacity_Test' and rank=2) +where dummy_f='dummy'; + + +update mmt_staging2.budni_hdl_power_test_block +set tapping_point_Pump_performance_test= (select column4 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Lifting_Capacity_Test' and rank=3) +where dummy_f='dummy'; + + +update mmt_staging2.budni_hdl_power_test_block +set tapping_point_Temperature_of_hydraulic_fluid_C= (select column4 +from mmt_staging2.stg_process_table_budni_hdl +where rank_tag ='BUDNI_HDL_Lifting_Capacity_Test' and rank=4) +where dummy_f='dummy'; + + +update mmt_staging2.BUDNI_HDL_Power_Test_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_HDL_Power_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_HDL_Power_Test_Block +set ods_record=0 where +rank in (1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_HDL_Power_Test_Block'); + +/* blocks data loading - budni_hdl_Lifting_Capacity_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'budni_hdl_Lifting_Capacity_Test_Block',__file_format,__sheet_mnemonic,3); +v_block:='budni_hdl_Lifting_Capacity_Test_Block'; +insert into mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block +( +column5,column6,column7, +column8,column9,column10,column11,rank +) +select +column5,column6,column7, +column8,column9,column10,column11,rank +from mmt_staging2.stg_process_table_budni_hdl a +where rank_tag='BUDNI_HDL_Lifting_Capacity_Test'; + + +update mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block set make=__make,model=__model; +execute 'update mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block +set ods_record=0 where +rank in (1,2); + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'budni_hdl_Lifting_Capacity_Test_Block'); + + + +insert into mmt_staging2.budni_hdl_Maintenance_of_lift_load_int +( +column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_budni_hdl a +where rank_tag='BUDNI_HDL_Maintenance_Of_Lift_Load'; + +update mmt_staging2.budni_hdl_Maintenance_of_lift_load_int +set ods_record=0 where +rank=1; + + + +/* blocks data loading - PTOBST_RPT_PTO_performance_report_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'budni_hdl_Maintenance_of_lift_load_Block',__file_format,__sheet_mnemonic,4); +v_block:='budni_hdl_Maintenance_of_lift_load_Block'; +insert into mmt_staging2.budni_hdl_Maintenance_of_lift_load_Block +( +dummy_f, +Elapsed_time_minute, +Cumulative_drop_in_height_of_lift_mm +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column7,column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column7::text,column8::text,column9::text, +column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.budni_hdl_Maintenance_of_lift_load_int where rank in (2,3) + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text); + + + +update mmt_staging2.budni_hdl_Maintenance_of_lift_load_block +set Force_applied_at_the_frame_kN =(select column5 +from mmt_staging2.budni_hdl_Maintenance_of_lift_load_int +where column3 ='Force applied at the frame, (kN)') +where Force_applied_at_the_frame_kN is null; + +update mmt_staging2.budni_hdl_Maintenance_of_lift_load_block +set Temperature_of_hydraulic_fluid_at_the_start_of_test_C =(select column5 +from mmt_staging2.budni_hdl_Maintenance_of_lift_load_int +where column3 ='Temperature of hydraulic fluid at the start of test, (⁰C)') +where Temperature_of_hydraulic_fluid_at_the_start_of_test_C is null; + + +delete from mmt_staging2.budni_hdl_Maintenance_of_lift_load_block where dummy_f is null; +update mmt_staging2.budni_hdl_Maintenance_of_lift_load_block set make=__make,model=__model; +execute 'update mmt_staging2.budni_hdl_Maintenance_of_lift_load_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'budni_hdl_Maintenance_of_lift_load_block'); + + +/* blocks data loading - budni_hdl_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'budni_hdl_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,5); +v_block:='budni_hdl_Test_Obs_Summary_Block'; + +insert into mmt_staging2.budni_hdl_Test_Obs_Summary_Block +( +column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_budni_hdl a +where rank_tag='BUDNI_HDL_Test_Obs_Summary' and rank not in (8,9); + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column3= b.first_value from (SELECT +rank, column3, value_partition, first_value(column3) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column3, +sum(case when column3 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column4= b.first_value from (SELECT +rank, column4, value_partition, first_value(column4) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column4, +sum(case when column4 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column5= b.first_value from (SELECT +rank, column5, value_partition, first_value(column5) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column5, +sum(case when column5 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column7= b.first_value from (SELECT +rank, column7, value_partition, first_value(column7) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column7, +sum(case when column7 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column8= b.first_value from (SELECT +rank, column8, value_partition, first_value(column8) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column8, +sum(case when column8 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column11= b.first_value from (SELECT +rank, column11, value_partition, first_value(column11) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column11, +sum(case when column11 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block a + set column12= b.first_value from (SELECT +rank, column12, value_partition, first_value(column12) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +column12, +sum(case when column12 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.budni_hdl_Test_Obs_Summary_Block +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + + +select column4 into __characteristic_A +from mmt_staging2.budni_hdl_Test_Obs_Summary_Block where rank=3; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block +set column4=concat(column4,'. ',__characteristic_A,' -',column5) where ods_record =1; + + + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.budni_hdl_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.budni_hdl_Test_Obs_Summary_Block +set ods_record=0 where +rank in (1,2,3); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'budni_hdl_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_HDL_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_HDL_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_ODS.SQL new file mode 100644 index 0000000..2c646ea --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_ODS.SQL @@ -0,0 +1,253 @@ +drop function if exists mmt_staging2.fn_budni_hlg_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_budni_hlg_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_BUDNI_HLG_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_HLG +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_HLG_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_HLG'; +-- +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_HLG'; +-- +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_HLG'; +-- +--delete from mmt_ods.budni_haulage_perf_results where test_file_sheet_format='BUDNI_HLG'; +-- +--delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_HLG'; + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +ballast_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +FIP_type, +steering_type, +Ballast_Condition +from mmt_staging2.budni_hlg_Spec_H1_block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +type_of_road +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +type_of_track +from + mmt_staging2.budni_hlg_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int, +engine_to_pto_ratio engine_to_pto_ratio_540_pto +from mmt_staging2.budni_hlg_Spec_H1_block; + + +/*block */ + +insert into mmt_ods.budni_haulage_perf_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +trailer_type, +gross_mass_of_trailer_tonne, +height_of_trailer_hitch_above_ground_level_mm, +gear_used_negotiating_slopes_up_to_8pct, +avg_travel_speed_kmph, +avg_fuel_consumption_ltr_per_hr, +avg_fuel_consumption_ml_per_km_per_tonne, +avg_dist_traveled_per_litre_of_fuel_consumption_km, +effectiveness_of_brakes, +maneuverability_of_tractor_trailer_combination +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +type_of_trailer, +Gross_mass_of_trailer_tonne::numeric, +Height_of_trailer_hitch_above_ground_level_mm::numeric, +Gear_used_during_the_test_for_negotiating_slopes_up_to_8, +Average_travel_speed_kmph, +l_h, +ml_km_tonne, +Average_distance_traveled_per_litre_of_fuel_consumption_km, +Effectiveness_of_brakes, +Maneuverability_of_tractor_trailer_combination +from mmt_staging2.BUDNI_HLG_Perf_Test_block where ods_record=1 +order by rank; + + + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +sequence_number , +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::numeric , +column4, +column5, +column6, +column7, +column8, +column9 +from mmt_staging2.budni_hlg_test_obs_summary_block where ods_record=1; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_FLD_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + + +update mmt_ods.budni_haulage_perf_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_HLG' ,null,'ods', 'fn_BUDNI_HLG_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_HLG' ,null,'ods', 'fn_BUDNI_HLG_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_STG2.sql new file mode 100644 index 0000000..7990980 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_HLG_STG2.sql @@ -0,0 +1,443 @@ +drop function if exists mmt_staging2.fn_BUDNI_HLG_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_HLG_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + declare __characteristic_1 text; + declare __characteristic_2 text; + declare __characteristic_3 text; + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + + +/*********************************************************************************** +Function Name:fn_BUDNI_HLG_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format: BUDNI_HLG +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_HLG_Block(20,1,'BUDNI','BUDNI_HLG',261); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.BUDNI_HLG_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_HLG_Perf_Test_int; +truncate table mmt_staging2.BUDNI_HLG_Perf_Test_block; +truncate table mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block; +truncate table mmt_staging2.stg_specific_table_BUDNI_HLG; +truncate table mmt_staging2.stg_process_table_BUDNI_HLG; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_HLG +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_BUDNI_HLG set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_BUDNI_HLG set column3 = TRIM (LEADING FROM column3 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_HLG b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_staging2.stg_specific_table_BUDNI_HLG a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_HLG b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_staging2.stg_specific_table_BUDNI_HLG a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Haulage Performance Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_HLG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_HLG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_HLG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_HLG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Haulage performance Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_HLG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_HLG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Haulage Performance Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_HLG a +where rank_tag='BUDNI_HLG_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_HLG a +where rank_tag='BUDNI_HLG_Spec_H1' and rank=3; + + +/* blocks data loading start - BUDNI_HLG_Spec_H1_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_HLG_Spec_H1_block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_HLG_Spec_H1_block'; +insert into mmt_staging2.BUDNI_HLG_Spec_H1_block +( +make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,rank) +select column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_HLG where rank_tag='BUDNI_HLG_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_HLG_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_HLG_Spec_H1_block a +set FIP_type=column3,steering_type=column4,Engine_to_PTO_ratio= column5,Ballast_Condition=column6, +Test_Engine_Set_RPM=column7,Type_of_track=column8 +from mmt_staging2.stg_process_table_BUDNI_HLG b +where b.rank_tag='BUDNI_HLG_Spec_H1' +and b.rank=5 +and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_HLG_Spec_H1_Block +set ods_record=0 where rank in(1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_HLG_Spec_H1_Block'); + +insert into mmt_staging2.BUDNI_HLG_Perf_Test_int +( +column3,column6,column8,rank +) +select +column3,column6,column8,rank +from mmt_staging2.stg_process_table_BUDNI_HLG a +where rank_tag ='BUDNI_HLG_Perf_Test' +order by rank,column3; + +update mmt_staging2.BUDNI_HLG_Perf_Test_int set ods_record=0 where rank =1; + +update mmt_staging2.BUDNI_HLG_Perf_Test_int set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_HLG_Perf_Test_int set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* blocks data loading - BUDNI_HLG_perf_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_HLG_perf_test_block',__file_format,__sheet_mnemonic,2); + +v_block:='BUDNI_HLG_perf_test_block'; + +insert into mmt_staging2.BUDNI_HLG_perf_test_block +( +dummy_f, +type_of_trailer, +Gross_mass_of_trailer_tonne, +Height_of_trailer_hitch_above_ground_level_mm, +Gear_used_during_the_test_for_negotiating_slopes_up_to_8, +Average_travel_speed_kmph, +Average_fuel_consumption, +l_h, +ml_km_tonne, +Average_distance_traveled_per_litre_of_fuel_consumption_km, +General_observations, +Effectiveness_of_brakes, +Maneuverability_of_tractor_trailer_combination +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column6,column8}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column6::text,column8::text]) AS val + FROM mmt_staging2.BUDNI_HLG_Perf_Test_int where ods_record=1 + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text); + +delete from mmt_staging2.BUDNI_HLG_Perf_Test_block where dummy_f is null; +update mmt_staging2.BUDNI_HLG_Perf_Test_block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_HLG_Perf_Test_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_HLG_Perf_Test_block'); + + +/* blocks data loading -BUDNI_HLG_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_HLG_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,3); + +v_block:='BUDNI_HLG_Test_Obs_Summary_Block'; + +insert into mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_HLG a +where rank_tag='BUDNI_HLG_Test_Obs_Summary' and rank <=11 +order by rank; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block a +set column3= b.first_value from (SELECT + rank, column3, value_partition, first_value(column3) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column3, + sum(case when column3 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block a +set column5= b.first_value from (SELECT + rank, column5, value_partition, first_value(column5) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column5, + sum(case when column5 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + + +--update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block a +--set column7= b.first_value from (SELECT +-- rank, column7, value_partition, first_value(column7) over (partition by value_partition order by rank) +--FROM ( +-- SELECT +-- rank, +-- column7, +-- sum(case when column7 is null then 0 else 1 end) over (order by rank) as value_partition +-- FROM mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +-- ORDER BY rank ASC +--) as q) b where a.rank = b.rank ; +-- +-- +--update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block a +--set column8= b.first_value from (SELECT +-- rank, column8, value_partition, first_value(column8) over (partition by value_partition order by rank) +--FROM ( +-- SELECT +-- rank, +-- column8, +-- sum(case when column8 is null then 0 else 1 end) over (order by rank) as value_partition +-- FROM mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +-- ORDER BY rank ASC +--) as q) b where a.rank = b.rank ; + + +--update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block a +--set column9= b.first_value from (SELECT +-- rank, column9, value_partition, first_value(column9) over (partition by value_partition order by rank) +--FROM ( +-- SELECT +-- rank, +-- column9, +-- sum(case when column9 is null then 0 else 1 end) over (order by rank) as value_partition +-- FROM mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +-- ORDER BY rank ASC +--) as q) b where a.rank = b.rank ; + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set ods_record=0 where +rank in +(select distinct first_value(b.rank) +over (partition by b.column3 order by b.syspk) from mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block b); + + + +select column4 into __characteristic_1 from mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +where rank=3; + + +select column4 into __characteristic_2 from mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +where rank=6; + + +select column4 into __characteristic_3 from mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +where rank=9; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set column4=concat(__characteristic_1,'-',column4) where rank=4; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set column4=concat(__characteristic_1,'-',column4) where rank=5; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set column4=concat(__characteristic_2,'-',column4) where rank=7; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set column4=concat(__characteristic_2,'-',column4) where rank=8; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set column4=concat(__characteristic_3,'-',column4) where rank=10; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +set column4=concat(__characteristic_3,'-',column4) where rank=11; + + +update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_HLG_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_HLG_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_HLG_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_ODS.SQL new file mode 100644 index 0000000..198ce8f --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_ODS.SQL @@ -0,0 +1,199 @@ +drop function if exists mmt_staging2.fn_BUDNI_LCG_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_LCG_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_BUDNI_LCG_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_LCG +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_LCG_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_LCG'; +-- +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_LCG'; +-- +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_LCG'; +-- +--delete from mmt_ods.budni_centre_of_gravity_location where test_file_ref_no =BUDNI_LCG; + + + + insert into mmt_ods.test_instance_tractor_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +wheel_base_mm, +wheel_track_mm, +overall_height_mm, +ballast_condition, +weight_reactions_front_kg, +weight_reactions_rear_kg + ) + select + client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, +make, +model, +Tractor_HP::int tractor_engine_hp, +configuration, +Transmission_type, +Wheel_Drive_type, +Wheel_Base::int wheel_base_mm, +wheel_track::int wheel_track_mm, +overall_height::int, +Ballast_Condition, +Tractor_Weight_reactions_Front::int weight_reactions_front_kg , +Tractor_Weight_reactions_Rear::int weight_reactions_rear_kg +from mmt_staging2.BUDNI_LCG_Spec_H1_Block where ods_record =1 ; + + insert into mmt_ods.test_instance + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model + ) + select + client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, +make, +model + from mmt_staging2.BUDNI_LCG_Spec_H1_Block where ods_record =1 ; + +insert into mmt_ods.test_instance_engine_info + ( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +Rated_RPM +) + select + client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, +make, +model, +rated_rpm::int +from mmt_staging2.BUDNI_LCG_Spec_H1_Block where ods_record =1 ; + + +insert into mmt_ods.budni_centre_of_gravity_location +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +condition, +particulars, +coordinates +) +select +client_id, +function_id, +file_syspk , +file_format, +sheet_mnemonic, +make, +model, +column3, +column6, +column8 +from mmt_staging2.budni_lcg_gravity_test_block where ods_record=1; + + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_LCG_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_centre_of_gravity_location +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_LCG' ,null,'ods', 'fn_BUDNI_LCG_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_LCG' ,null,'ods', 'fn_BUDNI_LCG_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_STG2.sql new file mode 100644 index 0000000..a5e2c85 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_LCG_STG2.sql @@ -0,0 +1,248 @@ +drop function if exists mmt_staging2.fn_BUDNI_LCG_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_LCG_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/*********************************************************************************** +Function Name:fn_BUDNI_LCG_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format:BUDNI_LCG +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_LCG_Block(20,1,'BUDNI','BUDNI_LCG',261); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.BUDNI_LCG_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_LCG_Gravity_Test_Block; +truncate table mmt_staging2.stg_specific_table_BUDNI_LCG; +truncate table mmt_staging2.stg_process_table_BUDNI_LCG; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_LCG +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_BUDNI_LCG set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_BUDNI_LCG set column3 = TRIM (LEADING FROM column3 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_LCG b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_LCG a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Location of centre of Gravity Test'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_LCG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_LCG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_LCG +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_LCG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Location of centre of Gravity Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_LCG a +where rank_tag='BUDNI_LCG_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_LCG a +where rank_tag='BUDNI_LCG_Spec_H1' and rank=3; + + + +/* blocks data loading start - BUDNI_LCG_Spec_H1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_LCG_Spec_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_LCG_Spec_H1_Block'; +insert into mmt_staging2.BUDNI_LCG_Spec_H1_Block +( +make,model,Tractor_HP, Rated_RPM,configuration,Transmission_type, +Wheel_Drive_type,rank +) +select +column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_LCG +where rank_tag='BUDNI_LCG_Spec_H1' and rank=3; + + +execute 'update mmt_staging2.BUDNI_LCG_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_LCG_Spec_H1_block a +set Wheel_Base=column3, +Wheel_track =column4, +Overall_height =column5, +Ballast_Condition =column6, +Tractor_Weight_reactions_Front =column7, +Tractor_Weight_reactions_Rear =column8 +from mmt_staging2.stg_process_table_budni_lcg b +where b.rank_tag='BUDNI_LCG_Spec_H1' +and b.rank=6 +and a.file_syspk=b.file_syspk; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_LCG_Spec_H1_block'); + + +/* blocks data loading -BUDNI_LCG_Gravity_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_LCG_Gravity_Test_Block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_LCG_Gravity_Test_Block'; + +insert into mmt_staging2.BUDNI_LCG_Gravity_Test_Block +( +column2,column3,column4,column5,column6,column7, +column8,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,rank +from mmt_staging2.stg_process_table_BUDNI_LCG a +where rank_tag='BUDNI_LCG_Gravity_Test' and rank <=5 +order by rank; + + +update mmt_staging2.BUDNI_LCG_Gravity_Test_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_LCG_Gravity_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_LCG_Gravity_Test_Block a +set column3= b.first_value from (SELECT + rank, column3, value_partition, first_value(column3) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column3, + sum(case when column3 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_LCG_Gravity_Test_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.BUDNI_LCG_Gravity_Test_Block +set ods_record=0 where +rank in (1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_LCG_Gravity_Test_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_LCG_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_LCG_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_ODS.SQL new file mode 100644 index 0000000..f620a08 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_ODS.SQL @@ -0,0 +1,348 @@ +drop function if exists mmt_staging2.fn_BUDNI_NMT_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_NMT_ODS(p_file_syspk int) + RETURNS text AS $$ + + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_BUDNI_NMT_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_NMT +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_NMT_ODS() +***************************************************************/ + + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_NMT'; +-- +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_NMT'; +-- +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_NMT'; +-- +--delete from mmt_ods.budni_noise_atmospheric_conditions where test_file_sheet_format='BUDNI_NMT'; +-- +--delete from mmt_ods.budni_noise_measurement_results where test_file_sheet_format='BUDNI_NMT'; +-- +--delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_NMT'; + + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +ballast_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +FIP_type, +steering_type, +Ballast_Condition +from mmt_staging2.BUDNI_NMT_Spec_H1_block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +type_of_road +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +type_of_track +from + mmt_staging2.BUDNI_NMT_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int, +engine_to_pto_ratio engine_to_pto_ratio_540_pto +from mmt_staging2.BUDNI_NMT_Spec_H1_block; + + +/*block */ + +insert into mmt_ods.budni_noise_atmospheric_conditions +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +noise_position, +background_noise_level_dba, +temperature_c, +pressure_kpa, +relative_humidity_pct, +wind_velocity_ms +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3::numeric, +column4::numeric, +column5::numeric, +column6::numeric, +column7::numeric +from mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block where ods_record=1 +order by rank; + + + +/*block */ +insert into mmt_ods.budni_noise_measurement_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +noise_position, +gear, +travel_speed_km_per_hr, +noise_level_db_a +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3, +column6, +column8::numeric +from mmt_staging2.BUDNI_NMT_Meas_Results_1_Block +where ods_record=1; + +insert into mmt_ods.budni_noise_atmospheric_conditions +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +noise_position, +background_noise_level_dba, +temperature_c, +pressure_kpa, +relative_humidity_pct, +wind_velocity_ms +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3::numeric, +column4::numeric, +column5::numeric , +column6::numeric, +column7::numeric +from mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block where ods_record=1 +order by rank; + + + +/*block */ +insert into mmt_ods.budni_noise_measurement_results +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +noise_position, +gear, +drawbar_pull_max_noise_kn, +travel_speed_km_per_hr, +noise_level_db_a +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3, +column4, +column6, +column8::int +from mmt_staging2.BUDNI_NMT_Meas_Results_2_Block +where ods_record=1; + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +sequence_number, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::numeric, +column4, +column5, +column6, +column7, +column8, +column9 +from mmt_staging2.budni_nmt_test_obs_summary_block where ods_record=1; + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_NMT_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_noise_atmospheric_conditions +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_noise_measurement_results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_NMT' ,null,'ods', 'fn_BUDNI_NMT_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_NMT' ,null,'ods', 'fn_BUDNI_NMT_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_STG2.sql new file mode 100644 index 0000000..d8ed039 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_NMT_STG2.sql @@ -0,0 +1,507 @@ +drop function if exists mmt_staging2.fn_BUDNI_NMT_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_NMT_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + +SET search_path TO mmt_staging2; + +/*********************************************************************************** +Function Name:fn_BUDNI_NMT_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format:BUDNI_NMT +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_NMT_Block(20,1,'BUDNI','BUDNI_NMT',261); +************************************************************************************/ + + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.BUDNI_NMT_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block; +truncate table mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block; +truncate table mmt_staging2.BUDNI_NMT_Meas_Results_1_Block; +truncate table mmt_staging2.BUDNI_NMT_noise_at_operator_ear_level_block; +truncate table mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block; +truncate table mmt_staging2.BUDNI_NMT_Meas_Results_2_Block; +truncate table mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block; +truncate table mmt_staging2.stg_specific_table_BUDNI_NMT; +truncate table mmt_staging2.stg_process_table_BUDNI_NMT; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_NMT +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ + +update mmt_staging2.stg_specific_table_BUDNI_LCG set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_BUDNI_LCG set column3 = TRIM (LEADING FROM column3 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_NMT b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_NMT a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_NMT b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_staging2.stg_specific_table_BUDNI_NMT a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''Noise Measurement Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_NMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_NMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_NMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_NMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Noise at bystander’s position: Noise Measurement Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_NMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_NMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Noise at operator’s ear level: Noise Measurement Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_NMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_NMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Noise Measurement Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_NMT a +where rank_tag='BUDNI_NMT_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_NMT a +where rank_tag='BUDNI_NMT_Spec_H1' and rank=3; + + + +/* blocks data loading start - BUDNI_NMT_Spec_H1_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Spec_H1_block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_NMT_Spec_H1_block'; + +insert into mmt_staging2.BUDNI_NMT_Spec_H1_block +( +make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,rank) +select column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_NMT where rank_tag='BUDNI_NMT_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_NMT_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_NMT_Spec_H1_block a +set FIP_type=column3,steering_type=column4,Engine_to_PTO_ratio= column5,Ballast_Condition=column6, +Test_Engine_Set_RPM=column7,Type_of_track=column8 +from mmt_staging2.stg_process_table_BUDNI_NMT b +where b.rank_tag='BUDNI_NMT_Spec_H1' +and b.rank=5 +and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_NMT_Spec_H1_Block +set ods_record=0 where rank in(1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Spec_H1_Block'); + + +/* blocks data loading - BUDNI_NMT_noise_at_bystander_position_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_noise_at_bystander_position_block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_NMT_noise_at_bystander_position_block'; +insert into mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block +( +column2,column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_NMT a +where rank_tag ='BUDNI_NMT_Noise_at_bystander_position'; + + +update mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block +set column2=column3 where rank=1; + + +update mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block a +set column2= b.first_value from (SELECT + rank, column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column2, + sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.BUDNI_NMT_noise_at_bystander_position_Block +set ods_record=0 where rank in(1,2); + + +update mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_noise_at_bystander_position_block'); + + +/* blocks data loading - BUDNI_NMT_Atmos_Cond_1_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Atmos_Cond_1_Block',__file_format,__sheet_mnemonic,3); +v_block:='BUDNI_NMT_Atmos_Cond_1_Block'; +insert into mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block a +where rank <=4; + + +update mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block +set ods_record=0 where +rank in (1,2,3); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Atmos_Cond_1_Block '); + + + +/* blocks data loading - BUDNI_NMT_Meas_Results_1_Block */ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Meas_Results_1_Block',__file_format,__sheet_mnemonic,4); +v_block:='BUDNI_NMT_Meas_Results_1_Block'; +insert into mmt_staging2.BUDNI_NMT_Meas_Results_1_Block +( +column2,column3,column4,column5,column6,column7, +column8,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,rank +from mmt_staging2.BUDNI_NMT_noise_at_bystander_position_block a +where rank>4; + + +update mmt_staging2.BUDNI_NMT_Meas_Results_1_Block +set ods_record=0 where +rank=5; + + +update mmt_staging2.BUDNI_NMT_Meas_Results_1_Block +set column3=column4 where column3 is null ; + +update mmt_staging2.BUDNI_NMT_Meas_Results_1_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_Meas_Results_1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Meas_Results_1_Block '); + + +/* blocks data loading - BUDNI_NMT_Noise_at_operator_ear_level_block */ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Noise_at_operator_ear_level_block',__file_format,__sheet_mnemonic,5); +v_block:='BUDNI_NMT_Noise_at_operator_ear_level_block'; + +insert into mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block +( +column2,column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_NMT a +where rank_tag ='BUDNI_NMT_Noise_at_operator_ear_level'; + +update mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block +set column2=column3 where rank=1; + + +update mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block a +set column2= b.first_value from (SELECT + rank, column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column2, + sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Noise_at_operator_ear_level_block'); + +/* blocks data loading -BUDNI_NMT_Atmos_Cond_2_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Atmos_Cond_2_Block',__file_format,__sheet_mnemonic,6); +v_block:='BUDNI_NMT_Atmos_Cond_2_Block'; +insert into mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block +( +column2,column3,column4,column5,column6,column7, +column8,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,rank +from mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block a +where rank<=4; + +update mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block +set ods_record=0 where +rank in (1,2,3); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Atmos_Cond_2_Block'); + + +/* blocks data loading -BUDNI_NMT_Meas_Results_2_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Meas_Results_2_Block',__file_format,__sheet_mnemonic,7); +v_block:='BUDNI_NMT_Meas_Results_2_Block'; +insert into mmt_staging2.BUDNI_NMT_Meas_Results_2_Block +( +column2,column3,column4,column5,column6,column7, +column8,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,rank +from mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_block a +where rank>4; + +update mmt_staging2.BUDNI_NMT_Meas_Results_2_Block +set ods_record=0 where +rank =5; + +update BUDNI_NMT_Meas_Results_2_Block set column3=column4 where column3 is null; + +update mmt_staging2.BUDNI_NMT_Meas_Results_2_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_Meas_Results_2_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Meas_Results_2_Block'); + + +/* blocks data loading -BUDNI_NMT_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_NMT_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,8); +v_block:='BUDNI_NMT_Test_Obs_Summary_Block'; + +insert into mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block +( +column2,column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column2,column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_NMT a +where rank_tag='BUDNI_NMT_Test_Obs_Summary' and rank in (1,2,3,4); + +update mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block +set ods_record=0 where +rank in (1,2); + +update mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_NMT_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_NMT_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_NMT_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_ODS.SQL new file mode 100644 index 0000000..44341da --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_ODS.SQL @@ -0,0 +1,309 @@ +drop function if exists mmt_staging2.fn_BUDNI_PTO_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_PTO_ODS(p_file_syspk int) + RETURNS text AS $$ +declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_BUDNI_PTO_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_PTO +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_PTO_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_PTO'; +-- +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_PTO'; +-- +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_PTO'; +-- +--delete from mmt_ods.budni_pto_perf_results_summary where test_file_sheet_format='BUDNI_PTO'; +-- +--delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_PTO'; +-- +--delete from mmt_ods.budni_pto_perf_results_details where test_file_sheet_format='BUDNI_PTO'; + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +fip_type, +steering_type, +transmission_type, +wheel_drive_type +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int, +configuration,FIP_type,steering_type,transmission_type,wheel_drive_type +from mmt_staging2.BUDNI_PTO_Spec_H1_block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +date_of_test +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +date +from + mmt_staging2.BUDNI_PTO_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int, +engine_to_pto_ratio +from mmt_staging2.BUDNI_PTO_Spec_H1_block; + + +/*block */ + +insert into mmt_ods.budni_pto_perf_results_summary +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +pto_category, +pto_sub_category , +power_kw, +speed_rpm_pto , +speed_rpm_engine , +fuel_consumption_ltr_per_hr, +fuel_consumption_kg_per_hr, +specific_kg_per_kwh, +specifc_energy_kwhl +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column2, +column3, +column4::numeric,column5::numeric,column6::numeric,column7::numeric,column8::numeric, +column9::numeric,column10::numeric +from mmt_staging2.BUDNI_PTO_Perf_Report_block where ods_record=1 +order by rank; + + +/*block */ +insert into mmt_ods.budni_pto_perf_results_details +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +ambient_type, +no_load_max_engine_speed_rpm, +equi_crankshaft_torque_at_max_power_nm, +max_equi_crankshaft_torque_nm, +engine_speed_at_max_equi_crankshaft_torque_rpm, +backup_torque, +pct_smoke_level_max_light_absorption_coef_per_mtr, +range_of_atm_conditions_temp_c, +range_of_atm_conditions_pressure_kpa, +range_of_atm_conditions_rel_humidity_pct +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3, +column4::int, +column5::numeric, +column6::numeric,column7::int,column8::numeric, +column9::numeric,column10,column11,column12 +from mmt_staging2.BUDNI_PTO_MMTKeyword1_block +where ods_record=1; + + +/* block */ + +insert into mmt_ods.budni_pto_perf_results_details +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +ambient_type, +max_temp_engine_oil_c, +max_temp_coolant_water_c, +max_temp_fuel_c, +max_temp_air_intake_c, +max_temp_exhaust_gas_c, +pressure_at_max_power_intake_air_kpa, +pressure_at_max_power_exhst_gas_bfr_turbo_charger_kpa, +consumptions_lub_oil_gkwh, +consumptions_coolant_water_pct_of_total_coolant_capacity +) +select client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3, +column4::numeric,column5::numeric,column6::numeric,column7::numeric,column8::numeric,column9, +column10,column11::numeric,column12::numeric +from mmt_staging2.BUDNI_PTO_MMTKeyword2_block +where ods_record=1 and column3='Natural Ambient'; + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model,column3,column4,column7,column8,column10,column11,column12 +from mmt_staging2.BUDNI_PTO_Summary_block +where rank in (3,4) and ods_record=1 +; + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_PTO_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_pto_perf_results_summary +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.budni_pto_perf_results_details +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_PTO' ,null,'ods', 'fn_BUDNI_PTO_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_PTO' ,null,'ods', 'fn_BUDNI_PTO_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_STG2.sql new file mode 100644 index 0000000..bc0b297 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_PTO_STG2.sql @@ -0,0 +1,358 @@ +drop function if exists mmt_staging2.fn_BUDNI_PTO_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_PTO_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + +SET search_path TO mmt_staging2; + + +/*********************************************************************************** +Function Name:fn_BUDNI_PTO_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format:BUDNI_PTO +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_PTO_Block(20,1,'BUDNI','BUDNI_PTO',261); +************************************************************************************/ + + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_BUDNI_PTO; +truncate table mmt_staging2.stg_process_table_BUDNI_PTO; +truncate table mmt_staging2.BUDNI_PTO_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_PTO_Perf_Report_block; +truncate table mmt_staging2.BUDNI_PTO_MMTKeyword1_Block; +truncate table mmt_staging2.BUDNI_PTO_MMTKeyword2_Block; +truncate table mmt_staging2.BUDNI_PTO_Summary_Block; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_budni_pto +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_budni_pto set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_budni_pto set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match */ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_budni_pto b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update */ +execute 'update mmt_staging2.stg_specific_table_budni_pto a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''PTO Performance Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_budni_pto +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_pto a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_budni_pto +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_pto a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''PTO Performance Report'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_budni_pto +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_budni_pto a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''MMTKeyword1'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_budni_pto +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_budni_pto a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''MMTKeyword2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_budni_pto +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_budni_pto a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''PTO Performance Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_budni_pto a +where rank_tag='BUDNI_PTO_Spec_H1' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_budni_pto a +where rank_tag='BUDNI_PTO_Spec_H1' and rank=3; + +/* blocks data loading start - BUDNI_PTO_Spec_H1_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_PTO_Spec_H1_block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_PTO_Spec_H1_block'; + +insert into mmt_staging2.BUDNI_PTO_Spec_H1_block +(make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,FIP_type,rank) +select column3,column4,column5,column6,column7,column8,column9,column10,rank +from mmt_staging2.stg_process_table_budni_pto where rank_tag='BUDNI_PTO_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_PTO_Spec_H1_block set file_syspk='||p_file_syspk||''; + +update mmt_staging2.BUDNI_PTO_Spec_H1_block a +set date= date '1899-12-30' + column12::int * interval '1' day +from mmt_staging2.stg_process_table_budni_pto b +where b.rank_tag='BUDNI_PTO_Spec_H1' +and b.rank=1 +and a.file_syspk=b.file_syspk ; + + + +update mmt_staging2.BUDNI_PTO_Spec_H1_block a +set steering_type=column3,Engine_to_PTO_ratio= column4 +from mmt_staging2.stg_process_table_budni_pto b +where b.rank_tag='BUDNI_PTO_Spec_H1' +and b.rank=5 +and a.file_syspk=b.file_syspk; + + update mmt_staging2.BUDNI_PTO_Spec_H1_block set make=__make, model=__model; + execute 'update mmt_staging2.BUDNI_PTO_Spec_H1_block set +client_id='||p_client_id||', +function_id='||p_function_id||', + file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''', + file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_PTO_Spec_H1_block'); + + +/* blocks data loading -BUDNI_PTO_Perf_Report_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_PTO_Perf_Report_block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_PTO_Perf_Report_block'; + +insert into mmt_staging2.BUDNI_PTO_Perf_Report_block +( column2,column3,column4,column5,column6,column7,column8,column9,column10,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,rank +from mmt_staging2.stg_process_table_budni_pto +where rank_tag='BUDNI_PTO_Perf_Report'; + + +update mmt_staging2.BUDNI_PTO_Perf_Report_block +set column2=column3 where column2 is null; + +update mmt_staging2.BUDNI_PTO_Perf_Report_block +set column2=null +where column2 like 'i%'; + +update mmt_staging2.BUDNI_PTO_Perf_Report_block +set column2=null +where column2 like 'v%'; + +update mmt_staging2.BUDNI_PTO_Perf_Report_block a +set column2= b.first_value from (SELECT + rank, column2, value_partition, first_value(column2) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column2, + sum(case when column2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_PTO_Perf_Report_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.BUDNI_PTO_Perf_Report_block +set column3 =null +where column2=column3; + +update mmt_staging2.BUDNI_PTO_Perf_Report_block +set ods_record=0 where rank in (1,2); + + +update mmt_staging2.BUDNI_PTO_Perf_Report_block set ods_record=0 where column3 is null +and column2 in( +select column2 from mmt_staging2.BUDNI_PTO_Perf_Report_block group by column2 having count(*)>1 +); + + + + update mmt_staging2.BUDNI_PTO_Perf_Report_block set make=__make,model=__model; + execute 'update mmt_staging2.BUDNI_PTO_Perf_Report_block set +client_id='||p_client_id||', +function_id='||p_function_id||', + file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''', + file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_PTO_Perf_Report_block'); + + +/* blocks data loading - BUDNI_PTO_MMTKeyword1_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_PTO_MMTKeyword1_block',__file_format,__sheet_mnemonic,3); +v_block:='BUDNI_PTO_MMTKeyword1_block'; + + insert into mmt_staging2.BUDNI_PTO_MMTKeyword1_block +( column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_budni_pto +where rank_tag='BUDNI_PTO_MMTKeyword1'; + + +update mmt_staging2.BUDNI_PTO_MMTKeyword1_block set ods_record=0 where rank in (1,2); + +update mmt_staging2.BUDNI_PTO_MMTKeyword1_block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_PTO_MMTKeyword1_block set +client_id='||p_client_id||', +function_id='||p_function_id||', + file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''', + file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_PTO_MMTKeyword1_block'); + +/* blocks data loading - BUDNI_PTO_MMTKeyword2_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_PTO_MMTKeyword2_block',__file_format,__sheet_mnemonic,4); +v_block:='BUDNI_PTO_MMTKeyword2_block'; + +insert into mmt_staging2.BUDNI_PTO_MMTKeyword2_block +( column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_budni_pto +where rank_tag='BUDNI_PTO_MMTKeyword2'; + + +update mmt_staging2.BUDNI_PTO_MMTKeyword2_block set ods_record=0 where rank in (1,2); + + + update mmt_staging2.BUDNI_PTO_MMTKeyword2_block set make=__make,model=__model; + execute 'update mmt_staging2.BUDNI_PTO_MMTKeyword2_block set +client_id='||p_client_id||', +function_id='||p_function_id||', + file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''', + file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_PTO_MMTKeyword2_block'); + +/* blocks data loading -BUDNI_PTO_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_PTO_Summary_Block',__file_format,__sheet_mnemonic,5); +v_block:='BUDNI_PTO_Summary_Block'; + +insert into mmt_staging2.BUDNI_PTO_Summary_Block +( column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_budni_pto +where rank_tag='BUDNI_PTO_Summary'; + + +update mmt_staging2.BUDNI_PTO_Summary_block +set ods_record=0 where rank in (1,2); + + update mmt_staging2.BUDNI_PTO_Summary_block set make=__make, model=__model; + execute 'update mmt_staging2.BUDNI_PTO_Summary_block set + client_id='||p_client_id||', +function_id='||p_function_id||', + file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''', + file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'mmt_staging2.BUDNI_PTO_Summary_block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_PTO_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_PTO_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_ODS.SQL b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_ODS.SQL new file mode 100644 index 0000000..dd95341 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_ODS.SQL @@ -0,0 +1,234 @@ +drop function if exists mmt_staging2.fn_BUDNI_VMT_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_VMT_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __model text; + declare __make text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin +__file_syspk := p_file_syspk; +/************************************************************ +Function Name:fn_BUDNI_VMT_ODS +Function Desc: This function populates data into ODS +File Format: BUDNI +Sheet Format: BUDNI_VMT +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_VMT_ODS() +***************************************************************/ + +--delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_VMT'; +-- +--delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_VMT'; +-- +-- +--delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_VMT'; +-- +--delete from mmt_ods.budni_vibration_measurement where test_file_sheet_format='BUDNI_VMT'; +-- +--delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_VMT'; + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +ballast_condition +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +tractor_HP::int tractor_engine_hp, +configuration, +transmission_type, +wheel_drive_type, +FIP_type, +steering_type, +Ballast_Condition +from mmt_staging2.BUDNI_VMT_Spec_H1_block; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model +from + mmt_staging2.BUDNI_VMT_Spec_H1_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +rated_rpm::int, +engine_to_pto_ratio engine_to_pto_ratio_540_pto +from mmt_staging2.BUDNI_VMT_Spec_H1_block; + +insert into mmt_ods.budni_vibration_measurement +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +srl_no, +measuring_points, +vibration_at_no_load_vd_microns, +vibration_at_no_load_hd_microns, +vibration_at_load_85_pct_of_max_pto_power_vd_microns, +vibration_at_load_85_pct_of_max_pto_power_hd_microns +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +column3::numeric, +column4, +column6::numeric , +column7::numeric , +column8::numeric , +column9::numeric +from mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block +where ods_record =1 +order by rank; + +insert into mmt_ods.budni_test_observations +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +sequence_number, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +column3::INT, +column4, +column5, +column6, +column7, +column8, +column9 +from mmt_staging2.BUDNI_VMT_test_obs_summary_block where ods_record=1; + + +select file_syspk into __file_syspk from mmt_staging2.BUDNI_VMT_Spec_H1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_model into __model from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_vibration_measurement +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + + +update mmt_ods.budni_test_observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_VMT' ,null,'ods', 'fn_BUDNI_VMT_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'BUDNI','BUDNI_VMT' ,null,'ods', 'fn_BUDNI_VMT_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_STG2.sql b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_STG2.sql new file mode 100644 index 0000000..e871dfa --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/BUDNI_VMT_STG2.sql @@ -0,0 +1,371 @@ +drop function if exists mmt_staging2.fn_BUDNI_VMT_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_VMT_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +SET search_path TO mmt_staging2; + + +/*********************************************************************************** +Function Name:fn_BUDNI_VMT_Block +Function Desc: This function populates data into staging2 blocks +File Format: BUDNI +Sheet Format:BUDNI_VMT +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_BUDNI_VMT_Block(20,1,'BUDNI','BUDNI_VMT',261); +************************************************************************************/ + + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.BUDNI_VMT_Spec_H1_Block; +truncate table mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block; +truncate table mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block; +truncate table mmt_staging2.stg_specific_table_BUDNI_VMT; +truncate table mmt_staging2.stg_process_table_BUDNI_VMT; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for BUDNI */ +execute 'insert into mmt_staging2.stg_specific_table_BUDNI_VMT +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ + +update mmt_staging2.stg_specific_table_BUDNI_LCG set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_BUDNI_LCG set column3 = TRIM (LEADING FROM column3 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_VMT b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_VMT a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_BUDNI_VMT b +where trim(upper(F1_source))= trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_BUDNI_VMT a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null +where f1_modified =''AIR CLEANER OIL PULL OVER TEST Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_BUDNI_VMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_VMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_VMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_VMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Machanical Vibration Measurement Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_BUDNI_VMT +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_BUDNI_VMT a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Noise Measurement Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_BUDNI_VMT a +where rank_tag='BUDNI_VMT_Spec_H1' and rank=3; + +select column4 into __model from mmt_staging2.stg_process_table_BUDNI_VMT a +where rank_tag='BUDNI_VMT_Spec_H1' and rank=3; + + +/* blocks data loading start - BUDNI_VMT_Spec_H1_block */ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_VMT_Spec_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='BUDNI_VMT_Spec_H1_Block'; +insert into mmt_staging2.BUDNI_VMT_Spec_H1_block +( +make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,rank) +select column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_VMT where rank_tag='BUDNI_VMT_Spec_H1' +and rank=3; + + +execute 'update mmt_staging2.BUDNI_VMT_Spec_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +update mmt_staging2.BUDNI_VMT_Spec_H1_block a +set FIP_type=column3,steering_type=column4,Engine_to_PTO_ratio= column5,Ballast_Condition=column6, +Test_Engine_Set_RPM=column7,Type_of_track=column8 +from mmt_staging2.stg_process_table_BUDNI_VMT b +where b.rank_tag='BUDNI_VMT_Spec_H1' +and b.rank=5 +and a.file_syspk=b.file_syspk; + +update mmt_staging2.BUDNI_VMT_Spec_H1_Block +set ods_record=0 where rank in(1,2); + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_VMT_Spec_H1_block'); + + +/* blocks data loading -BUDNI_VMT_Perf_Meas_Test_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_VMT_Perf_Meas_Test_Block',__file_format,__sheet_mnemonic,2); +v_block:='BUDNI_VMT_Perf_Meas_Test_Block'; + +insert into mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block +( +column3, +column4, +column5, +column6, +column7, +column8, +column9, +rank +) +select +column3,column4,column5,column6,column7,column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_VMT a +where rank_tag ='BUDNI_VMT_Perf_Meas_Test' +order by rank; + + +update mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block a +set column3= b.first_value from (SELECT + rank, column3, value_partition, first_value(column3) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column3, + sum(case when column3 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank and a.rank not in(1,2,3,4); + +update mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block a +set column4= b.first_value from (SELECT + rank, column4, value_partition, first_value(column4) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column4, + sum(case when column4 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank and a.rank not in(1,2,3,4); + + +update mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block +set column4=concat(column4,'-',column5) where rank not in(1,2,3,4) and column5 is not null; + +update mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block +set ods_record=0 where rank in(1,2,3,4); + +update mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_VMT_Perf_Meas_Test_Block'); + + +/* blocks data loading -BUDNI_VMT_Test_Obs_Summary_Block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'BUDNI_VMT_Test_Obs_Summary_Block',__file_format,__sheet_mnemonic,3); +v_block:='BUDNI_VMT_Test_Obs_Summary_Block'; + +insert into mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block +( +column3,column4,column5,column6,column7, +column8,column9,rank +) +select +column3,column4,column5,column6,column7, +column8,column9,rank +from mmt_staging2.stg_process_table_BUDNI_VMT a +where rank_tag='BUDNI_VMT_Test_Obs_Summary' and rank <=6 +order by rank; + +update mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block a +set column5= b.first_value from (SELECT + rank, column5, value_partition, first_value(column5) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column5, + sum(case when column5 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block a +set column6= b.first_value from (SELECT + rank, column6, value_partition, first_value(column6) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column6, + sum(case when column6 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block a +set column7= b.first_value from (SELECT + rank, column7, value_partition, first_value(column7) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + column7, + sum(case when column7 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block + ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +update mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block +set ods_record=0 where +rank in(1,2); + + +update mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block set make=__make,model=__model; +execute 'update mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'BUDNI_VMT_Test_Obs_Summary_Block'); + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_BUDNI_VMT_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_BUDNI_VMT_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; + +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/delete_ods_BUDNI.sql b/deployment-20210427T103328Z-001/deployment/budni/delete_ods_BUDNI.sql new file mode 100644 index 0000000..93d8060 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/delete_ods_BUDNI.sql @@ -0,0 +1,110 @@ +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_ARC'; +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_ARC'; + delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_ARC'; +delete from mmt_ods.budni_air_cleaner_perf_results where test_file_sheet_format='BUDNI_ARC'; +delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_ARC'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_BRK'; +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_BRK'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_BRK'; +delete from mmt_ods.budni_brake_perf_parking_brake_test_results +where test_file_sheet_format='BUDNI_BRK'; +delete from mmt_ods.budni_brake_perf_service_brake_test_results +where test_file_sheet_format='BUDNI_BRK'; +delete from mmt_ods.budni_test_observations +where test_file_sheet_format='BUDNI_BRK'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_DBP'; +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_DBP'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_DBP'; +delete from mmt_ods.budni_drawbar_perf_results where test_file_sheet_format='BUDNI_DBP'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_FLD'; +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_FLD'; +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_FLD'; +delete from mmt_ods.test_instance_implement_info where test_file_sheet_format='BUDNI_FLD'; +delete from mmt_ods.budni_field_perf_results where test_file_sheet_format='BUDNI_FLD'; +delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_FLD'; + + + +delete from mmt_ods.test_instance +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.test_instance_engine_info +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.test_instance_tractor_info +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.test_instance_tractor_info_misc +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.budni_hydraulic_maint_of_lift_load_results +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.budni_hydraulic_power_test_results +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.budni_hydraulic_lifting_capacity_test_results +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.budni_test_observations +where test_file_sheet_format='BUDNI_HDL'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_HLG'; + +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_HLG'; + +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_HLG'; + +delete from mmt_ods.budni_haulage_perf_results where test_file_sheet_format='BUDNI_HLG'; + +delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_HLG'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_LCG'; + +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_LCG'; + +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_LCG'; + +delete from mmt_ods.budni_centre_of_gravity_location where test_file_sheet_format ='BUDNI_LCG'; + + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_NMT'; + +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_NMT'; + +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_NMT'; + +delete from mmt_ods.budni_noise_atmospheric_conditions where test_file_sheet_format='BUDNI_NMT'; + +delete from mmt_ods.budni_noise_measurement_results where test_file_sheet_format='BUDNI_NMT'; + +delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_NMT'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_PTO'; + +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_PTO'; + +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_PTO'; + +delete from mmt_ods.budni_pto_perf_results_summary where test_file_sheet_format='BUDNI_PTO'; + +delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_PTO'; + +delete from mmt_ods.budni_pto_perf_results_details where test_file_sheet_format='BUDNI_PTO'; + +delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_VMT'; + +delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_VMT'; + + +delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_VMT'; + +delete from mmt_ods.budni_vibration_measurement where test_file_sheet_format='BUDNI_VMT'; + +delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_VMT'; + + + diff --git a/deployment-20210427T103328Z-001/deployment/budni/output_BUDNI.txt b/deployment-20210427T103328Z-001/deployment/budni/output_BUDNI.txt new file mode 100644 index 0000000..73243d9 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/budni/output_BUDNI.txt @@ -0,0 +1,370 @@ +drop table mmt_staging2.test_output_BUDNI; + +create table mmt_staging2.test_output_BUDNI +( +sno serial, +file_syspk int, +file_format text, +sheet_mnemonic text, +table_name text, +row_count int +); + +drop function if exists mmt_staging2.fn_test_output_BUDNI; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_test_output_BUDNI(p_file_syspk int) + RETURNS table + ( + sno int, + file_syspk int, + file_format text, + sheet_mnemonic text, + table_name text, + row_count int + ) + + as $$ + declare __file_syspk int :=p_file_syspk; +begin + + +truncate table mmt_staging2.test_output_BUDNI; + +execute 'insert into mmt_staging2.test_output_BUDNI +(file_syspk,file_format,sheet_mnemonic,table_name,row_count) +select test_file_ref_no,''BUDNI'',''BUDNI_ARC'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' and test_file_format =''BUDNI'' +and test_file_sheet_format =''BUDNI_ARC'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_ARC'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' and test_file_format =''BUDNI'' +and test_file_sheet_format =''BUDNI_ARC'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_ARC'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' and test_file_format =''BUDNI'' +and test_file_sheet_format =''BUDNI_ARC'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_ARC'',''budni_air_cleaner_perf_results'',count(*) +from mmt_ods.budni_air_cleaner_perf_results +where test_file_ref_no='||p_file_syspk||' and test_file_format =''BUDNI'' +and test_file_sheet_format =''BUDNI_ARC'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_ARC'',''budni_test_observations'',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' and test_file_format =''BUDNI'' +and test_file_sheet_format =''BUDNI_ARC'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_BRK'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_BRK'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_BRK'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_BRK'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_BRK'',''budni_brake_perf_parking_brake_test_results'',count(*) +from mmt_ods.budni_brake_perf_parking_brake_test_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_BRK'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_BRK'',''budni_brake_perf_service_brake_test_results'',count(*) +from mmt_ods.budni_brake_perf_service_brake_test_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_BRK'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_BRK'',''budni_test_observations'',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_BRK'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_DBP'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_DBP'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_DBP'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_DBP'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_DBP'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_DBP'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_DBP'',''budni_drawbar_perf_results'',count(*) +from mmt_ods.budni_drawbar_perf_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_DBP'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_FLD'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_FLD'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_FLD'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_FLD'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_FLD'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_FLD'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_FLD'',''test_instance_implement_info'',count(*) +from mmt_ods.test_instance_implement_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_FLD'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_FLD'',''budni_field_perf_results'',count(*) +from mmt_ods.budni_field_perf_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_FLD'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_FLD'',''budni_test_observations'',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_FLD'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''test_instance_tractor_info_misc'',count(*) +from mmt_ods.test_instance_tractor_info_misc +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''budni_hydraulic_maint_of_lift_load_results'',count(*) +from mmt_ods.budni_hydraulic_maint_of_lift_load_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''budni_hydraulic_power_test_results'',count(*) +from mmt_ods.budni_hydraulic_power_test_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''budni_hydraulic_lifting_capacity_test_results'',count(*) +from mmt_ods.budni_hydraulic_lifting_capacity_test_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HDL'',''budni_test_observations'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HDL'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HLG'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HLG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HLG'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HLG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HLG'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HLG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HLG'',''budni_haulage_perf_results'',count(*) +from mmt_ods.budni_haulage_perf_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HLG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_HLG'',''budni_test_observations'',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_HLG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_LCG'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_LCG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_LCG'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_LCG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_LCG'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_LCG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_LCG'',''budni_centre_of_gravity_location'',count(*) +from mmt_ods.budni_centre_of_gravity_location +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_LCG'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_NMT'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_NMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_NMT'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_NMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_NMT'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_NMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_NMT'',''budni_noise_atmospheric_conditions'',count(*) +from mmt_ods.budni_noise_atmospheric_conditions +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_NMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_NMT'',''budni_noise_measurement_results'',count(*) +from mmt_ods.budni_noise_measurement_results +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_NMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_NMT'',''budni_test_observations'',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_NMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_PTO'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_PTO'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_PTO'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_PTO'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_PTO'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_PTO'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_PTO'',''budni_pto_perf_results_summary'',count(*) +from mmt_ods.budni_pto_perf_results_summary +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_PTO'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_PTO'',''budni_pto_perf_results_details'',count(*) +from mmt_ods.budni_pto_perf_results_details +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_PTO'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_PTO'',''budni_test_observations '',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_PTO'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_VMT'',''test_instance'',count(*) +from mmt_ods.test_instance +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_VMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_VMT'',''test_instance_engine_info'',count(*) +from mmt_ods.test_instance_engine_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_VMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_VMT'',''test_instance_tractor_info'',count(*) +from mmt_ods.test_instance_tractor_info +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_VMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_VMT'',''budni_vibration_measurement'',count(*) +from mmt_ods.budni_vibration_measurement +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_VMT'' +group by test_file_ref_no +union +select test_file_ref_no,''BUDNI'',''BUDNI_VMT'',''budni_test_observations'',count(*) +from mmt_ods.budni_test_observations +where test_file_ref_no='||p_file_syspk||' +and test_file_format =''BUDNI'' and test_file_sheet_format =''BUDNI_VMT'' +group by test_file_ref_no'; +return query + + select * from mmt_staging2.test_output_BUDNI; + +end +$$ LANGUAGE plpgsql; + + + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/commonfunctions/Error Handling.txt b/deployment-20210427T103328Z-001/deployment/commonfunctions/Error Handling.txt new file mode 100644 index 0000000..40035f9 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/commonfunctions/Error Handling.txt @@ -0,0 +1,88 @@ +CREATE TABLE mmt_staging2.mmt_DB_Run_Status + ( syspk bigserial NOT NULL, + client_id int, + function_id int, + user_id int, + user_name text, + file_syspk int, + file_format text, + sheet_mnemonic text, + block_name text, + staging_type text, + error_function text, + error_state text, + error_message text, + error_detail text, + error_hint text, + error_context text, + status text, + error_timestamp timestamp default now(), + CONSTRAINT mmt_DB_error_pkey PRIMARY KEY (syspk) + ); + +drop table mmt_staging2.mmt_DB_Errors; +ALTER TABLE mmt_staging2.mmt_DB_Errors +ADD status text; + +DROP FUNCTION IF EXISTS mmt_staging2.mmt_insert_DB_error; + + CREATE OR REPLACE FUNCTION mmt_staging2.mmt_insert_db_error( clientId int, functionId int, userId int, userName varchar, fileSyspk int, + fileFormat varchar,sheetMnemonic varchar,blockName varchar,stagType varchar, eFunction varchar, eState varchar, eMessage varchar, eDetail varchar, eHint varchar,eContext varchar, sta varchar) + RETURNS text AS $$ + DECLARE + _message_text text; + _returned_sqlstate text; + BEGIN + BEGIN + INSERT INTO mmt_staging2.mmt_DB_Run_Status ( client_Id, function_id, user_id, user_name, file_syspk, file_format, sheet_mnemonic, block_name, staging_type, error_function, error_state, error_message, error_detail, error_hint, error_context,status) + values ( clientId, functionId, userID, userName, fileSyspk, fileFormat, sheetMnemonic, blockName, stagType, eFunction, eState, eMessage, eDetail, eHInt, eContext, sta ); + + EXCEPTION when OTHERS THEN + _message_text := ''; + _returned_sqlstate := ''; + + GET STACKED DIAGNOSTICS + _message_text = MESSAGE_TEXT, + _returned_sqlstate = RETURNED_SQLSTATE; + + RETURN 'Failed: DB Error Creation : ' || _returned_sqlstate || ' : ' || _message_text; + END; + RETURN 'Success: DB Error Creation '; + END + $$ LANGUAGE plpgsql; + +DROP FUNCTION IF EXISTS mmt_staging2.test_mmt_db_error; + +CREATE OR REPLACE FUNCTION mmt_staging2.test_mmt_db_error () + RETURNS text AS $$ +DECLARE + v_state text; + v_msg text; + v_detail text; + v_hint text; + v_context text; + v_block text; +begin + v_block := 'nothing'; + CREATE TABLE t_test( test_id int); + v_block := 'nothing'; + CREATE TABLE t_test(test_id int); -- this will cause an error + +EXCEPTION when OTHERS then + + GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( 10, 1, 1001, 'Compegence',1,'ftdry','ftdry_trs',v_block,'stg2', 'test_db_error', v_state, v_msg, v_detail, v_hint, v_context,'error'); + + return v_block; + END; +$$ LANGUAGE plpgsql; + +select mmt_staging2.test_mmt_db_error () +select * from mmt_staging2.mmt_DB_Errors +delete from mmt_staging2.mmt_DB_Errors; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/commonfunctions/generic_functions.txt b/deployment-20210427T103328Z-001/deployment/commonfunctions/generic_functions.txt new file mode 100644 index 0000000..2f82d66 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/commonfunctions/generic_functions.txt @@ -0,0 +1,79 @@ +drop function if exists mmt_ods.fn_update_NA(); +create or replace function mmt_ods.fn_update_NA() + returns void AS $$ + /*********** + select mmt_ods.fn_update_NA() + ********/ +declare + __n integer:=0; + __na_sql text; + __space_sql text; + __div_sql text; + __ref_sql text; + __hyphen_sql text; +__not_applicable text; +__NR text; +begin + loop + exit when __n=53; + __n := __n+1; + __na_sql := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'=''NA'''; + __space_sql := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'='''''; + __div_sql := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'=''#REF!'''; + __ref_sql := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'=''#DIV/0!'''; + __hyphen_sql := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'=''-'''; + __not_applicable := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'=''Not Applicable '''; + __NR := 'update mmt_staging1.mmt_staging_generic_table set '|| concat('column',__n)||' =null + where '||concat('column',__n)||'=''NR'''; + execute __na_sql; + execute __space_sql; + execute __div_sql; + execute __ref_sql; + execute __hyphen_sql; + execute __not_applicable; + execute __NR; + end loop; +end; +$$ LANGUAGE plpgsql; + + + + +drop function if exists mmt_staging2.fn_jobctrl_block_begin; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_jobctrl_block_begin(p_client_id int,p_function_id int,p_file_syspk int,p_block_table_name text,p_file_format text,p_sheet_mnemonic text,p_block_seq int) + RETURNS void AS $$ +begin + +/************************* +select mmt_staging2.fn_jobctrl_block_begin(1,2,255,'block1','file','sheet',1) +***********************/ + +execute 'insert into mmt_ods.fw_jobctrl_file_sheet_block_run_schedule +(client_id,function_id,file_syspk,block_table_name,file_format,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_format||''','''||p_sheet_mnemonic||''',1,'||p_block_seq||',current_timestamp'; +end +$$ LANGUAGE plpgsql; + + +drop function if exists mmt_staging2.fn_jobctrl_block_end; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_jobctrl_block_end(p_file_syspk int,p_block_table_name text) + RETURNS void AS $$ +begin + +/********************************* +select mmt_staging2.fn_jobctrl_block_end(255,'block1') +*********************************/ + +execute 'update mmt_ods.fw_jobctrl_file_sheet_block_run_schedule set end_status=1 , end_time=current_timestamp +where file_syspk='''||p_file_syspk||'''and block_table_name='''||p_block_table_name||''''; + +end +$$ LANGUAGE plpgsql; + + diff --git a/deployment-20210427T103328Z-001/deployment/configentires/BUDNI_config.sql b/deployment-20210427T103328Z-001/deployment/configentires/BUDNI_config.sql new file mode 100644 index 0000000..a4d3590 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/configentires/BUDNI_config.sql @@ -0,0 +1,100 @@ +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_DBP','BUDNI_DBP_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_DBP','BUDNI_DBP_Drawbar_Perf','Tractor Drawbar Performance Report.'); + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_NMT','BUDNI_NMT_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_NMT','BUDNI_NMT_ Noise at bystander''’s position', 'Noise at bystander''’s position: Noise Measurement Test'), +('BUDNI','BUDNI_NMT','BUDNI_NMT_ Noise at operator''’s ear level','Noise at operator''’s ear level: Noise Measurement Test'), +('BUDNI','BUDNI_NMT','BUDNI_NMT_Test_Obs_Summary','Noise Measurement Test Observations Summary'); + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_LCG','BUDNI_LCG_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_LCG','BUDNI_LCG_Gravity_Test','Location of centre of Gravity Test'); + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_PTO','BUDNI_PTO_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_PTO','BUDNI_PTO_Report','PTO Performance Report'), +('BUDNI','BUDNI_PTO','BUDNI_PTO_MMTKeyword1','MMTKeyword1'), +('BUDNI','BUDNI_PTO','BUDNI_PTO_MMTKeyword2','MMTKeyword2'), +('BUDNI','BUDNI_PTO','BUDNI_PTO_Summary','PTO Performance Test Observations Summary'); + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_HDL','BUDNI_HDL_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_HDL','BUDNI_HDL_Power_Test','A) Hydraulic power test:'), +('BUDNI','BUDNI_HDL','BUDNI_HDL_Lifting_Capacity_Test','B) Lifting Capacity Test'), +('BUDNI','BUDNI_HDL','BUDNI_HDL_Maintenance_Of_Lift_Load','C) Maintenance of lift load:'), +('BUDNI','BUDNI_HDL','BUDNI_HDL_Test_Obs_Summary','Power Lift and Hydraulic Pump Performance Test Observations Summary'); + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_HLG','BUDNI_HLG_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_HLG','BUDNI_HLG_Perf_Test','Haulage performance Test'), +('BUDNI','BUDNI_HLG','BUDNI_HLG_Test_Obs_Summary','Haulage Performance Test Observations Summary'); + + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_FLD','BUDNI_FLD_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_FLD','BUDNI_FLD_Impl_Test','BRIEF SPECIFICATION OF IMPLEMENTS USED DURING FIELD TEST'), +('BUDNI','BUDNI_FLD','BUDNI_FLD_Sum_Perf_Test','SUMMARY OF FIELD PERFORMANCE TEST'), +('BUDNI','BUDNI_FLD','BUDNI_FLD_Test_Obs_Summary','Field Performance Test Observations Summary'); + + + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_ARC','BUDNI_ARC_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_ARC','BUDNI_ARC_Perf_Atmos_Meas_Test','Atmospheric conditions:'), +('BUDNI','BUDNI_ARC','BUDNI_ARC_Test_Obs_Summary','AIR CLEANER OIL PULL OVER TEST Observations Summary'); + + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_VMT','BUDNI_VMT_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_VMT','BUDNI_VMT_Perf_Meas_Test','Machanical Vibration Measurement Test'), +('BUDNI','BUDNI_VMT','BUDNI_VMT_Test_Obs_Summary','Noise Measurement Test Observations Summary'); + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('BUDNI','BUDNI_BRK','BUDNI_BRK_Spec_H1','Test Tractor Specifiactions'), +('BUDNI','BUDNI_BRK','BUDNI_BRK_Service_Barke_Test','1) Service Barke Testing'), +('BUDNI','BUDNI_BRK','BUDNI_BRK_Parking_Brake_Test','2) Parking Brake Test'), +('BUDNI','BUDNI_BRK','BUDNI_BRK_Test_Obs_Summary','Brake Performance Test Observations Summary'); + + + + + + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/configentires/DBOECD-TEST-config.txt b/deployment-20210427T103328Z-001/deployment/configentires/DBOECD-TEST-config.txt new file mode 100644 index 0000000..1305c20 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/configentires/DBOECD-TEST-config.txt @@ -0,0 +1,14 @@ +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values ('DBOECD','DBOECD_TEST','DBOECD_Test_H1','Test Request no.'), +('DBOECD','DBOECD_TEST','DBOECD_test_engine_RPM','Engine (RPM)'), +('DBOECD','DBOECD_TEST','DBOECD_test_test_condition','Test condition'), +('DBOECD','DBOECD_TEST','DBOECD_test_drawbar_performance_selected_summary','Drawbar Performance Test Results (Selected Summary)'), +('DBOECD','DBOECD_TEST','DBOECD_test_drawbar_performance_gear_performance','Drawbar Performance Test Results (Gear Performance Test)'), +('DBOECD','DBOECD_TEST','DBOECD_test_fuel_consumption','3.3.2'), +('DBOECD','DBOECD_TEST','DBOECD_test_test_equipment','Test equipment’s used'), +('DBOECD','DBOECD_TEST','DBOECD_test_tractor_specifications','Tractor specification'), +('DBOECD','DBOECD_TEST','DBOECD_test_transmission','Transmission'), +('DBOECD','DBOECD_TEST','DBOECD_test_graphical_data','GRAPHICAL DATA'), +('DBOECD','DBOECD_TEST','DBOECD_test_photos','PHOTOS'), +('DBOECD','DBOECD_TEST','DBOECD_test_remarks','Remarks: '); \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/configentires/IHT config.sql b/deployment-20210427T103328Z-001/deployment/configentires/IHT config.sql new file mode 100644 index 0000000..368d7c0 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/configentires/IHT config.sql @@ -0,0 +1,60 @@ +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('IHT','IHT_NST','IHT_NST_H1','Test Request No'), +('IHT','IHT_NST','IHT_NST_Tyre_Details','Tyre Details'), +('IHT','IHT_NST','IHT_NST_Engine_RPM_Atmos','Engine RPM'), +('IHT','IHT_NST','IHT_NST_STAND_Noise','BY STANDARD NOISE'), +('IHT','IHT_NST','IHT_NST_OEL_Noise','OEL Noise'), +('IHT','IHT_NST','IHT_NST_Footer','Prepared By'); + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('IHT','IHT_HLS','IHT_HLS_H1','Test Request no.'), +('IHT','IHT_HLS','IHT_HLS_Weight_Tyre','Weight Reaction'), +('IHT','IHT_HLS','IHT_HLS_Numeric','Numerical data'), +('IHT','IHT_HLS','IHT_HLS_Footer','Prepared By'); + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('IHT','IHT_BRT','IHT_BRT_H1','Test Request No'), +('IHT','IHT_BRT','IHT_BRT_Test_Res','Date- 21-FEB-2021'), +('IHT','IHT_BRT','IHT_BRT_Test_Res_1','Date- 04-July-2019'), +('IHT','IHT_BRT','IHT_BRT_Weight_Tyre','Weight (kg)'), +('IHT','IHT_BRT','IHT_BRT_Footer','Remarks:'); + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('IHT','IHT_SLL','IHT_SLL_H1','Test Request no.'), +('IHT','IHT_SLL','IHT_SLL_Weight_Tyre','Weight Reaction'), +('IHT','IHT_SLL','IHT_SLL_Forward','DHRUV EXPORT EACH GEAR MAX SPEED - FORWARD'), +('IHT','IHT_SLL','IHT_SLL_Reverse','DHRUV EXPORT EACH GEAR MAX SPEED REVERSE'), +('IHT','IHT_SLL','IHT_SLL_Lead_Lag','Lead / Lag Measurement on Dhruv Export 4WD'), +('IHT','IHT_SLL','IHT_SLL_Footer','Remarks:'); + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('IHT','IHT_EMT','IHT_EMT_H1','Test Request no.'), +('IHT','IHT_EMT','IHT_EMT_Weight_Tyre','Weight Reaction'), +('IHT','IHT_EMT','IHT_EMT_Steering','Steering effort'), +('IHT','IHT_EMT','IHT_EMT_Pedal','Pedal Effort'), +('IHT','IHT_EMT','IHT_EMT_Brake_Pedal','Brake Pedal Effort'), +('IHT','IHT_EMT','IHT_EMT_Footer','Remarks:'); + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('IHT','IHT_CGM','IHT_CGM_H1','Test Request no.'), +('IHT','IHT_CGM','IHT_CGM_Weight_Tyre','Weight Reaction'), +('IHT','IHT_CGM','IHT_CGM_Lifting','Lifting Angle & Load'), +('IHT','IHT_CGM','IHT_CGM_Footer','Remarks:'); + diff --git a/deployment-20210427T103328Z-001/deployment/configentires/insert-config.txt b/deployment-20210427T103328Z-001/deployment/configentires/insert-config.txt new file mode 100644 index 0000000..1c3bca3 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/configentires/insert-config.txt @@ -0,0 +1,110 @@ + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values ('DBSTD','DBSTD_TEST','DBSTD_Test_H1','Test Request no.'), +('DBSTD','DBSTD_TEST','DBSTD_test_engine_RPM','Engine (RPM)'), +('DBSTD','DBSTD_TEST','DBSTD_test_test_condition','Test condition'), +('DBSTD','DBSTD_TEST','DBSTD_test_drawbar_performance_selected_summary','Drawbar Performance Test Results (Selected Summary)'), +('DBSTD','DBSTD_TEST','DBSTD_test_drawbar_performance_gear_performance','Drawbar Performance Test Results (Gear Performance Test)'), +('DBSTD','DBSTD_TEST','DBSTD_test_test_equipment','Test equipment’s used'), +('DBSTD','DBSTD_TEST','DBSTD_test_tractor_specifications','Tractor specification'), +('DBSTD','DBSTD_TEST','DBSTD_test_transmission','Transmission'), +('DBSTD','DBSTD_TEST','DBSTD_test_graphical_data','GRAPHICAL DATA'), +('DBSTD','DBSTD_TEST','DBSTD_test_photos','PHOTOS'), +('DBSTD','DBSTD_TEST','DBSTD_test_remarks','Remarks'); + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('FTDRY','FTDRY_TRS','FTDRY_TRS_H1','Tractor Specifications Sheet'), +('FTDRY','FTDRY_TRS','FTDRY_TRS_SPEC','Tractor Specifications'), +('FTDRY','FTDRY_TRS','FTDRY_TRS_Engine_RPM','Engine RPM Data:'), +('FTDRY','FTDRY_TRS','FTDRY_TRS_Implement','Implement Details') +; + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('FTWET','FTWET_TRS','FTWET_TRS_H1','Tractor Specifications Sheet'), +('FTWET','FTWET_TRS','FTWET_TRS_SPEC','Tractor Specifications'), +('FTWET','FTWET_TRS','FTWET_TRS_Engine_RPM','Engine RPM Data:'), +('FTWET','FTWET_TRS','FTWET_TRS_Implement','Implement Details') +; + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('FTHLG','FTHLG_TRS','FTHLG_TRS_H1','Tractor specifications sheet'), +('FTHLG','FTHLG_TRS','FTHLG_TRS_SPEC','Tractor Specifications'), +('FTHLG','FTHLG_TRS','FTHLG_TRS_Engine_RPM','Engine RPM Data:'), +('FTHLG','FTHLG_TRS','FTHLG_TRS_Trailer','Trailer Details') +; + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('FTDRY','FTDRY_SUM','FTDRY_SUM_Trac_H1','Tractor Model'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Implement','Make of Implement'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Test_Condition_1','Test Condition_1:'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Engineer_Comments_1','Test Engineer Comments_1'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Manager_Comments_1','Test Manager Comments_1'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Test_Condition_2','Test Condition_2:'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Engineer_Comments_2','Test Engineer Comments_2'), +('FTDRY','FTDRY_SUM','FTDRY_SUM_Manager_Comments_2','Test Manager Comments_2') +; + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('FTHLG','FTHLG_SUM','FTHLG_SUM_Trac_H1','Tractor Model'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Trail_Type','Trailer Type'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Test_Condition_1','Test Condition_1:'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Engineer_Comments_1','Test Engineer Comments_1'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Manager_Comments_1','Test Manager Comments_1'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Test_Condition_2','Test Condition_2:'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Engineer_Comments_2','Test Engineer Comments_2'), +('FTHLG','FTHLG_SUM','FTHLG_SUM_Manager_Comments_2','Test Manager Comments_2') +; + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values +('FTWET','FTWET_SUM','FTWET_SUM_Trac_H1','Tractor Model'), +('FTWET','FTWET_SUM','FTWET_SUM_Impement','Make of Implement'), +('FTWET','FTWET_SUM','FTWET_SUM_Cage_Wheel','Type of Cage Wheel'), +('FTWET','FTWET_SUM','FTWET_SUM_Test_Condition','Test Condition:'), +('FTWET','FTWET_SUM','FTWET_SUM_Manager_Comment','Test Manager Comments') +; + + + +insert into mmt_ods.mmt_config +(file_format,sheet_mnemonic,rank_tag,f1_modified) +values ('PTOBST','PTOBST_RPT','PTOBST_RPT_test_tractor_specifiactions','Test Tractor Specifiactions'), +('PTOBST','PTOBST_RPT','PTOBST_RPT_PTO_performance_report','PTO Performance Report'), +('PTOBST','PTOBST_RPT','PTOBST_RPT_MMTKeyword1','MMTKeyword1'), +('PTOBST','PTOBST_RPT','PTOBST_RPT_MMTKeyword2','MMTKeyword2'), +('PTOBST','PTOBST_RPT','PTOBST_RPT_PTO_Performance_Test_Observations_Summary','PTO Performance Test Observations Summary'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_key_perfomrance_parameters','Key Performance Parameters'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_boostmode_maxpower_test','Max Power Occurring Test'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_2Hrs_max_power_test','2Hrs Max Power Test'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_varying_speed_test','Varying Speed Test - Full Throttle Performance'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_part_load_rated_rpm,','Part load @ Rated RPM'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_varying_load,','Varying load @ STD. PTO'), +('PTOBST','PTOBST_PNA','PTOBST_PNA_smoke_test','Smoke Test'), +('PTOBST','PTOBST_PHA','PTOBST_PHA_KEY_performance_parameters','KEY Performance Parameters'), +('PTOBST','PTOBST_PHA','PTOBST_PHA_2Hrs_max_power_test','2Hrs Max Power Test'), +('PTOBST','PTOBST_PHA','PTOBST_PHA_varying_speed_test','Varying Speed Test'), +('PTOBST','PTOBST_PHA','PTOBST_PHA_Engine_oil_consumption','Engine Oil Consumption'), +('PTOBST','PTOBST_MPM','PTOBST_MPM_performance_boost_natuaral','Performance - Boost Mode @ Natural Ambient'), +('PTOBST','PTOBST_GVG','PTOBST_GVG_performance_governing_trails','Governing Trails on Boost Mode'), +('PTOBST','PTOBST_GVG','PTOBST_GVG_graphs','Graphs - for Example') + + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/DBOECD-TEST-blocktables.txt b/deployment-20210427T103328Z-001/deployment/createtables/DBOECD-TEST-blocktables.txt new file mode 100644 index 0000000..b5839da --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/DBOECD-TEST-blocktables.txt @@ -0,0 +1,750 @@ +/ create block tables / + +SET search_path TO mmt_staging2; + +drop table if exists mmt_staging2.dboecd_test_transmission_wheels_int; +drop table if exists mmt_staging2.dboecd_test_h1_int; +drop table if exists mmt_staging2.dboecd_test_engine_rpm_engine_to_pto_block; +drop table if exists mmt_staging2.dboecd_test_engine_rpm_required_pull_block; +drop table if exists mmt_staging2.dboecd_test_engine_rpm_weight_block; +drop table if exists mmt_staging2.dboecd_test_engine_rpm_tyre_details_block; +drop table if exists mmt_staging2.dboecd_test_engine_RPM_tyre_details_int; +drop table if exists mmt_staging2.dboecd_test_test_condition_block; +drop table if exists mmt_staging2.dboecd_test_drawbar_performance_selected_summary_block; +drop table if exists mmt_staging2.dboecd_test_drawbar_performance_gear_performance_block; +drop table if exists mmt_staging2.dboecd_test_drawbar_performance_fuel_consumption_block; +drop table if exists mmt_staging2.dboecd_test_test_equipment_used_block; +drop table if exists mmt_staging2.dboecd_test_measurement_uncertainty_block; +drop table if exists mmt_staging2.dboecd_test_tractor_specifications_engine_details_block; +drop table if exists mmt_staging2.dboecd_test_tractor_specifications_cylinders_block; +drop table if exists mmt_staging2.dboecd_test_tractor_specifications_fuel_and_injection_block; +drop table if exists mmt_staging2.dboecd_test_tractor_specifications_cleaner_block; +drop table if exists mmt_staging2.dboecd_test_transmission_clutch_block; +drop table if exists mmt_staging2.dboecd_test_transmission_drawbar_block; +drop table if exists mmt_staging2.dboecd_test_transmission_speed_chart_desc_block; +drop table if exists mmt_staging2.dboecd_test_transmission_wheels_block; +drop table if exists mmt_staging2.dboecd_test_transmission_fuel_lubricant_int; +drop table if exists mmt_staging2.dboecd_test_remarks_block; +drop table if exists mmt_staging2.dboecd_test_remarks_footer_block; +drop table if exists mmt_staging2.dboecd_test_h1_block; +drop table if exists mmt_staging2.dboecd_test_transmission_fuel_lubricant_block; +drop table if exists mmt_staging2.dboecd_test_engine_rpm_rpm_block; +drop table if exists mmt_staging2.dboecd_test_transmission_speed_chart_block; +drop table if exists mmt_staging2.stg_specific_table_dboecd_test; +drop table if exists mmt_staging2.stg_process_table_dboecd_test; + +create table mmt_staging2.DBOECD_TEST_H1_INT +(syspk serial, +dummy_f text, +file_syspk int, +client_id int, +function_id int, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text, +c2 text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_TEST_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Test_Location text, +Operator_Name text, +Project_Group text, +Objective text, +Acceptance_criteria text, +rank number, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBOECD_test_engine_RPM_RPM_block +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int,make text,model text,file_format text,sheet_mnemonic text,low_idle_declared text,high_idle_declared text,low_idle_observed text,high_idle_observed text,create_time timestamp DEFAULT current_timestamp); + +create table mmt_staging2.DBOECD_test_engine_RPM_engine_to_PTO_block(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int,make text,model text, file_format text,sheet_mnemonic text,rated_speed text,engine_to_PTO_ratio text, wheel_base_mm text,engine_power_hp text,PTO_Power_hp text,create_time timestamp DEFAULT current_timestamp); + +create table mmt_staging2.DBOECD_test_engine_RPM_required_pull_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +pull_type text, +required_pull_in_kg text, +required_power_in_hp text, +actual_pull_in_kg text, +actual_power_in_hp text, +calculated_hitch_height_mm text, +actual_hitch_height_mm text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_engine_RPM_weight_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +weight_kg text, +Front text, +rear text, +Total text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBOECD_test_engine_RPM_tyre_details_int +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +s_no text, +tyre_details text, +front text, +rear text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_engine_RPM_tyre_details_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +model text, +Make text, +file_format text, +sheet_mnemonic text, +tyre_make text, +size text, +Ply_Rating text, +Load_Carrying_Capacity_in_Kg text, +Pressure_kg_cm2 text, +Number_of_lug text, +Number_of_no_load_lug_30m text, +Lug_Height text, +Dynamic_rolling_radius_mm text, +Wheel_Rim_Make_Size text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_test_condition_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text, +c2 text, +c3 text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_drawbar_performance_selected_summary_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text , +c2 text , +c3 text , +c4 text , +c5 text , +c6 text , +c7 text , +c8 text , +c9 text , +c10 text , +c11 text , +c12 text , +c13 text , +c14 text , +c15 text , +c16 text , +c17 text , +c18 text , +c19 text , +c20 text , +c21 text , +c22 text , +c23 text , +c24 text , +c25 text , +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_drawbar_performance_gear_performance_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text , +c2 text , +c3 text , +c4 text , +c5 text , +c6 text , +c7 text , +c8 text , +c9 text , +c10 text , +c11 text , +c12 text , +c13 text , +c14 text , +c15 text , +c16 text , +c17 text , +c18 text , +c19 text , +c20 text , +c21 text , +c22 text , +c23 text , +c24 text , +c25 text , +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_drawbar_performance_fuel_consumption_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1_1 text, +c2_1 text, +c1 text , +c2 text , +c3 text , +c4 text , +c5 text , +c6 text , +c7 text , +c8 text , +c9 text , +c10 text , +c11 text , +c12 text , +c13 text , +c14 text , +c15 text , +c16 text , +c17 text , +c18 text , +c19 text , +c20 text , +c21 text , +c22 text , +c23 text , +c24 text , +c25 text , +Remark text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_test_equipment_used_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +s_no text, +instruments text, +instruments_no text, +cali_due_date text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBOECD_test_measurement_uncertainty_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +load_cell text, +rpm_meter text, +speed text, +fuel_flow_meter text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_tractor_specifications_engine_details_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make_in_block text, +type text, +model_in_block text, +serial_no text, +E_P_Ratio text, +rated_speed text, +high_idle text, +low_Idle text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_tractor_specifications_cylinders_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +number text, +stroke text, +bore text, +capacity text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_tractor_specifications_fuel_and_injection_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +capacity_of_fuel_tank_lit text, +make_type_and_model_of_injection_pump text, +manufacturer_production_setting text, +make_type_and_model_of_injectors text, +make_type_and_model_of_magneto_coil_and_distributor text, +make_type_and_model_of_carburetor text, +ignition_or_injection_timing_Manual_or_automatic text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_tractor_specifications_cleaner_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +cleaner_type text, +make_and_model text, +type text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_transmission_clutch_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +clutch_type text, +steering_type text, +diameter_of_disc_mm text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_transmission_drawbar_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Type text, +Height_above_ground_max_mm text , +Height_above_ground_min_mm text, +Position_related_to_PTO text, +Wheel_Base text, +test_condition text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_transmission_speed_chart_desc_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +descr text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_transmission_speed_chart_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +tyre_condition text, +gear text, +forward text, +reverse text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_transmission_wheels_int +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Descriptions text, +Steered_wheels text, +Driving_wheel text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBOECD_test_transmission_wheels_block + ( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Make_of_tyres text, +Types text, +Size text, +Maximum_permissible_load_kg text, +Ply_rating text, +Track_width_max_mm text, +Track_width_min_mm text, +Inflation_pressure_kg_cm2 text, +Location_of_driving_wheel text, +create_time timestamp DEFAULT current_timestamp + ); + + +create table mmt_staging2.DBOECD_test_transmission_fuel_lubricant_int +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Descriptions text, +Diesel_BS_IV text, +Engine_oil text, +Transmission_oil text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_transmission_fuel_lubricant_block + ( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, + Trade_name text, +type text, +Octane_Cetane_number text, +Viscosity text, +Density_at_15C text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_remarks_block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +remarks text, +parameter text, +acceptance_criteria text, +observations text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBOECD_test_remarks_footer_block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +approved_by text, +date text, +replaces text, +revision_no text, +comments text, +rev1 text, +rev2 text, +rev3 text, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_dboecd_test ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_dboecd_test ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/createtables/DBSTD_TEST_create-block-tables.txt b/deployment-20210427T103328Z-001/deployment/createtables/DBSTD_TEST_create-block-tables.txt new file mode 100644 index 0000000..cee5874 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/DBSTD_TEST_create-block-tables.txt @@ -0,0 +1,695 @@ +/* create block tables */ + +SET search_path TO mmt_staging2; + +drop table if exists mmt_staging2.dbstd_test_transmission_wheels_int; +drop table if exists mmt_staging2.dbstd_test_h1_int; +drop table if exists mmt_staging2.dbstd_test_engine_rpm_engine_to_pto_block; +drop table if exists mmt_staging2.dbstd_test_engine_rpm_required_pull_block; +drop table if exists mmt_staging2.dbstd_test_engine_rpm_weight_block; +drop table if exists mmt_staging2.dbstd_test_engine_rpm_tyre_details_block; +drop table if exists mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int; +drop table if exists mmt_staging2.dbstd_test_test_condition_block; +drop table if exists mmt_staging2.dbstd_test_drawbar_performance_selected_summary_block; +drop table if exists mmt_staging2.dbstd_test_drawbar_performance_gear_performance_block; +drop table if exists mmt_staging2.dbstd_test_test_equipment_used_block; +drop table if exists mmt_staging2.dbstd_test_measurement_uncertainty_block; +drop table if exists mmt_staging2.dbstd_test_tractor_specifications_engine_details_block; +drop table if exists mmt_staging2.dbstd_test_tractor_specifications_cylinders_block; +drop table if exists mmt_staging2.dbstd_test_tractor_specifications_fuel_and_injection_block; +drop table if exists mmt_staging2.dbstd_test_tractor_specifications_cleaner_block; +drop table if exists mmt_staging2.dbstd_test_transmission_clutch_block; +drop table if exists mmt_staging2.dbstd_test_transmission_drawbar_block; +drop table if exists mmt_staging2.dbstd_test_transmission_speed_chart_desc_block; +drop table if exists mmt_staging2.dbstd_test_transmission_wheels_block; +drop table if exists mmt_staging2.dbstd_test_transmission_fuel_lubricant_int; +drop table if exists mmt_staging2.dbstd_test_remarks_block; +drop table if exists mmt_staging2.dbstd_test_remarks_footer_block; +drop table if exists mmt_staging2.dbstd_test_h1_block; +drop table if exists mmt_staging2.dbstd_test_transmission_fuel_lubricant_block; +drop table if exists mmt_staging2.dbstd_test_engine_rpm_rpm_block; +drop table if exists mmt_staging2.dbstd_test_transmission_speed_chart_block; +drop table if exists mmt_staging2.stg_specific_table_dbstd_test; +drop table if exists mmt_staging2.stg_process_table_dbstd_test; + +create table mmt_staging2.DBSTD_TEST_H1_INT (syspk serial,dummy_f text,file_syspk int,client_id int,function_id int,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.DBSTD_TEST_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Test_Location text, +Operator_Name text, +Project_Group text, +Objective text, +Acceptance_criteria text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBSTD_test_engine_RPM_RPM_block +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int,make text,model text,file_format text,sheet_mnemonic text,low_idle_declared text,high_idle_declared text,low_idle_observed text,high_idle_observed text,create_time timestamp DEFAULT current_timestamp); + +create table mmt_staging2.DBSTD_test_engine_RPM_engine_to_PTO_block(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int,make text,model text, file_format text,sheet_mnemonic text,rated_speed text,engine_to_PTO_ratio text, wheel_base_mm text,engine_power_hp text,PTO_Power_hp text,create_time timestamp DEFAULT current_timestamp); + +create table mmt_staging2.DBSTD_test_engine_RPM_required_pull_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +pull_type text, +required_pull_in_kg text, +required_power_in_hp text, +actual_pull_in_kg text, +actual_power_in_hp text, +calculated_hitch_height_mm text, +actual_hitch_height_mm text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_engine_RPM_weight_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +weight_kg text, +Front text, +rear text, +Total text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBSTD_test_engine_RPM_tyre_details_int +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +s_no text, +tyre_details text, +front text, +rear text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_engine_RPM_tyre_details_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +model text, +Make text, +file_format text, +sheet_mnemonic text, +tyre_make text, +size text, +Ply_Rating text, +Load_Carrying_Capacity_in_Kg text, +Pressure_kg_cm2 text, +Number_of_lug text, +Number_of_no_load_lug_30m text, +Lug_Height text, +Dynamic_rolling_radius_mm text, +Wheel_Rim_Make_Size text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_test_condition_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text, +c2 text, +c3 text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_drawbar_performance_selected_summary_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text , +c2 text , +c3 text , +c4 text , +c5 text , +c6 text , +c7 text , +c8 text , +c9 text , +c10 text , +c11 text , +c12 text , +c13 text , +c14 text , +c15 text , +c16 text , +c17 text , +c18 text , +c19 text , +c20 text , +c21 text , +c22 text , +c23 text , +c24 text , +c25 text , +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_drawbar_performance_gear_performance_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +c1 text , +c2 text , +c3 text , +c4 text , +c5 text , +c6 text , +c7 text , +c8 text , +c9 text , +c10 text , +c11 text , +c12 text , +c13 text , +c14 text , +c15 text , +c16 text , +c17 text , +c18 text , +c19 text , +c20 text , +c21 text , +c22 text , +c23 text , +c24 text , +c25 text , +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_test_equipment_used_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +s_no text, +instruments text, +instruments_no text, +cali_due_date text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.DBSTD_test_measurement_uncertainty_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +load_cell text, +rpm_meter text, +speed text, +fuel_flow_meter text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_tractor_specifications_engine_details_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make_in_block text, +type text, +model_in_block text, +serial_no text, +E_P_Ratio text, +rated_speed text, +high_idle text, +low_Idle text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_tractor_specifications_cylinders_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +number text, +stroke text, +bore text, +capacity text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_tractor_specifications_fuel_and_injection_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +capacity_of_fuel_tank_lit text, +make_type_and_model_of_injection_pump text, +manufacturer_production_setting text, +make_type_and_model_of_injectors text, +make_type_and_model_of_magneto_coil_and_distributor text, +make_type_and_model_of_carburetor text, +ignition_or_injection_timing_Manual_or_automatic text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_tractor_specifications_cleaner_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +cleaner_type text, +make_and_model text, +type text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_transmission_clutch_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +clutch_type text, +steering_type text, +diameter_of_disc_mm text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_transmission_drawbar_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Type text, +Height_above_ground_max_mm text , +Height_above_ground_min_mm text, +Position_related_to_PTO text, +Wheel_Base text, +test_condition text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_transmission_speed_chart_desc_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +descr text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_transmission_speed_chart_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +tyre_condition text, +gear text, +forward text, +reverse text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.dbstd_test_transmission_wheels_int +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Descriptions text, +Steered_wheels text, +Driving_wheel text, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.dbstd_test_transmission_wheels_block + ( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Make_of_tyres text, +Types text, +Size text, +Maximum_permissible_load_kg text, +Ply_rating text, +Track_width_max_mm text, +Track_width_min_mm text, +Inflation_pressure_kg_cm2 text, +Location_of_driving_wheel text + ); + + +create table mmt_staging2.DBSTD_test_transmission_fuel_lubricant_int +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Descriptions text, +Diesel_BS_IV text, +Engine_oil text, +Transmission_oil text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_transmission_fuel_lubricant_block + ( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, + Trade_name text, +type text, +Octane_Cetane_number text, +Viscosity text, +Density_at_15C text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_remarks_block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +remarks text, +parameter text, +acceptance_criteria text, +observations text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.DBSTD_test_remarks_footer_block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +date text, +replaces text, +revision_no text, +comments text, +rev1 text, +rev2 text, +rev3 text, +create_time timestamp DEFAULT current_timestamp +); + + +create TABLE mmt_staging2.stg_process_table_dbstd_test ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_dbstd_test ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/createtables/PTO-create-blocktables b/deployment-20210427T103328Z-001/deployment/createtables/PTO-create-blocktables new file mode 100644 index 0000000..f424c1e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/PTO-create-blocktables @@ -0,0 +1,1402 @@ + +SET search_path TO mmt_staging2; + +drop table if exists mmt_staging2.stg_process_table_PTO_report; +drop table if exists mmt_staging2.stg_specific_table_PTO_report; +drop table if exists mmt_staging2.stg_specific_table_PTO_report; +drop table if exists mmt_staging2.stg_process_table_PTO_PNA; +drop table if exists mmt_staging2.stg_specific_table_PTO_PNA; +drop table if exists mmt_staging2.stg_process_table_PTO_PHA; +drop table if exists mmt_staging2.stg_specific_table_PTO_PHA; +drop table if exists mmt_staging2.stg_process_table_PTO_MPM; +drop table if exists mmt_staging2.stg_specific_table_PTO_MPM; +drop table if exists mmt_staging2.stg_process_table_PTO_GVG; +drop table if exists mmt_staging2.stg_specific_table_PTO_GVG; +drop table if exists mmt_staging2.PTOBST_RPT_tractor_specs_block; +drop table if exists mmt_staging2.PTOBST_RPT_PTO_performance_report_block; +drop table if exists mmt_staging2.PTOBST_RPT_MMTKeyword1_block; +drop table if exists mmt_staging2.PTOBST_RPT_MMTKeyword2_block; +drop table if exists mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block; +drop table if exists mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int; +drop table if exists mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block; +drop table if exists mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block; +drop table if exists mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block; +drop table if exists mmt_staging2.PTOBST_PNA_varying_speed_test_block; +drop table if exists mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block; +drop table if exists mmt_staging2.PTOBST_PNA_varying_load_block; +drop table if exists mmt_staging2.PTOBST_PNA_smoke_test_block; +drop table if exists mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block; +drop table if exists mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block; +drop table if exists mmt_staging2.PTOBST_PHA_varying_speed_test_block; +drop table if exists mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block; +drop table if exists mmt_staging2.ptobst_mpm_performance_boost_natuaral_block; +drop table if exists mmt_staging2.PTOBST_GVG_performance_governing_trails_block; + +create table mmt_staging2.PTOBST_RPT_tractor_specs_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +date text, +steering_type text, +Engine_to_PTO_ratio text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.PTOBST_RPT_PTO_performance_report_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +rank int, +test_condition text, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.PTOBST_RPT_MMTKeyword1_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.PTOBST_RPT_MMTKeyword2_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +rank int, +test_condition text, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +/*PNA*/ + +create table mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int +( +file_syspk serial, +c1 text, +c2 text, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +PTO_SFC_gm_hp text, +PTO_power_hp text, +Test_engineer text, +Coolant_temp text, +Exhaust_temperature text, +Rated_engine_speed text, +Maximum_Equ_Crankshaft text, +Place text, +Relative_humidity text, +Test_bed text, +Total_run_hrs text, +Engine_low_idle_speed text, +Engine_high_Idle_speed text, +Ambient_pressure_mm_of_hg text, +Engine_oil_pressure_bar text, +Equ_crankshaft_torque_at_maximum_power text, +Specific_gravity_of_Fuel text, +Dyno_Constant text, +Backup_Torque text, +PTO_gear_ratio text, +Engine_oil_temp text, +Test_date text, +back_pressure text, +rank int, +ods_record int default 1 +); + +create table mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + + + +create table mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + + +create table mmt_staging2.PTOBST_PNA_varying_speed_test_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + +create table mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c1 text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + + +create table mmt_staging2.PTOBST_PNA_varying_load_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c1 text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + + +create table mmt_staging2.PTOBST_PNA_smoke_test_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +rank int, +ods_record int default 1 +); + +/* PTA block */ + + +create table mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int +( +file_syspk serial, +c1 text, +c2 text, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +PTO_SFC_gm_hp text, +PTO_power_hp text, +Test_engineer text, +Coolant_temp text, +Exhaust_temperature text, +Rated_engine_speed text, +Maximum_Equ_Crankshaft text, +Place text, +Relative_humidity text, +Test_bed text, +Total_run_hrs text, +Engine_low_idle_speed text, +Engine_high_Idle_speed text, +Ambient_pressure_mm_of_hg text, +Engine_oil_pressure_bar text, +Equ_crankshaft_torque_at_maximum_power text, +Specific_gravity_of_Fuel text, +Dyno_Constant text, +Backup_Torque text, +PTO_gear_ratio text, +Engine_oil_temp text, +Test_date text, +back_pressure text, +rank int, +ods_record int default 1 +); + + +create table mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + + + +CREATE TABLE mmt_staging2.ptobst_pha_engine_oil_consumption_block ( + syspk serial NOT NULL, + client_id int4 NULL, + function_id int4 NULL, + file_syspk int4 NULL, + dummy_f text NULL, + file_format text NULL, + sheet_mnemonic text NULL, + make text NULL, + model text NULL, + test_condition text NULL, + c2 text NULL, + c3 text NULL, + c5 text NULL, + rank int NULL, + ods_record int4 NULL DEFAULT 1 +); + + +create table mmt_staging2.PTOBST_PHA_varying_speed_test_block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +file_format text, +sheet_mnemonic text, +make text, +model text, +test_condition text, +c2 text, +c3 text, +c4 text, +c5 text, +c6 text, +c7 text, +c8 text, +c9 text, +c10 text, +c11 text, +c12 text, +c13 text, +c14 text, +c15 text, +c16 text, +c17 text, +c18 text, +c19 text, +c20 text, +c21 text, +c22 text, +c23 text, +c24 text, +c25 text, +rank int, +ods_record int default 1 +); + + + +CREATE TABLE mmt_staging2.ptobst_mpm_performance_boost_natuaral_block ( + syspk serial NOT NULL, + client_id int4 NULL, + function_id int4 NULL, + file_syspk int4 NULL, + dummy_f text NULL, + file_format text NULL, + sheet_mnemonic text NULL, + make text NULL, + model text NULL, + test_condition text NULL, + c2 text NULL, + c3 text NULL, + c4 text NULL, + c5 text NULL, + rank int NULL, + ods_record int4 NULL DEFAULT 1, + create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP +); + + +create TABLE mmt_staging2.PTOBST_GVG_performance_governing_trails_block ( +syspk serial NOT NULL, +client_id int4 NULL, +function_id int4 NULL, +file_syspk int4 NULL, +dummy_f text NULL, +file_format text NULL, +sheet_mnemonic text NULL, +make text NULL, +model text NULL, +test_condition text NULL, +c1 text null, +c2 text null, +c3 text null, +c4 text null, +c5 text null, +c6 text null, +c7_1 text null, +c7 text null, +c8 text null, +c9 text null, +c10 text null, +c11 text null, +c12_1 text null, +c12 text null, +c13 text null, +c14 text null, +c15 text null, +c16 text null, +c17_1 text null, +c17 text null, +c18 text null, +c19 text null, +c20 text null, +c21 text null, +c22_1 text null, +c22 text null, +c23 text null, +c24 text null, +c25 text null, +c26 text null, +c27 text null, +c27_1 text null, +c28 text null, +c29 text null, +c30 text null, +c31 text null, +c32_1 text null, +c32 text null, +c33 text null, +c34 text null, +c35 text null, +c36 text null, +rank int, +ods_record int4 NULL DEFAULT 1, +create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP +); + + +/*sheet */ + +create TABLE mmt_staging2.stg_process_table_PTO_report ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_PTO_report ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + + +create TABLE mmt_staging2.stg_process_table_PTO_PNA ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_PTO_PNA ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + + + +create TABLE mmt_staging2.stg_process_table_PTO_PHA ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_PTO_PHA ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + + +create TABLE mmt_staging2.stg_process_table_PTO_MPM ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_PTO_MPM ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + + +create TABLE mmt_staging2.stg_process_table_PTO_GVG ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_PTO_GVG ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create-config.txt b/deployment-20210427T103328Z-001/deployment/createtables/create-config.txt new file mode 100644 index 0000000..8f6f81e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create-config.txt @@ -0,0 +1,37 @@ +drop table if exists mmt_ods.mmt_config; +create table mmt_ods.mmt_config +( +syspk serial primary key, +file_format varchar(100), +sheet_format varchar(100), +target_table varchar(100), +F1_source varchar(100), +F1_modified varchar(100), +row_number_start int, +row_previous_number int, +row_read_end int, +run_time timestamp, +action varchar(50), +run_date date null, +active_status int default 0 +); +create unique index i_file_format_mmt_config on mmt_ods.mmt_config(file_format,sheet_format,F1_modified); + +DROP TABLE if exists fw_DB_errors; + + CREATE TABLE fw_DB_Errors + ( syspk bigserial NOT NULL, + client_id int, + function_id int, + user_id int, + user_name text, + error_procedure text, + error_state text, + error_message text, + error_detail text, + error_hint text, + error_context text, + error_timestamp timestamp default now(), + CONSTRAINT fw_DB_error_pkey PRIMARY KEY (syspk) + ); + \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTDRY_SUM.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTDRY_SUM.sql new file mode 100644 index 0000000..bc2e34f --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTDRY_SUM.sql @@ -0,0 +1,337 @@ +SET search_path TO mmt_staging2; + + +drop table if exists mmt_staging2.FTDRY_SUM_Trac_H1_Block; + +drop table if exists mmt_staging2.FTDRY_SUM_Implement_Block; + +drop table if exists mmt_staging2.FTDRY_SUM_Test_Condition_1_Block; + +drop table if exists mmt_staging2.FTDRY_SUM_Test_Condition_2_Block; + +drop table if exists mmt_staging2.FTDRY_SUM_Comments_By_Block; + +drop table if exists mmt_staging2.stg_process_table_ftdry_sum; + +drop table if exists mmt_staging2.stg_specific_table_ftdry_sum; + +create table mmt_staging2.FTDRY_SUM_Trac_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Tractor_Model text, +Tractor_Make text, +Tractor_Engine_HP text, +Rated_RPM text, +Transmission_Type text, +Wheel_Drive_Type text, +FIP_Type text, +Steering_Type text, +Tractor_Weight_kg_Front text, +Tractor_Weight_kg_Rear text, +Tractor_Weight_kg_Total text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + + +create table mmt_staging2.FTDRY_SUM_Implement_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Make_of_Implement text, +Implement_Type text, +Implement_Size text, +Hitch_Category text, +Implement_Weight text, +Soil_Type text, +Moisture_Content text, +Bulk_Density_g_cc text, +Soil_Cone_index text, +Field_Condition text, +Season text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +test_iterationnumber text, +Test_Condition text, +Test_Date text, +Tractor_Model text, +Engine_RPM_set text, +PTO_RPM_set text, +Gear_Used text, +Nominal_Speed_KMPH text, +Engine_RPM_Drop_on_straight text, +Engine_RPM_Drop_on_turn text, +Depth_of_cut_cm text, +No_load_speed_kmph text, +On_load_speed_kmph text, +wheel_slippage_ text, +Fuel_consumption_lit_hr text, +Area_covered_acr_hr text, +Fuel_consumption_lit_Acr text, +M_M_Performance_in_compared_to_respective_competitor_tractors text, +Fuel_consumption_lit_hr_2 text, +Area_covered_acr_hr_2 text, +Fuel_consumption_lit_Acr_2 text, +Trail_Observations text, +Engine_Smoke_on_Load text, +Engine_acceleration_smoke text, +Draft_Response text, +Tractor_Steer_ability text, +Tractor_braking_performance 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_Lowering_response text, +Pulverization_Quality text, +Pulverization_Index text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +test_iterationnumber text, +Test_Condition text, +Test_Date text, +Tractor_Model text, +Engine_RPM_set text, +PTO_RPM_set text, +Gear_Used text, +Nominal_Speed_KMPH text, +Engine_RPM_Drop_on_straight text, +Engine_RPM_Drop_on_turn text, +Depth_of_cut_cm text, +No_load_speed_kmph text, +On_load_speed_kmph text, +wheel_slippage_ text, +Fuel_consumption_lit_hr text, +Area_covered_acr_hr text, +Fuel_consumption_lit_Acr text, +M_M_Performance_in_compared_to_respective_competitor_tractors text, +Fuel_consumption_lit_hr_2 text, +Area_covered_acr_hr_2 text, +Fuel_consumption_lit_Acr_2 text, +Trail_Observations text, +Engine_Smoke_on_Load text, +Engine_acceleration_smoke text, +Draft_Response text, +Tractor_Steer_ability text, +Tractor_braking_performance 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_Lowering_response text, +Pulverization_Quality text, +Pulverization_Index text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTDRY_SUM_Comments_By_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Tractor_model text, +Test_Engineer_Comments_1 text, +Test_Manager_Comments_1 text, +Test_Engineer_Comments_2 text, +Test_Manager_Comments_2 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + + + +create TABLE mmt_staging2.stg_process_table_ftdry_sum ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_ftdry_sum ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTHLG_SUM.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTHLG_SUM.sql new file mode 100644 index 0000000..da598f7 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTHLG_SUM.sql @@ -0,0 +1,335 @@ +SET search_path TO mmt_staging2; + +drop table if exists mmt_staging2.FTHLG_SUM_Trac_H1_Block; + +drop table if exists mmt_staging2.FTHLG_SUM_Trail_Type_Block; + +drop table if exists mmt_staging2.FTHLG_SUM_Test_Condition_1_Block; + +drop table if exists mmt_staging2.FTHLG_SUM_Test_Condition_2_Block; + +drop table if exists mmt_staging2.FTHLG_SUM_Comments_By_Block; + + +drop table if exists mmt_staging2.stg_process_table_fthlg_sum; + + +drop table if exists mmt_staging2.stg_specific_table_fthlg_sum; + + +create table mmt_staging2.FTHLG_SUM_Trac_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +tractor_model text, +tractor_make text, +tractor_engine_hp text, +rated_rpm text, +transmission_type text, +wheel_drive_type text, +fip_type text, +steering_type text, +tractor_weight_kg_front text, +tractor_weight_kg_rear text, +tractor_weight_kg_total text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + + +create table mmt_staging2.FTHLG_SUM_Trail_Type_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Trailer_Type text, +Tire_size_and_inflation_pressure_psi text, +No_Of_Axle text, +No_Of_Wheels text, +Trailer_Gross_Weight_Kg text, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm text, +Tractor_Hitch_Height_from_Ground_mm text, +Trailer_hitch_Height_above_ground_level_mm text, +Gradient_Slope_1_Degree text, +Gradient_Slope_2_degree text, +Tractor_Hitch_Type text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +test_iterationnumber text, +Test_Condition text, +Test_Date text, +Tractor_Model text, +Fuel_consumption_Ltr_hr text, +Mileage_Km_Ltr text, +Average_speed_of_travel_kmph text, +Total_distance_travelled_km text, +Gear_used_on_Straight_Road text, +Straight_road_RPM_Drop text, +Gear_used_on_Up_Slope_1 text, +Up_Slope_RPM_Drop_1 text, +Gear_used_on_Up_Slope_2 text, +Up_Slope_RPM_Drop_2 text, +Gear_used_on_Down_Slope text, +Down_Slope_RPM_Shoot_up text, +M_M_Performance_compared_to_respective_competitor_tractors_is_better_and_is_poor_than_competitor text, +Fuel_consumption_lit_hr_2 text, +Mileage_Km_Ltr_2 text, +M_M_Performance_in_compared_to_respective_competitor_tractors text, +Fuel_consumption_lit_hr_3 text, +Mileage_Km_Ltr_3 text, +Engine_Smoke_on_Load text, +Engine_acceleration_smoke text, +Range_Gear_Shifting text, +Speed_Gear_Shifting text, +Tractor_Steer_ability text, +Tractor_braking_performance text, +Front_Visibility text, +Implement_Accessibility text, +Front_end_lifting_during_operation text, +RPM_Recovery_Time text, +Engine_Vibration text, +Engine_Sound text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +test_iterationnumber text, +Test_Condition text, +Test_Date text, +Tractor_Model text, +Fuel_consumption_Ltr_hr text, +Mileage_Km_Ltr text, +Average_speed_of_travel_kmph text, +Total_distance_travelled_km text, +Gear_used_on_Straight_Road text, +Straight_road_RPM_Drop text, +Gear_used_on_Up_Slope_1 text, +Up_Slope_RPM_Drop_1 text, +Gear_used_on_Up_Slope_2 text, +Up_Slope_RPM_Drop_2 text, +Gear_used_on_Down_Slope text, +Down_Slope_RPM_Shoot_up text, +M_M_Performance_compared_to_respective_competitor_tractors_is_better_and_is_poor_than_competitor text, +Fuel_consumption_lit_hr_2 text, +Mileage_Km_Ltr_2 text, +M_M_Performance_in_compared_to_respective_competitor_tractors text, +Fuel_consumption_lit_hr_3 text, +Mileage_Km_Ltr_3 text, +Engine_Smoke_on_Load text, +Engine_acceleration_smoke text, +Range_Gear_Shifting text, +Speed_Gear_Shifting text, +Tractor_Steer_ability text, +Tractor_braking_performance text, +Front_Visibility text, +Implement_Accessibility text, +Front_end_lifting_during_operation text, +RPM_Recovery_Time text, +Engine_Vibration text, +Engine_Sound text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTHLG_SUM_Comments_By_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Tractor_Model text, +Test_Engineer_Comments_1 text, +Test_Manager_Comments_1 text, +Test_Engineer_Comments_2 text, +Test_Manager_Comments_2 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + + + +create TABLE mmt_staging2.stg_process_table_fthlg_sum ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_fthlg_sum ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTWET_SUM.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTWET_SUM.sql new file mode 100644 index 0000000..75fae71 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_table_FTWET_SUM.sql @@ -0,0 +1,303 @@ +SET search_path TO mmt_staging2; + + +drop table if exists mmt_staging2.FTWET_SUM_Trac_H1_Block; + +drop table if exists mmt_staging2.FTWET_SUM_Implement_Block; + +drop table if exists mmt_staging2.FTWET_SUM_Cage_Wheel_Block; +; +drop table if exists mmt_staging2.FTWET_SUM_Test_Condition_Block; + +drop table if exists mmt_staging2.FTWET_SUM_Comments_By_Block; + +drop table if exists mmt_staging2.stg_process_table_ftwet_sum; + +drop table if exists mmt_staging2.stg_specific_table_ftwet_sum; + + +create table mmt_staging2.FTWET_SUM_Trac_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Tractor_Model text, +Tractor_Make text, +Tractor_Engine_HP text, +Rated_RPM text, +Transmission_Type text, +Wheel_Drive_Type text, +FIP_Type text, +Steering_Type text, +Tractor_Weight_kg_Front text, +Tractor_Weight_kg_Rear text, +Tractor_Weight_kg_Total text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTWET_SUM_Implement_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Make_of_Implement text, +Implement_Type text, +Implement_Size text, +Hitch_Category text, +Implement_Weight text, +Soil_Type text, +Moisture_Content text, +Bulk_Density_g_cc text, +Soil_Cone_index text, +Field_Condition text, +Season text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.FTWET_SUM_Cage_Wheel_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Type_of_Cage_Wheel text, +Cage_Wheel_Width_mm text, +Cage_wheel_Weight text, +Cage_Wheel_inner_Outer_Ring_Dia_mm text, +Cage_Wheel_Center_Ring_Dia_mm text, +Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm text, +No_of_angles_on_cage_wheel text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTWET_SUM_Test_Condition_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +test_iterationnumber text, +Test_Condition text, +Test_Date text, +Tractor_Model text, +Engine_RPM_set text, +PTO_RPM_set text, +Gear_Used text, +Nominal_Speed_KMPH text, +Engine_RPM_Drop_on_straight_1st_Pass text, +Engine_RPM_Drop_on_straight_2nd_Pass text, +Engine_RPM_Drop_on_straight_3rd_Pass text, +Engine_RPM_Drop_on_turn_1st_Pass text, +Engine_RPM_Drop_on_turn_2nd_Pass text, +Engine_RPM_Drop_on_turn_3rd_Pass text, +No_of_passes text, +Avg_Depth_of_cut_cm text, +Fuel_consumption_lit_hr text, +Area_covered_acr_hr text, +Fuel_consumption_lit_Acr text, +M_M_Performance_in_compared_to_respective_competitor_tractors text, +Fuel_consumption_lit_hr_2 text, +Area_covered_acr_hr_2 text, +Fuel_consumption_lit_Acr_2 text, +Trail_Observations text, +Engine_Smoke_on_Load text, +Engine_acceleration_smoke text, +Draft_Response text, +Tractor_Steer_ability text, +Tractor_braking_performance 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_Lowering_response text, +Pulverization_Quality text, +Pulverization_Index text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.FTWET_SUM_Comments_By_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Tractor_Model text, +Test_Manager_Comments text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create TABLE mmt_staging2.stg_process_table_ftwet_sum ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_ftwet_sum ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_ARC.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_ARC.sql new file mode 100644 index 0000000..f48f75f --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_ARC.sql @@ -0,0 +1,223 @@ +drop table if exists mmt_staging2.BUDNI_ARC_Spec_H1_Block; +drop table if exists mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block; +drop table if exists mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block; +drop table if exists mmt_staging2.stg_process_table_BUDNI_ARC; +drop table if exists mmt_staging2.stg_specific_table_BUDNI_ARC; + +create table mmt_staging2.BUDNI_ARC_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +steering_type text, +Engine_to_PTO_ratio text, +Ballast_Condition text, +Test_Engine_Set_RPM text, +Type_of_track text , +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Temperature_C text, +Pressure_kPa text, +Relative_humidity text, +Mass_of_oil_before_test text, +Position_of_tractor text, +Loss_of_oil text, +Oil_pull_Over text, +Engine_oil_pressure text, +ods_record int default 1, +rank int,create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_ARC_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_BUDNI_ARC ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_ARC ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_BRK.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_BRK.sql new file mode 100644 index 0000000..3365f36 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_BRK.sql @@ -0,0 +1,440 @@ +drop table if exists mmt_staging2.BUDNI_BRK_Spec_H1_Block; +drop table if exists mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int; +drop table if exists mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block; +drop table if exists mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block; +drop table if exists mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block; +drop table if exists mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block; +drop table if exists mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block; +drop table if exists mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block; +drop table if exists mmt_staging2.BUDNI_BRK_other_observations_Block; +drop table if exists mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Int ; +drop table if exists mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block; +drop table if exists mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block; +drop table if exists mmt_staging2.stg_process_table_BUDNI_BRK; +drop table if exists mmt_staging2.stg_specific_table_BUDNI_BRK; + + +create table mmt_staging2.BUDNI_BRK_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +Type_of_brake text, +Type_of_track text , +brake_free_play_lh text, +brake_free_play_rh text, +maximum_attainable_speed_kmph_unballasted text, +maximum_attainable_speed_kmph_ballasted text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_Service_Barke_Test_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column1 text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_service_cold_standard_maximum_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +brake_test_type text, +brake_test_name text, +speed_condition text, +ballast_condition text, +Braking_device_control_force_N text, +Mean_deceleration_m_sec2 text, +Stopping_distance_m text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +brake_test_type text, +brake_test_name text, +speed_condition text, +ballast_condition text, +Braking_device_control_force_N text, +Mean_deceleration_m_sec2 text, +Stopping_distance_m text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_service_cold_standard_25kmph_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +brake_test_type text, +brake_test_name text, +speed_condition text, +ballast_condition text, +Braking_device_control_force_N text, +Mean_deceleration_m_sec2 text, +Stopping_distance_m text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +brake_test_type text, +brake_test_name text, +speed_condition text, +ballast_condition text, +Braking_device_control_force_N text, +Mean_deceleration_m_sec2 text, +Stopping_distance_m text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_service_fade_standard_maximum_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +brake_test_type text, +brake_test_name text, +speed_condition text, +ballast_condition text, +Braking_device_control_force_N text, +Mean_deceleration_m_sec2 text, +Stopping_distance_m text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +brake_test_type text, +brake_test_name text, +speed_condition text, +ballast_condition text, +Braking_device_control_force_N text, +Mean_deceleration_m_sec2 text, +Stopping_distance_m text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_other_observations_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column1 text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.budni_brk_parking_barke_test_int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column1 text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_BRK_Parking_Barke_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +particulars text, +facing text, +Braking_device_control_force text, +Efficacy_of_parking_brake text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + + +create table mmt_staging2.BUDNI_BRK_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_BUDNI_BRK ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_BRK ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_DBP.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_DBP.sql new file mode 100644 index 0000000..6601cbc --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_DBP.sql @@ -0,0 +1,214 @@ +drop table if exists mmt_staging2.BUDNI_DBP_Spec_H1_Block; + +drop table if exists mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block; + +drop table if exists mmt_staging2.stg_process_table_budni_dbp; + +drop table if exists mmt_staging2.stg_specific_table_budni_dbp; + +create table mmt_staging2.BUDNI_DBP_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +column14 text, +column15 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_DBP_Drawbar_Perf_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +column14 text, +column15 text, +column16 text, +column17 text, +column18 text, +column19 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create TABLE mmt_staging2.stg_process_table_budni_dbp ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_budni_dbp ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_FLD.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_FLD.sql new file mode 100644 index 0000000..3189664 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_FLD.sql @@ -0,0 +1,333 @@ +drop table if exists mmt_staging2.BUDNI_FLD_Spec_H1_Block; +drop table if exists mmt_staging2.BUDNI_FLD_Impl_Test_Int; +drop table if exists mmt_staging2.BUDNI_FLD_Impl_Test_Block; +drop table if exists mmt_staging2.BUDNI_FLD_Cage_Wheel_Block; +drop table if exists mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int; +drop table if exists mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block; +drop table if exists mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block; +drop table if exists mmt_staging2.stg_process_table_BUDNI_FLD; +drop table if exists mmt_staging2.stg_specific_table_BUDNI_FLD; + + +create table mmt_staging2.BUDNI_FLD_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +steering_type text, +Engine_to_PTO_ratio text, +Ballast_Condition text, +Test_Engine_Set_RPM text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_FLD_Impl_Test_INT +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_FLD_Impl_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +items text, +Make text, +type text, +No_of_Disc_blades text, +Type_of_Disc_blades text, +Size_of_bottoms_blades_1_mm text, +Size_of_bottoms_blades_2_mm text, +Size_of_bottoms_blades_3_mm text, +Spacing_of_bottoms_flanges_mm text, +Lower_hitch_point_span_mm text, +Mast_height_mm text, +Overall_dimensions_mm text, +Overall_dimensions_mm_length text, +Overall_dimensions_mm_Width text, +Overall_dimensions_mm_Height text, +Gross_mass_kg text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_FLD_Cage_Wheel_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +Items text, +type text, +Dia_mm text, +Width_mm text, +No_and_types_of_lugs text, +Size_of_angle_section_1_mm text, +Size_of_angle_section_2_mm text, +Size_of_angle_section_3_mm text, +Length_of_lugs_mm text, +Spacing_of_lugs_mm text, +Weight_of_each_cage_wheels_kg text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_FLD_Sum_Perf_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Parameter_operation text, +Type_of_soil text, +Av_soil_moisture_Av_depth_of_standing_water_cm text, +Bulk_density_of_soil_g_cc text, +Cone_index_kgf_sq_cm_Puddling_index text, +Gear_used text, +Av_speed_of_operation_kmph text, +Av_wheel_slip_Av_Travel_reduction text, +Av_depth_of_cut_cm_Av_Depth_of_puddle_cm text, +Av_working_width_cm text, +Area_covered_ha_h text, +Fuel_consumption text, +Fuel_consumption_l_h text, +Fuel_consumption_l_ha text, +Av_draft_of_implement_kN text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_FLD_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create TABLE mmt_staging2.stg_process_table_BUDNI_FLD ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_FLD ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HDL.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HDL.sql new file mode 100644 index 0000000..2239bce --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HDL.sql @@ -0,0 +1,302 @@ +drop table if exists mmt_staging2.stg_specific_table_budni_hdl; +drop table if exists mmt_staging2.stg_process_table_budni_hdl; +drop table if exists mmt_staging2.budni_hdl_Spec_H1_Block; +drop table if exists mmt_staging2.budni_hdl_power_test_Block; +drop table if exists mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block; +drop table if exists mmt_staging2.budni_hdl_Maintenance_of_lift_load_int; +drop table if exists mmt_staging2.budni_hdl_Maintenance_of_lift_load_Block; +drop table if exists mmt_staging2.budni_hdl_Test_Obs_Summary_Block; + + +create table mmt_staging2.budni_hdl_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +hydraulic_type text, +Pump_speed_at_rated_engine_speed_rpm text, +Steering_Type text, +Oil text, +Lift_Rod_type_LH text, +Lift_Rod_type_RH text, +Lift_Rod_Length_LH text, +Lift_Rod_Length_RH text, +Lower_link_Length_LH text, +Lower_link_Length_RH text, +Pump_HP text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.budni_hdl_power_test_block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Pump_delivery_rate_at_minimum_pressure_and_rated_engine_speed_l_min text, +Maximum_hydraulic_power_kW text, + Pump_delivery_rate_at_maximum_hydraulic_power_l_min text, + Pressure_at_maximum_hydraulic_power_MPa text, + Sustained_pressure_of_the_open_relief_valve_MPa text, +tapping_point_relief_valve_test text, +tapping_point_Pump_performance_test text, +tapping_point_Temperature_of_hydraulic_fluid_C text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.budni_hdl_Lifting_Capacity_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.budni_hdl_Maintenance_of_lift_load_int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.budni_hdl_Maintenance_of_lift_load_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Force_applied_at_the_frame_kN text, +Temperature_of_hydraulic_fluid_at_the_start_of_test_C text, +Elapsed_time_minute text, +Cumulative_drop_in_height_of_lift_mm text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.budni_hdl_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_budni_hdl ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_budni_hdl ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HLG.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HLG.sql new file mode 100644 index 0000000..431be6a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_HLG.sql @@ -0,0 +1,249 @@ +drop table if exists mmt_staging2.BUDNI_HLG_Spec_H1_Block; +drop table if exists mmt_staging2.BUDNI_HLG_Perf_Test_int; +drop table if exists mmt_staging2.BUDNI_HLG_Perf_Test_block; +drop table if exists mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block; +drop table if exists mmt_staging2.stg_process_table_BUDNI_HLG; +drop table if exists mmt_staging2.stg_specific_table_BUDNI_HLG; + + +create table mmt_staging2.BUDNI_HLG_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +steering_type text, +Engine_to_PTO_ratio text, +Ballast_Condition text, +Test_Engine_Set_RPM text, +Type_of_track text , +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_HLG_Perf_Test_int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column6 text, +column8 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_HLG_Perf_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +type_of_trailer text, +Gross_mass_of_trailer_tonne text, +Height_of_trailer_hitch_above_ground_level_mm text, +Gear_used_during_the_test_for_negotiating_slopes_up_to_8 text, +Average_travel_speed_kmph text, +Average_fuel_consumption text, +l_h text, +ml_km_tonne text, +Average_distance_traveled_per_litre_of_fuel_consumption_km text, +General_observations text, +Effectiveness_of_brakes text, +Maneuverability_of_tractor_trailer_combination text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_HLG_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_BUDNI_HLG ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_HLG ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_LCG.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_LCG.sql new file mode 100644 index 0000000..382608f --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_LCG.sql @@ -0,0 +1,203 @@ +drop table if exists mmt_staging2.BUDNI_LCG_Spec_H1_Block; + +drop table if exists mmt_staging2.BUDNI_LCG_Gravity_Test_Block; + +drop table if exists mmt_staging2.stg_specific_table_BUDNI_LCG; + +drop table if exists mmt_staging2.stg_process_table_BUDNI_LCG; + +create table mmt_staging2.BUDNI_LCG_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Tractor_HP text, +Rated_RPM text, +configuration text, +Transmission_type text, +Wheel_Drive_type text, +Wheel_Base text, +Wheel_track text, +Overall_height text, +Ballast_Condition text, +Tractor_Weight_reactions_Front text, +Tractor_Weight_reactions_Rear text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_LCG_Gravity_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create TABLE mmt_staging2.stg_process_table_BUDNI_LCG ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_LCG ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_NMT.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_NMT.sql new file mode 100644 index 0000000..37ee828 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_NMT.sql @@ -0,0 +1,348 @@ +drop table if exists mmt_staging2.BUDNI_NMT_Spec_H1_Block; +drop table if exists mmt_staging2.budni_nmt_noise_at_bystander_position_block; +drop table if exists mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block; +drop table if exists mmt_staging2.BUDNI_NMT_Meas_Results_1_Block; +drop table if exists mmt_staging2.budni_nmt_noise_at_operator_ear_level_block; +drop table if exists mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block; +drop table if exists mmt_staging2.BUDNI_NMT_Meas_Results_2_Block; +drop table if exists mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block; +drop table if exists mmt_staging2.stg_process_table_budni_nmt; +drop table if exists mmt_staging2.stg_specific_table_budni_nmt; + + +create table mmt_staging2.BUDNI_NMT_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +steering_type text, +Engine_to_PTO_ratio text, +Ballast_Condition text, +Test_Engine_Set_RPM text, +Type_of_track text , +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_NMT_Atmos_Cond_1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int +); + +create table mmt_staging2.BUDNI_NMT_Noise_at_bystander_position_block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_NMT_Meas_Results_1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_NMT_Noise_at_operator_ear_level_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_NMT_Atmos_Cond_2_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_NMT_Meas_Results_2_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_NMT_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_BUDNI_NMT ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_NMT ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_PTO.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_PTO.sql new file mode 100644 index 0000000..a6149b7 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_PTO.sql @@ -0,0 +1,282 @@ +drop table if exists mmt_staging2.stg_specific_table_BUDNI_PTO; +drop table if exists mmt_staging2.stg_process_table_BUDNI_PTO; +drop table if exists mmt_staging2.BUDNI_PTO_Spec_H1_Block; +drop table if exists mmt_staging2.BUDNI_PTO_Perf_Report_block; +drop table if exists mmt_staging2.BUDNI_PTO_MMTKeyword1_Block; +drop table if exists mmt_staging2.BUDNI_PTO_MMTKeyword2_Block; +drop table if exists mmt_staging2.BUDNI_PTO_Summary_Block; + + +create table mmt_staging2.BUDNI_PTO_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +steering_type text, +Engine_to_PTO_ratio text, +date date, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_PTO_Perf_Report_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_PTO_MMTKeyword1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_PTO_MMTKeyword2_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.BUDNI_PTO_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_BUDNI_PTO ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_PTO ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_VMT.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_VMT.sql new file mode 100644 index 0000000..322678e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_BUDNI_VMT.sql @@ -0,0 +1,224 @@ +drop table if exists mmt_staging2.BUDNI_VMT_Spec_H1_Block; +drop table if exists mmt_staging2.BUDNI_VMT_Meas_Test_Block; +drop table if exists mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block; +drop table if exists mmt_staging2.stg_process_table_BUDNI_VMT; +drop table if exists mmt_staging2.stg_specific_table_BUDNI_VMT; + + +create table mmt_staging2.BUDNI_VMT_Spec_H1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +tractor_HP text, +rated_rpm text, +configuration text, +transmission_type text, +wheel_drive_type text, +FIP_type text, +steering_type text, +Engine_to_PTO_ratio text, +Ballast_Condition text, +Test_Engine_Set_RPM text, +Type_of_track text , +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_VMT_Perf_Meas_Test_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.BUDNI_VMT_Test_Obs_Summary_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +ods_record int default 1, +rank int, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_BUDNI_VMT ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 NULL, +create_time timestamp DEFAULT current_timestamp, +rank int4 NULL, +rank_tag text null +); + + +CREATE TABLE mmt_staging2.stg_specific_table_BUDNI_VMT ( + generic_syspk int, +file_syspk bigint, +file_name varchar(1024) NULL, +file_date date NULL, +file_format varchar(1024) NULL, +sheet_number int4 NULL, +sheet_name varchar(1024) NULL, +sheet_format text, +sheet_mnemonic varchar(1024) NULL, +row_number int4 NULL, +file_creation_date timestamp NULL, +column1 varchar(1024) NULL, +column2 varchar(1024) NULL, +column3 varchar(1024) NULL, +column4 varchar(1024) NULL, +column5 varchar(1024) NULL, +column6 varchar(1024) NULL, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +column37 varchar(1024) NULL, +column38 varchar(1024) NULL, +column39 varchar(1024) NULL, +column40 varchar(1024) NULL, +column41 varchar(1024) NULL, +column42 varchar(1024) NULL, +column43 varchar(1024) NULL, +column44 varchar(1024) NULL, +column45 varchar(1024) NULL, +column46 varchar(1024) NULL, +column47 varchar(1024) NULL, +column48 varchar(1024) NULL, +column49 varchar(1024) NULL, +column50 varchar(1024) NULL, +column51 varchar(1024) NULL, +column52 varchar(1024) NULL, +column53 varchar(1024) NULL, +is_rownumber_fetched int4 null, +create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_BRT.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_BRT.sql new file mode 100644 index 0000000..6c713ef --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_BRT.sql @@ -0,0 +1,351 @@ +drop table if exists mmt_staging2.IHT_BRT_H1_Int; +drop table if exists mmt_staging2.IHT_BRT_H1_block; +drop table if exists mmt_staging2.IHT_BRT_Weight_Tyre_Int; +drop table if exists mmt_staging2.IHT_BRT_Weight_Block; +drop table if exists mmt_staging2.IHT_BRT_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_BRT_Test_Res_Block; +drop table if exists mmt_staging2.IHT_BRT_Test_Res_1_Block; +drop table if exists mmt_staging2.IHT_BRT_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_BRT; +drop table if exists mmt_staging2.stg_process_table_IHT_BRT; + +create table mmt_staging2.IHT_BRT_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_BRT_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +Test_Location text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Domestic_Export text, +Operator_Name text, +Project_Group text, +Platform text, +Objective text, +Test_Standard text, +Test_Standard_id text, +Remarks text, +Observations text, +Acceptance_Criteria text, +condition text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_BRT_Weight_Tyre_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_BRT_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +test_condition text, +Front text, +Rear text, +Total text, +status text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_BRT_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Pressure_kg_cm2 text, +tyre_use_type text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_BRT_Test_Res_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_BRT_Test_Res_1_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_BRT_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_BRT ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_BRT ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_CGM.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_CGM.sql new file mode 100644 index 0000000..50fde35 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_CGM.sql @@ -0,0 +1,367 @@ +drop table if exists mmt_staging2.IHT_CGM_H1_Int; +drop table if exists mmt_staging2.IHT_CGM_H1_block; +drop table if exists mmt_staging2.IHT_CGM_Weight_Tyre_Int; +drop table if exists mmt_staging2.IHT_CGM_Weight_Block; +drop table if exists mmt_staging2.IHT_CGM_Wheel_Block; +drop table if exists mmt_staging2.IHT_CGM_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_CGM_Lifting_Block; +drop table if exists mmt_staging2.IHT_CGM_Results_Block; +drop table if exists mmt_staging2.IHT_CGM_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_CGM; +drop table if exists mmt_staging2.stg_process_table_IHT_CGM; + +create table mmt_staging2.IHT_CGM_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_CGM_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Test_Location text, +Operator_Name text, +Project_Group text, +Objective text, +Acceptance_Criteria text, +Remarks text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Weight_Tyre_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +column14 text, +column15 text, +column16 text, +column17 text, +column18 text, +column19 text, +column20 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Weight_Reaction text, +Total_Weight_kg text, +Front_Reaction_kg text, +Rear_Reaction_kg text, +Left_Reaction_FL_RL_kg text, +Right_reaction_FR_RR_kg text, +Front_Left_Reaction_kg text, +Front_Right_Reaction_kg text, +Rear_Left_Reaction_kg text, +Rear_Right_Reaction_kg text, +Distance_of_lifting_point_from_rear_axle_mm_d1 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +Load_Carrying_Capacity text, +Pressure_kg_cm2 text, +Dynamic_rolling_radius text, +Static_rolling_radius text, +Wheel_rim_Make_size text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Wheel_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Wheel_Base text, +Rear_Track_Width text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Lifting_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Results_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Determination_of_Horizontal_Distance_from_RAC_X text, +Determination_of_Lateral_CoOrdinate_in_Horizontal_Plane_Y text, +Determination_of_Vertical_CoOrdinate_Z text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_CGM_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_CGM ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_CGM ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_EMT.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_EMT.sql new file mode 100644 index 0000000..a067d36 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_EMT.sql @@ -0,0 +1,394 @@ +drop table if exists mmt_staging2.IHT_EMT_H1_Int; +drop table if exists mmt_staging2.IHT_EMT_H1_block; +drop table if exists mmt_staging2.IHT_EMT_Weight_Tyre_Int; +drop table if exists mmt_staging2.IHT_EMT_Weight_Block; +drop table if exists mmt_staging2.IHT_EMT_Wheel_Block; +drop table if exists mmt_staging2.IHT_EMT_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_EMT_Steering_Block; +drop table if exists mmt_staging2.IHT_EMT_Pedal_Block; +drop table if exists mmt_staging2.IHT_EMT_Brake_Pedal_Block; +drop table if exists mmt_staging2.IHT_EMT_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_EMT; +drop table if exists mmt_staging2.stg_process_table_IHT_EMT; + +create table mmt_staging2.IHT_EMT_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_EMT_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Test_Location text, +Operator_Name text, +Project_Group text, +Objective text, +Acceptance_Criteria text, +Remarks text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Weight_Tyre_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +column14 text, +column15 text, +column16 text, +column17 text, +column18 text, +column19 text, +column20 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Weight_Reaction text, +Total_Weight_kg text, +Front_Reaction_kg text, +Rear_Reaction_kg text, +Left_Reaction_FL_RL_kg text, +Right_reaction_FR_RR_kg text, +Front_Left_Reaction_kg text, +Front_Right_Reaction_kg text, +Rear_Left_Reaction_kg text, +Rear_Right_Reaction_kg text, +Distance_of_lifting_point_from_rear_axle_mm_d1 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +Load_Carrying_Capacity text, +Pressure_kg_cm2 text, +Dynamic_rolling_radius text, +Static_rolling_radius text, +Wheel_rim_Make_size text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Wheel_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Wheel_Base text, +tcd text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Steering_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column8 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Pedal_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column8 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Brake_Pedal_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_EMT_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_EMT ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_EMT ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HAM.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HAM.sql new file mode 100644 index 0000000..afb1e6e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HAM.sql @@ -0,0 +1,426 @@ +drop table if exists mmt_staging2.IHT_HAM_H1_Int; +drop table if exists mmt_staging2.IHT_HAM_H1_block; +drop table if exists mmt_staging2.IHT_HAM_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int; +drop table if exists mmt_staging2.IHT_HAM_Engine_RPM_Block; +drop table if exists mmt_staging2.IHT_HAM_Tractor_Block; +drop table if exists mmt_staging2.IHT_HAM_Weight_Block; +drop table if exists mmt_staging2.IHT_HAM_Drawbar_Block; +drop table if exists mmt_staging2.IHT_HAM_Atmos_Cond_Block; +drop table if exists mmt_staging2.IHT_HAM_Results_Block; +drop table if exists mmt_staging2.IHT_HAM_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_HAM; +drop table if exists mmt_staging2.stg_process_table_IHT_HAM; + +create table mmt_staging2.IHT_HAM_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_HAM_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Location text, +Operator_Name text, +Project_Group text, +Test_Standard_Refer text, +Objective text, +Acceptance_criteria text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +Load_Carrying_Capacity text, +pressure_kg_cm2 text, +No_of_lug text, +Number_of_no_load_lug_30m text, +Lug_Height text, +Dynamic_rolling_radius text, +Wheel_rim_Make_size text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Engine_Tyre_Weight_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column6 text, +column10 text, +column14 text, +column15 text, +column16 text, +column21 text, +column22 text, +column27 text, +column30 text, +column32 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Engine_RPM_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +low_idle_declared text, +low_idle_observed text, +high_idle_declared text, +high_idle_observed text, +rated_rpm_declared text, +rated_rpm_observed text, +Engine_to_PTO_Ratio text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +test_condition text, +Front_weight text, +Rear_weight text, +Total_weight text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Tractor_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Wheel_Base_mm text, +Engine_Power_hp text, +PTO_Power_hp text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Drawbar_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +test_condition text, +Required_pull_in_kg text, +Required_Power_in_hp text, +Actual_pull_in_kg text, +actual_power_in_hp text, +Calculated_hitch_heigh_mm text, +Actual_hitch_height_mm text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Atmos_Cond_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Ambient_temp_C text, +humidity text, +wind_velocity text, +date text, +start_time text, +end_time text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HAM_Results_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column7 varchar(1024) NULL, +column8 varchar(1024) NULL, +column9 varchar(1024) NULL, +column10 varchar(1024) NULL, +column11 varchar(1024) NULL, +column12 varchar(1024) NULL, +column13 varchar(1024) NULL, +column14 varchar(1024) NULL, +column15 varchar(1024) NULL, +column16 varchar(1024) NULL, +column17 varchar(1024) NULL, +column18 varchar(1024) NULL, +column19 varchar(1024) NULL, +column20 varchar(1024) NULL, +column21 varchar(1024) NULL, +column22 varchar(1024) NULL, +column23 varchar(1024) NULL, +column24 varchar(1024) NULL, +column25 varchar(1024) NULL, +column26 varchar(1024) NULL, +column27 varchar(1024) NULL, +column28 varchar(1024) NULL, +column29 varchar(1024) NULL, +column30 varchar(1024) NULL, +column31 varchar(1024) NULL, +column32 varchar(1024) NULL, +column33 varchar(1024) NULL, +column34 varchar(1024) NULL, +column35 varchar(1024) NULL, +column36 varchar(1024) NULL, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + + +create table mmt_staging2.IHT_HAM_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_HAM ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_HAM ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HLS.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HLS.sql new file mode 100644 index 0000000..89e72b7 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_HLS.sql @@ -0,0 +1,368 @@ +drop table if exists mmt_staging2.IHT_HLS_H1_Int; +drop table if exists mmt_staging2.IHT_HLS_H1_block; +drop table if exists mmt_staging2.IHT_HLS_Weight_Tyre_Int; +drop table if exists mmt_staging2.IHT_HLS_Weight_Block; +drop table if exists mmt_staging2.IHT_HLS_Wheel_Block; +drop table if exists mmt_staging2.IHT_HLS_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_HLS_Numeric_Int; +drop table if exists mmt_staging2.IHT_HLS_Numeric_Block; +drop table if exists mmt_staging2.IHT_HLS_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_HLS; +drop table if exists mmt_staging2.stg_process_table_IHT_HLS; + +create table mmt_staging2.IHT_HLS_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_HLS_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Test_Location text, +Operator_Name text, +Project_Group text, +Objective text, +Acceptance_Criteria text, +Remarks text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HLS_Weight_Tyre_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +column14 text, +column15 text, +column16 text, +column17 text, +column18 text, +column19 text, +column20 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HLS_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Weight_Reaction text, +Total_Weight_kg text, +Front_Reaction_kg text, +Rear_Reaction_kg text, +Left_Reaction_FL_RL_kg text, +Right_reaction_FR_RR_kg text, +Front_Left_Reaction_kg text, +Front_Right_Reaction_kg text, +Rear_Left_Reaction_kg text, +Rear_Right_Reaction_kg text, +Distance_of_lifting_point_from_rear_axle_mm_d1 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HLS_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +Load_Carrying_Capacity text, +Pressure_kg_cm2 text, +Dynamic_rolling_radius text, +Static_rolling_radius text, +Wheel_rim_Make_size text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HLS_Wheel_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Wheel_Base text, +Rear_Track_Width text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_HLS_Numeric_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.IHT_HLS_Numeric_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +TPL_load text, +Engine_RPM text, +Lifting_time_Sec text, +Lowering_time_Sec text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + + +create table mmt_staging2.IHT_HLS_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_HLS ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_HLS ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_NST.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_NST.sql new file mode 100644 index 0000000..0045d74 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_NST.sql @@ -0,0 +1,386 @@ +drop table if exists mmt_staging2.IHT_NST_H1_Int; +drop table if exists mmt_staging2.IHT_NST_H1_block; +drop table if exists mmt_staging2.IHT_NST_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_NST_Engine_RPM_Atmos_Int; +drop table if exists mmt_staging2.IHT_NST_Engine_RPM_Block; + drop table if exists mmt_staging2.IHT_NST_Weight_Block; +drop table if exists mmt_staging2.IHT_NST_Atmos_Cond_Block; +drop table if exists mmt_staging2.IHT_NST_STAND_Noise_Block; +drop table if exists mmt_staging2.IHT_NST_OEL_Noise_Block; +drop table if exists mmt_staging2.IHT_NST_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_NST; +drop table if exists mmt_staging2.stg_process_table_IHT_NST; + +create table mmt_staging2.IHT_NST_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_NST_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Facility text, +Operator_Name text, +Project_Group text, +Test_Standard_Refer text, +Objective text, +condition text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +Load_Carrying_Capacity text, +Wheel_rim_Make_size text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_Engine_RPM_Atmos_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_Engine_RPM_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +low_idle_declared text, +low_idle_observed text, +high_idle_declared text, +high_idle_observed text, +rated_rpm_declared text, +rated_rpm_observed text, +Engine_to_PTO_Ratio text, +low_idle_remark text, +high_idle_remark text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Front_weight_declared text, +Front_weight_observed text, +Rear_weight_declared text, +Rear_weight_observed text, +Total_weight_declared text, +Total_weight_observed text, +front_weight_remark text, +rear_weight_remark text, +total_weight_remark text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_Atmos_Cond_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Ambient_temp_C text, +humidity text, +Pressure_kPa text, +Background_Noise text, +wind_velocity text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_STAND_Noise_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column1 text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +remarks text, +acceptance_criteria text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_OEL_Noise_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column1 text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +remarks text, +acceptance_criteria text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_NST_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_NST ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_NST ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_SLL.sql b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_SLL.sql new file mode 100644 index 0000000..f4a92cf --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/createtables/create_tables_IHT_SLL.sql @@ -0,0 +1,395 @@ +drop table if exists mmt_staging2.IHT_SLL_H1_Int; +drop table if exists mmt_staging2.IHT_SLL_H1_block; +drop table if exists mmt_staging2.IHT_SLL_Weight_Tyre_Int; +drop table if exists mmt_staging2.IHT_SLL_Weight_Block; +drop table if exists mmt_staging2.IHT_SLL_Wheel_Block; +drop table if exists mmt_staging2.IHT_SLL_Tyre_Details_Block; +drop table if exists mmt_staging2.IHT_SLL_Forward_Block; +drop table if exists mmt_staging2.IHT_SLL_Reverse_Block; +drop table if exists mmt_staging2.IHT_SLL_Lead_Lag_Block; +drop table if exists mmt_staging2.IHT_SLL_Footer_Block; +drop table if exists mmt_staging2.stg_specific_table_IHT_SLL; +drop table if exists mmt_staging2.stg_process_table_IHT_SLL; + +create table mmt_staging2.IHT_SLL_H1_INT +(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int +,make text,model text,file_format text,sheet_mnemonic text,c1 text,c2 text); + +create table mmt_staging2.IHT_SLL_H1_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Test_Request_no text, +Sample_Receipt_Date text, +Test_report_No text, +Tractor_Model text, +Generation text, +Customer_Name text, +Test_Engineer text, +Test_Report_Date text, +No_of_Sample text, +Test_Start_Date text, +Test_End_Date text, +Tractor_Sr_No text, +Test_Standard_Refer text, +Test_Location text, +Operator_Name text, +Project_Group text, +Objective text, +Acceptance_Criteria text, +Remarks text, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Weight_Tyre_Int +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +column10 text, +column11 text, +column12 text, +column13 text, +column14 text, +column15 text, +column16 text, +column17 text, +column18 text, +column19 text, +column20 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Weight_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Weight_Reaction text, +Total_Weight_kg text, +Front_Reaction_kg text, +Rear_Reaction_kg text, +Left_Reaction_FL_RL_kg text, +Right_reaction_FR_RR_kg text, +Front_Left_Reaction_kg text, +Front_Right_Reaction_kg text, +Rear_Left_Reaction_kg text, +Rear_Right_Reaction_kg text, +Distance_of_lifting_point_from_rear_axle_mm_d1 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Tyre_Details_Block +( +syspk serial, +client_id int, +function_id int, +file_syspk int, +dummy_f text, +make text, +model text, +file_format text, +sheet_mnemonic text, +Tyre_Details text, +Tyre_Make text, +Tyre_size text, +Ply_Rating text, +Load_Carrying_Capacity text, +Pressure_kg_cm2 text, +Dynamic_rolling_radius text, +Static_rolling_radius text, +Wheel_rim_Make_size text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Wheel_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +Wheel_Base text, +Rear_Track_Width text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Forward_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Reverse_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column2 text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +column9 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Lead_Lag_Block +( +syspk serial, +file_syspk int, +client_id int, +function_id int, +file_format text, +sheet_mnemonic text, +dummy_f text, +make text, +model text, +column3 text, +column4 text, +column5 text, +column6 text, +column7 text, +column8 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create table mmt_staging2.IHT_SLL_Footer_Block +( +syspk serial, +client_id int, +function_id int, +dummy_f text, +file_syspk int, +make text, +model text, +file_format text, +sheet_mnemonic text, +prepared_by text, +reviewed_by text, +approved_by text, +replaces text, +revision_no text, +prepared_date text, +reviewed_date text, +approved_date text, +comments text, +rev1 text, +rev2 text, +rev3 text, +rank int, +ods_record int default 1, +create_time timestamp DEFAULT current_timestamp +); + +create TABLE mmt_staging2.stg_process_table_IHT_SLL ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 NULL, + create_time timestamp DEFAULT current_timestamp, + rank int4 NULL, + rank_tag text null +); + + + +CREATE TABLE mmt_staging2.stg_specific_table_IHT_SLL ( + generic_syspk int, + file_syspk bigint, + file_name varchar(1024) NULL, + file_date date NULL, + file_format varchar(1024) NULL, + sheet_number int4 NULL, + sheet_name varchar(1024) NULL, + sheet_format text, + sheet_mnemonic varchar(1024) NULL, + row_number int4 NULL, + file_creation_date timestamp NULL, + column1 varchar(1024) NULL, + column2 varchar(1024) NULL, + column3 varchar(1024) NULL, + column4 varchar(1024) NULL, + column5 varchar(1024) NULL, + column6 varchar(1024) NULL, + column7 varchar(1024) NULL, + column8 varchar(1024) NULL, + column9 varchar(1024) NULL, + column10 varchar(1024) NULL, + column11 varchar(1024) NULL, + column12 varchar(1024) NULL, + column13 varchar(1024) NULL, + column14 varchar(1024) NULL, + column15 varchar(1024) NULL, + column16 varchar(1024) NULL, + column17 varchar(1024) NULL, + column18 varchar(1024) NULL, + column19 varchar(1024) NULL, + column20 varchar(1024) NULL, + column21 varchar(1024) NULL, + column22 varchar(1024) NULL, + column23 varchar(1024) NULL, + column24 varchar(1024) NULL, + column25 varchar(1024) NULL, + column26 varchar(1024) NULL, + column27 varchar(1024) NULL, + column28 varchar(1024) NULL, + column29 varchar(1024) NULL, + column30 varchar(1024) NULL, + column31 varchar(1024) NULL, + column32 varchar(1024) NULL, + column33 varchar(1024) NULL, + column34 varchar(1024) NULL, + column35 varchar(1024) NULL, + column36 varchar(1024) NULL, + column37 varchar(1024) NULL, + column38 varchar(1024) NULL, + column39 varchar(1024) NULL, + column40 varchar(1024) NULL, + column41 varchar(1024) NULL, + column42 varchar(1024) NULL, + column43 varchar(1024) NULL, + column44 varchar(1024) NULL, + column45 varchar(1024) NULL, + column46 varchar(1024) NULL, + column47 varchar(1024) NULL, + column48 varchar(1024) NULL, + column49 varchar(1024) NULL, + column50 varchar(1024) NULL, + column51 varchar(1024) NULL, + column52 varchar(1024) NULL, + column53 varchar(1024) NULL, + is_rownumber_fetched int4 null, + create_time timestamp DEFAULT current_timestamp +); + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY-SUM_STG2.txt b/deployment-20210427T103328Z-001/deployment/field/FTDRY-SUM_STG2.txt new file mode 100644 index 0000000..3c8faa4 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY-SUM_STG2.txt @@ -0,0 +1,672 @@ +drop function if exists mmt_staging2.fn_FTDRY_SUM_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_SUM_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + declare v_query int; + + begin + + +/*********************************************************************************** +Function Name:fn_FTDRY_SUM_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTDRY +Sheet Format: FTDRY_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_SUM_Block (20,1,'FTDRY','FTDRY_SUM',258); +************************************************************************************/ + + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.ftdry_sum_trac_h1_block; +truncate mmt_staging2.ftdry_sum_implement_block; +truncate mmt_staging2.ftdry_sum_test_condition_1_block; +truncate mmt_staging2.ftdry_sum_test_condition_2_block; +truncate mmt_staging2.ftdry_sum_comments_by_block; +truncate mmt_staging2.stg_specific_table_ftdry_sum; +truncate mmt_staging2.stg_process_table_ftdry_sum; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for ftdry*/ +execute 'insert into mmt_staging2.stg_specific_table_ftdry_sum +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +select count(*) into v_query from mmt_staging2.stg_specific_table_ftdry_sum; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_ftdry_sum set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftdry_sum set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftdry_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_staging2.stg_specific_table_ftdry_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a + set row_read_end = null where f1_modified =''Test Manager Comments_2'' and +a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Model'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Make of Implement'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition_1:'' + and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Engineer Comments_1'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments_1'' + and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition_2:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Engineer Comments_2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments_2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/* blocks data loading start - FTDRY_SUM_Trac_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Trac_H1_Block',__file_format,__sheet_mnemonic,1); + +v_block:='FTDRY_SUM_Trac_H1_Block'; + +insert into mmt_staging2.FTDRY_SUM_Trac_H1_Block +( +Tractor_Model, +Tractor_Make, +Tractor_Engine_HP, +Rated_RPM, +Transmission_Type, +Wheel_Drive_Type, +FIP_Type, +Steering_Type, +Tractor_Weight_kg_Front, +Tractor_Weight_kg_Rear, +Tractor_Weight_kg_Total, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_ftdry_sum +where rank_tag='FTDRY_SUM_Trac_H1' +order by rank; + +delete from mmt_staging2.FTDRY_SUM_Trac_H1_Block where tractor_model = '0'; + +update mmt_staging2.FTDRY_SUM_Trac_H1_Block +set ods_record=0 where rank=1; + +execute 'update mmt_staging2.FTDRY_SUM_Trac_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Trac_H1_Block'); + +/* blocks data loading start -FTDRY_SUM_Implement_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Implement_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTDRY_SUM_Implement_Block'; +insert into mmt_staging2.FTDRY_SUM_Implement_Block +( +Make_of_Implement, +Implement_Type, +Implement_Size, +Hitch_Category, +Implement_Weight, +Soil_Type, +Moisture_Content , +Bulk_Density_g_cc , +Soil_Cone_index, +Field_Condition , +Season, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_ftdry_sum +where rank_tag='FTDRY_SUM_Implement'; + +update mmt_staging2.FTDRY_SUM_Implement_Block +set ods_record=0 where rank in(1,3); + + +execute 'update mmt_staging2.FTDRY_SUM_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Implement_Block'); + +/* blocks data loading start -FTDRY_SUM_Test_Condition_1_Block*/ + + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Test_Condition_1_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTDRY_SUM_Test_Condition_1_Block'; +insert into mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text, +column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_1'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +set test_iterationnumber=1; + +insert into mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text, +column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_1'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +set test_iterationnumber=2 +where test_iterationnumber is null; + + update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +ORDER BY test_iterationnumber ASC +) as q) b where a.test_iterationnumber =b.test_iterationnumber; + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_1_Block where tractor_model = '0' or engine_rpm_set = '0'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block set fuel_consumption_lit_hr_2=null where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block set fuel_consumption_lit_hr_2 = left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Area_covered_acr_hr_2 = left(Area_covered_acr_hr_2,length(Area_covered_acr_hr_2)-3) , +Fuel_consumption_lit_Acr_2 = left(Fuel_consumption_lit_Acr_2,length(Fuel_consumption_lit_Acr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + + + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Test_Condition_1_Block'); + + +/* blocks data loading start -FTDRY_SUM_Test_Condition_2_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Test_Condition_2_Block',__file_format,__sheet_mnemonic,4); +v_block:='FTDRY_SUM_Test_Condition_2_Block'; +insert into mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_2'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text,a_31 text, + a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +set test_iterationnumber=3; + +insert into mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text,column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_2'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text,a_31 text, + a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +set test_iterationnumber=4 +where test_iterationnumber is null; + + update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +ORDER BY test_iterationnumber ASC +) as q) b where a.test_iterationnumber =b.test_iterationnumber; + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_2_Block where tractor_model = '0' or engine_rpm_set = '0'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block set fuel_consumption_lit_hr_2=null where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block set fuel_consumption_lit_hr_2 = left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Area_covered_acr_hr_2 = left(Area_covered_acr_hr_2,length(Area_covered_acr_hr_2)-3) , +Fuel_consumption_lit_Acr_2 = left(Fuel_consumption_lit_Acr_2,length(Fuel_consumption_lit_Acr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + + + + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_2_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Test_Condition_2_Block'); + + +/* blocks data loading start -FTDRY_SUM_Comments_By_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Comments_By_Block',__file_format,__sheet_mnemonic,5); +v_block:='FTDRY_SUM_Comments_By_Block'; + +insert into mmt_staging2.FTDRY_SUM_Comments_By_Block (dummy_f) values ('dummy'); + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set Test_Engineer_Comments_1= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Engineer_Comments_1'' +and a.rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set test_engineer_comments_2= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Engineer_Comments_2'' +and a.rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set test_manager_comments_1= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Manager_Comments_1'' +and a.rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set test_manager_comments_2= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Manager_Comments_2'' +and a.rank=1 ) where dummy_f=''dummy'''; + + +delete from mmt_staging2.FTDRY_SUM_Comments_By_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Comments_By_Block'); +if v_query>1 then + v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +else + v_context := 'data not present'; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +end if; +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTDRY_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY-TRS_STG2.txt b/deployment-20210427T103328Z-001/deployment/field/FTDRY-TRS_STG2.txt new file mode 100644 index 0000000..6de6675 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY-TRS_STG2.txt @@ -0,0 +1,448 @@ +/*FTDRY_starts*/ +drop function if exists mmt_staging2.fn_FTDRY_TRS_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_TRS_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + declare v_query int; + + begin + + +/*********************************************************************************** +Function Name:fn_FTDRY_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTDRY +Sheet Format: FTDRY_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',257); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTDRY_TRS_H1_INT; +truncate mmt_staging2.ftdry_trs_h1_block ; +truncate mmt_staging2.ftdry_trs_implement_block ; +truncate mmt_staging2.ftdry_trs_spec_block; +truncate mmt_staging2.ftdry_trs_engine_rpm_block; +truncate mmt_staging2.stg_specific_table_ftdry_trs; +truncate mmt_staging2.stg_process_table_ftdry_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for ftdry*/ + +execute 'insert into mmt_staging2.stg_specific_table_ftdry_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +select count(*) into v_query from mmt_staging2.stg_specific_table_ftdry_trs; + +/* trimming data */ +update mmt_staging2.stg_specific_table_ftdry_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftdry_trs set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source) ; +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + + +/* keyword match in config table*/ + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_trs b +where trim(upper(F1_source))= trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftdry_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column2)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null +where f1_modified =''Implement Details'' and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications Sheet'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and a.column2 <> '''' +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Implement Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + + +/*insert data into h1_int */ + +insert into mmt_staging2.FTDRY_TRS_H1_INT( +column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank + from mmt_staging2.stg_process_table_ftdry_trs a where rank_tag='FTDRY_TRS_H1' +order by rank; + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Date of Test'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Report Date'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Season'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Type of Soil'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Soil Cone Index (kPa)'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Field Condition'); + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column5 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column4) +and b.column4='Date of Test') +where a.column2='Date of Test'; + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column7 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column6) +and b.column6='Report Date') +where a.column2='Report Date'; + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Season') +where a.column2='Season'; + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Type of Soil') +where a.column2='Type of Soil'; + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Soil Cone Index (kPa)') +where a.column2='Soil Cone Index (kPa)'; + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Field Condition') +where a.column2='Field Condition'; + + +/*inserting data into block -FTDRY_TRS_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_H1_Block',__file_format,__sheet_mnemonic,1); + +v_block:='FTDRY_TRS_H1_Block'; +insert into mmt_staging2.FTDRY_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Soil_Moisture_Content_, +Soil_Bulk_Density_g_cc, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Season, +Type_of_Soil, +Soil_Cone_Index_kPa, +Field_Condition +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTDRY_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + +delete from mmt_staging2.FTDRY_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_H1_Block'); + + +/*inserting data into block -FTDRY_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); + +v_block:='FTDRY_TRS_SPEC_Block'; + +insert into mmt_staging2.FTDRY_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear, +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text); + +delete from mmt_staging2.FTDRY_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + +delete from mmt_staging2.FTDRY_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_SPEC_Block'); + + +/*inserting data into block -FTDRY_TRS_Engine_RPM_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); + +v_block:='FTDRY_TRS_Engine_RPM_Block'; +insert into mmt_staging2.FTDRY_TRS_Engine_RPM_Block +( +dummy_f, +tractor_model, +tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_Engine_RPM'' + or (rank_tag=''FTDRY_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + +delete from mmt_staging2.FTDRY_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTDRY_TRS_Implement_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_Implement_Block',__file_format,__sheet_mnemonic,4); + +v_block:='FTDRY_TRS_Implement_Block'; +insert into mmt_staging2.FTDRY_TRS_Implement_Block +( +dummy_f, +Name_of_Implement, +Type_of_Implement, +Make_of_Implement, +No_of_bottoms_Tyne_Disc_Blade, +Cutting_Width_m, +Implement_Weight_Kg, +Hitch_Category, +Span_cm_For_Mounted_Implement, +Mast_Height_cm_For_Mounted_Implement +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_Implement'' + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +update mmt_staging2.FTDRY_TRS_Implement_Block set dummy_f='dummy' where dummy_f is null; + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_no= (select column2 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_rev_no= (select column4 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_rev_date= (select column6 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +execute 'update mmt_staging2.FTDRY_TRS_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_Implement_Block'); +if v_query>1 then + v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +else + v_context := 'data not present'; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +end if; +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_ODS.sql b/deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_ODS.sql new file mode 100644 index 0000000..d346022 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_ODS.sql @@ -0,0 +1,358 @@ +drop function if exists mmt_staging2.fn_FTDRY_SUM_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_SUM_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_FTDRY_SUM_ODS +Function Desc: This function populates data into ODS +File Format: FTDRY +Sheet Format: FTDRY_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_SUM_ODS() +***************************************************************/ + +/*delete from mmt_ods.field_perf_summary where test_file_ref_no =258; + +delete from mmt_ods.field_perf_summary_implement_info where test_file_ref_no =258; + +delete from mmt_ods.field_perf_summary_tractor_info where test_file_ref_no =258;*/ + +select file_syspk into __file_syspk from mmt_staging2.ftdry_sum_trac_h1_block; + +insert into mmt_ods.field_perf_summary_tractor_info +( +client_id, +function_id, +tractor_model, +tractor_make, +tractor_engine_hp, +rated_rpm, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_front_kg, +tractor_weight_rear_kg, +tractor_weight_total_kg, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +tractor_model, +tractor_make, +tractor_engine_hp::numeric, +rated_rpm::numeric, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_kg_front::numeric, +tractor_weight_kg_rear::numeric, +tractor_weight_kg_total::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_sum_trac_h1_block where ods_record=1; + +update mmt_ods.field_perf_summary_tractor_info a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=trim(b.tractor_model) and a.test_file_ref_no =b.test_file_ref_no +)where a.test_file_ref_no =__file_syspk; + + +insert into mmt_ods.field_perf_summary_implement_info +( +client_id, +function_id, +name_of_implement, +implement_type, +implement_size, +hitch_category, +implement_weight, +soil_type, +soil_moisture_content_pct, +soil_bulk_density_g_per_cc, +soil_cone_index, +field_condition, +season, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +make_of_implement, +implement_type, +implement_size, +hitch_category, +trim('kg' from implement_weight)::numeric, +soil_type, +moisture_content soil_moisture_content_pct, +bulk_density_g_cc::numeric soil_bulk_density_g_per_cc, +trim(' Kpa' from soil_cone_index)::numeric soil_cone_index, +field_condition, +season, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_sum_implement_block where ods_record=1; + +insert into mmt_ods.field_perf_summary +( +client_id, +function_id, +test_iteration_number, +test_condition, +test_date, +tractor_model, +engine_rpm_set, +pto_rpm_set, +gear_used, +nominal_speed_kmph, +engine_rpm_drop_on_straight_1st_pass, +engine_rpm_drop_on_turn_1st_pass, +depth_of_cut_cm, +no_load_speed_kmph, +on_load_speed_kmph, +wheel_slippage_pct, +fuel_consumption_lit_per_hr, +area_covered_acr_per_hr, +fuel_consumption_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, +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_index, +pulverization_quality, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +test_iterationnumber::numeric, +test_condition, +test_date::date, +tractor_model, +engine_rpm_set::numeric, +pto_rpm_set::numeric, +gear_used, +nominal_speed_kmph::numeric, +engine_rpm_drop_on_straight engine_rpm_drop_on_straight_1st_pass , +engine_rpm_drop_on_turn engine_rpm_drop_on_turn_1st_pass, +depth_of_cut_cm, +no_load_speed_kmph::numeric, +on_load_speed_kmph::numeric, +wheel_slippage_::numeric wheel_slippage_pct, +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 , +fuel_consumption_lit_hr_2::numeric , +area_covered_acr_hr_2::numeric , +fuel_consumption_lit_acr_2::numeric , +engine_smoke_on_load, +engine_acceleration_smoke , +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_lifting_lowering_response implement_lifting_per_lowering_response, +pulverization_index, +pulverization_quality, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_sum_test_condition_1_block where ods_record=1; + + + +insert into mmt_ods.field_perf_summary +( +client_id, +function_id, +test_iteration_number, +test_condition, +test_date, +tractor_model, +engine_rpm_set, +pto_rpm_set, +gear_used, +nominal_speed_kmph, +engine_rpm_drop_on_straight_1st_pass, +engine_rpm_drop_on_turn_1st_pass, +depth_of_cut_cm, +no_load_speed_kmph, +on_load_speed_kmph, +wheel_slippage_pct, +fuel_consumption_lit_per_hr, +area_covered_acr_per_hr, +fuel_consumption_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, +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_index, +pulverization_quality, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +test_iterationnumber::numeric, +test_condition, +test_date::date, +tractor_model, +engine_rpm_set::numeric, +pto_rpm_set::numeric, +gear_used, +nominal_speed_kmph::numeric, +engine_rpm_drop_on_straight engine_rpm_drop_on_straight_1st_pass , +engine_rpm_drop_on_turn engine_rpm_drop_on_turn_1st_pass, +depth_of_cut_cm, +no_load_speed_kmph::numeric, +on_load_speed_kmph::numeric, +wheel_slippage_::numeric wheel_slippage_pct, +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 , +fuel_consumption_lit_hr_2::numeric , +area_covered_acr_hr_2::numeric , +fuel_consumption_lit_acr_2::numeric , +engine_smoke_on_load, +engine_acceleration_smoke , +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_lifting_lowering_response implement_lifting_per_lowering_response, +pulverization_index, +pulverization_quality, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_sum_test_condition_2_block where ods_record=1; + + +update mmt_ods.field_perf_summary +set test_engr_comments=b.test_engineer_comments_1, +test_mgr_comments =b.test_manager_comments_1 +from mmt_staging2.ftdry_sum_comments_by_block b +where test_file_ref_no =__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =1 and a.test_file_ref_no =__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =2 and a.test_file_ref_no =__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =3 and a.test_file_ref_no =__file_syspk; + + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =4 and a.test_file_ref_no =__file_syspk; + + +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.field_perf_summary +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.field_perf_summary_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.field_perf_summary_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTDRY','FTDRY_SUM' ,null,'ods', 'fn_FTDRY_SUM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTDRY','FTDRY_SUM' ,null,'ods', 'fn_FTDRY_SUM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_STG2.sql b/deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_STG2.sql new file mode 100644 index 0000000..f159d79 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY_SUM_STG2.sql @@ -0,0 +1,663 @@ +drop function if exists mmt_staging2.fn_FTDRY_SUM_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_SUM_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + +/*********************************************************************************** +Function Name:fn_FTDRY_SUM_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTDRY +Sheet Format: FTDRY_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_SUM_Block (20,1,'FTDRY','FTDRY_SUM',258); +************************************************************************************/ + + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.ftdry_sum_trac_h1_block; +truncate mmt_staging2.ftdry_sum_implement_block; +truncate mmt_staging2.ftdry_sum_test_condition_1_block; +truncate mmt_staging2.ftdry_sum_test_condition_2_block; +truncate mmt_staging2.ftdry_sum_comments_by_block; +truncate mmt_staging2.stg_specific_table_ftdry_sum; +truncate mmt_staging2.stg_process_table_ftdry_sum; + + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for ftdry*/ +execute 'insert into mmt_staging2.stg_specific_table_ftdry_sum +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_ftdry_sum set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftdry_sum set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftdry_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_staging2.stg_specific_table_ftdry_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a + set row_read_end = null where f1_modified =''Test Manager Comments_2'' and +a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Model'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Make of Implement'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition_1:'' + and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Engineer Comments_1'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments_1'' + and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition_2:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Engineer Comments_2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments_2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/* blocks data loading start - FTDRY_SUM_Trac_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Trac_H1_Block',__file_format,__sheet_mnemonic,1); + +v_block:='FTDRY_SUM_Trac_H1_Block'; + +insert into mmt_staging2.FTDRY_SUM_Trac_H1_Block +( +Tractor_Model, +Tractor_Make, +Tractor_Engine_HP, +Rated_RPM, +Transmission_Type, +Wheel_Drive_Type, +FIP_Type, +Steering_Type, +Tractor_Weight_kg_Front, +Tractor_Weight_kg_Rear, +Tractor_Weight_kg_Total, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_ftdry_sum +where rank_tag='FTDRY_SUM_Trac_H1' +order by rank; + +delete from mmt_staging2.FTDRY_SUM_Trac_H1_Block where tractor_model = '0'; + +update mmt_staging2.FTDRY_SUM_Trac_H1_Block +set ods_record=0 where rank=1; + +execute 'update mmt_staging2.FTDRY_SUM_Trac_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Trac_H1_Block'); + +/* blocks data loading start -FTDRY_SUM_Implement_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Implement_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTDRY_SUM_Implement_Block'; +insert into mmt_staging2.FTDRY_SUM_Implement_Block +( +Make_of_Implement, +Implement_Type, +Implement_Size, +Hitch_Category, +Implement_Weight, +Soil_Type, +Moisture_Content , +Bulk_Density_g_cc , +Soil_Cone_index, +Field_Condition , +Season, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_ftdry_sum +where rank_tag='FTDRY_SUM_Implement'; + +update mmt_staging2.FTDRY_SUM_Implement_Block +set ods_record=0 where rank in(1,3); + + +execute 'update mmt_staging2.FTDRY_SUM_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Implement_Block'); + +/* blocks data loading start -FTDRY_SUM_Test_Condition_1_Block*/ + + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Test_Condition_1_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTDRY_SUM_Test_Condition_1_Block'; +insert into mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text, +column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_1'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +set test_iterationnumber=1; + +insert into mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text, +column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_1'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +set test_iterationnumber=2 +where test_iterationnumber is null; + + update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTDRY_SUM_Test_Condition_1_Block +ORDER BY test_iterationnumber ASC +) as q) b where a.test_iterationnumber =b.test_iterationnumber; + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_1_Block where tractor_model = '0' or engine_rpm_set = '0'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block set fuel_consumption_lit_hr_2=null where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block set fuel_consumption_lit_hr_2 = left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Area_covered_acr_hr_2 = left(Area_covered_acr_hr_2,length(Area_covered_acr_hr_2)-3) , +Fuel_consumption_lit_Acr_2 = left(Fuel_consumption_lit_Acr_2,length(Fuel_consumption_lit_Acr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + + + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_SUM_Test_Condition_1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Test_Condition_1_Block'); + + +/* blocks data loading start -FTDRY_SUM_Test_Condition_2_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Test_Condition_2_Block',__file_format,__sheet_mnemonic,4); +v_block:='FTDRY_SUM_Test_Condition_2_Block'; +insert into mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_2'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text,a_31 text, + a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +set test_iterationnumber=3; + +insert into mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight, +Engine_RPM_Drop_on_turn, +Depth_of_cut_cm, +No_load_speed_kmph, +On_load_speed_kmph, +wheel_slippage_, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text,column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_sum where rank_tag=''FTDRY_SUM_Test_Condition_2'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text,a_31 text, + a_32 text,a_33 text,a_34 text,a_35 text,a_36 text); + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +set test_iterationnumber=4 +where test_iterationnumber is null; + + update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTDRY_SUM_Test_Condition_2_Block +ORDER BY test_iterationnumber ASC +) as q) b where a.test_iterationnumber =b.test_iterationnumber; + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_2_Block where tractor_model = '0' or engine_rpm_set = '0'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block set fuel_consumption_lit_hr_2=null where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block set fuel_consumption_lit_hr_2 = left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Area_covered_acr_hr_2 = left(Area_covered_acr_hr_2,length(Area_covered_acr_hr_2)-3) , +Fuel_consumption_lit_Acr_2 = left(Fuel_consumption_lit_Acr_2,length(Fuel_consumption_lit_Acr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + + + + +delete from mmt_staging2.FTDRY_SUM_Test_Condition_2_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_SUM_Test_Condition_2_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Test_Condition_2_Block'); + + +/* blocks data loading start -FTDRY_SUM_Comments_By_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_SUM_Comments_By_Block',__file_format,__sheet_mnemonic,5); +v_block:='FTDRY_SUM_Comments_By_Block'; + +insert into mmt_staging2.FTDRY_SUM_Comments_By_Block (dummy_f) values ('dummy'); + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set Test_Engineer_Comments_1= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Engineer_Comments_1'' +and a.rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set test_engineer_comments_2= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Engineer_Comments_2'' +and a.rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set test_manager_comments_1= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Manager_Comments_1'' +and a.rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set test_manager_comments_2= +(select column3 from mmt_staging2.stg_process_table_ftdry_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTDRY_SUM_Manager_Comments_2'' +and a.rank=1 ) where dummy_f=''dummy'''; + + +delete from mmt_staging2.FTDRY_SUM_Comments_By_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_SUM_Comments_By_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_SUM_Comments_By_Block'); +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTDRY_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_ODS.sql b/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_ODS.sql new file mode 100644 index 0000000..46d2fcd --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_ODS.sql @@ -0,0 +1,369 @@ +drop function if exists mmt_staging2.fn_FTDRY_TRS_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_TRS_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __test_master_id int; + declare __test_tractor_id int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin + +__file_syspk := p_file_syspk; +/************************************************************ +Function Name:fn_FTDRY_TRS_ODS +Function Desc: This function populates data into ODS +File Format: FTDRY +Sheet Format: FTDRY_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_TRS_ODS() +***************************************************************/ + +/*delete from mmt_ods.test_instance where test_file_ref_no =258; + +delete from mmt_ods.test_instance_engine_info where test_file_ref_no =258; + +delete from mmt_ods.test_instance_implement_info where test_file_ref_no =258; + +delete from mmt_ods.test_instance_tractor_info where test_file_ref_no =258; + + +delete from mmt_ods.test_instance_trailer_info where test_file_ref_no =258; + +delete from mmt_ods.test_instance_tyre_info where test_file_ref_no =258;*/ + +select file_syspk into __file_syspk from mmt_staging2.FTDRY_TRS_H1_Block; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_report_no, +objective_of_test, +background_of_test, +job_order_no, +test_location_name, +soil_moisture_content_pct, +soil_bulk_density_g_per_cc, +test_engineer, +test_operator, +date_of_test, +test_report_date, +season, +type_of_soil, +soil_cone_index, +field_condition, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +report_reference_no test_report_no, +objective_of_test, +background_of_test, +job_order_no, +test_location test_location_name, +soil_moisture_content_ soil_moisture_content_pct , +soil_bulk_density_g_cc::int soil_bulk_density_g_per_cc, +test_engineer, +test_operator, +date_of_test::date, +report_date::date test_report_date, +season, +type_of_soil, +trim(' Kpa' from soil_cone_index_kpa)::int soil_cone_index, +field_condition, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_trs_h1_block where ods_record=1; + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +tractor_model, +tractor_make, +tractor_sr_no, +tractor_engine_hp, +fip_type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +wheel_drive_type, +egr_yn, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +tractor_weight_front_kg, +tractor_weight_rear_kg, +tractor_weight_total_kg, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +mechanical_ballast_rear_in_kg, +water_ballast_rear_75_pct , +Mechanical_Ballast_Front, +mechanical_ballast_front_kg , +Total_Ballast_Weight, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP::float, +FIP_Type, +hour_Meter_Reading::numeric, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD wheel_drive_type , +EGR_Yes_No egr_yn, +Brake_Type , +PTO_Type , +Standard_PTO_Speed_RPM::numeric, +EPTO_Speed_RPM, +Tractor_Weight_kg_Front::numeric tractor_weight_front_kg , +Tractor_Weight_kg_Rear::numeric tractor_weight_rear_kg , +Tractor_Weight_kg_Total::numeric tractor_weight_total_kg , +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Mechanical_Ballast_Rear_in_KG::numeric mechanical_ballast_rear_in_kg , +Water_Ballast_Rear water_ballast_rear_75_pct , +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg::numeric mechanical_ballast_front_kg , +Total_Ballast_Weight::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_trs_spec_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_tractor_info +set mahindra_model_yn = ( +case when tractor_make like 'Mahindra%' then 'Y' else 'N' end +) where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info a +set test_tractor_yn ='Y' where syspk in +(select min(syspk) from mmt_ods.test_instance_tractor_info b +where b.test_file_ref_no =a.test_file_ref_no) +and test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_tractor_yn ='N' +where test_tractor_yn is null and test_file_ref_no =__file_syspk; + + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +tractor_make, +tractor_model, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tyre_type, +tyre_make, +tyre_size, +tyre_pressure_psi +) +select +client_id, +function_id, +tractor_make, +tractor_model, +file_syspk, +file_format, +sheet_mnemonic, +'front', +front_tyre_make tyre_make, +front_tyre_size tyre_size, +front_tyre_pressure_psi::int tyre_pressure_psi +from mmt_staging2.ftdry_trs_spec_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_tyre_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.tyre_type ='front' and a.test_file_ref_no =__file_syspk; + + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +tractor_make, +tractor_model, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tyre_type, +tyre_make, +tyre_size, +tyre_pressure_psi +) +select +client_id, +function_id, +tractor_make, +tractor_model, +file_syspk, +file_format, +sheet_mnemonic, +'rear', +rear_tyre_make tyre_make, +rear_tyre_size tyre_size, +rear_tyre_pressure_psi::int tyre_pressure_psi +from mmt_staging2.ftdry_trs_spec_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_tyre_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.tyre_type ='rear' and a.test_file_ref_no = __file_syspk; + +insert into mmt_ods.test_instance_engine_info +( +client_id, +function_id, +low_idle_observed , +high_idle_observed , +rated_rpm , +engine_to_pto_ratio_540_pto, +engine_to_pto_ratio_540e_pto, +tractor_model, +tractor_make, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +low_idle::int low_idle_observed , +high_idle::int high_idle_observed , +rated_rpm::int, +engine_to_pto_ratio_540_pto, +engine_to_pto_ratio_540e_pto, +tractor_model, +tractor_make, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_trs_engine_rpm_block +where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_engine_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.test_file_ref_no = __file_syspk; + +insert into mmt_ods.test_instance_implement_info +( +client_id, +function_id, +name_of_implement, +type_of_implement, +make_of_implement, +no_of_disc_blades_bottoms, +cutting_width_m, +implement_weight_kg, +hitch_category, +span_for_mounted_implement_mm , +mast_height_for_mounted_implement_mm, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +name_of_implement, +type_of_implement, +make_of_implement, +no_of_bottoms_tyne_disc_blade no_of_disc_blades_bottoms, +cutting_width_m, +trim('kg' from implement_weight_kg)::numeric, +hitch_category, +span_cm_for_mounted_implement::numeric span_for_mounted_implement_cm , +mast_height_cm_for_mounted_implement::numeric mast_height_for_mounted_implement_cm, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftdry_trs_implement_block where name_of_implement is not null and ods_record=1; + +update mmt_ods.test_instance a +set report_template_no=b.report_template_no, +report_template_rev_no=b.report_template_rev_no, +report_template_rev_date =b.report_template_rev_date +from mmt_staging2.ftdry_trs_implement_block b where name_of_implement is not null and ods_record=1 +and a.test_file_ref_no=b.file_syspk; + + +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select syspk from mmt_ods.test_master into __test_master_id where test_type ='Field'; +select syspk from mmt_ods.test_instance_tractor_info into __test_tractor_id +where test_file_ref_no =__file_syspk and test_tractor_yn ='Y'; + + +update mmt_ods.test_instance +set test_master_id =__test_master_id, +test_tractor_id =__test_tractor_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTDRY','FTDRY_TRS' ,null,'ods', 'fn_FTDRY_TRS_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTDRY','FTDRY_TRS' ,null,'ods', 'fn_FTDRY_TRS_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_STG2.sql b/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_STG2.sql new file mode 100644 index 0000000..cb1d488 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_STG2.sql @@ -0,0 +1,440 @@ +/*FTDRY_starts*/ +drop function if exists mmt_staging2.fn_FTDRY_TRS_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_TRS_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + +/*********************************************************************************** +Function Name:fn_FTDRY_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTDRY +Sheet Format: FTDRY_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',257); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTDRY_TRS_H1_INT; +truncate mmt_staging2.ftdry_trs_h1_block ; +truncate mmt_staging2.ftdry_trs_implement_block ; +truncate mmt_staging2.ftdry_trs_spec_block; +truncate mmt_staging2.ftdry_trs_engine_rpm_block; +truncate mmt_staging2.stg_specific_table_ftdry_trs; +truncate mmt_staging2.stg_process_table_ftdry_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for ftdry*/ + +execute 'insert into mmt_staging2.stg_specific_table_ftdry_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_ftdry_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftdry_trs set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source) ; +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + + +/* keyword match in config table*/ + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_trs b +where trim(upper(F1_source))= trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftdry_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column2)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null +where f1_modified =''Implement Details'' and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications Sheet'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and a.column2 <> '''' +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Implement Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + + +/*insert data into h1_int */ + +insert into mmt_staging2.FTDRY_TRS_H1_INT( +column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank + from mmt_staging2.stg_process_table_ftdry_trs a where rank_tag='FTDRY_TRS_H1' +order by rank; + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Date of Test'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Report Date'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Season'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Type of Soil'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Soil Cone Index (kPa)'); + +insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Field Condition'); + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column5 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column4) +and b.column4='Date of Test') +where a.column2='Date of Test'; + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column7 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column6) +and b.column6='Report Date') +where a.column2='Report Date'; + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Season') +where a.column2='Season'; + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Type of Soil') +where a.column2='Type of Soil'; + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Soil Cone Index (kPa)') +where a.column2='Soil Cone Index (kPa)'; + + +update mmt_staging2.FTDRY_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Field Condition') +where a.column2='Field Condition'; + + +/*inserting data into block -FTDRY_TRS_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_H1_Block',__file_format,__sheet_mnemonic,1); + +v_block:='FTDRY_TRS_H1_Block'; +insert into mmt_staging2.FTDRY_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Soil_Moisture_Content_, +Soil_Bulk_Density_g_cc, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Season, +Type_of_Soil, +Soil_Cone_Index_kPa, +Field_Condition +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTDRY_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + +delete from mmt_staging2.FTDRY_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_H1_Block'); + + +/*inserting data into block -FTDRY_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); + +v_block:='FTDRY_TRS_SPEC_Block'; + +insert into mmt_staging2.FTDRY_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear, +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text); + +delete from mmt_staging2.FTDRY_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + +delete from mmt_staging2.FTDRY_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_SPEC_Block'); + + +/*inserting data into block -FTDRY_TRS_Engine_RPM_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); + +v_block:='FTDRY_TRS_Engine_RPM_Block'; +insert into mmt_staging2.FTDRY_TRS_Engine_RPM_Block +( +dummy_f, +tractor_model, +tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_Engine_RPM'' + or (rank_tag=''FTDRY_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + +delete from mmt_staging2.FTDRY_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTDRY_TRS_Implement_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_Implement_Block',__file_format,__sheet_mnemonic,4); + +v_block:='FTDRY_TRS_Implement_Block'; +insert into mmt_staging2.FTDRY_TRS_Implement_Block +( +dummy_f, +Name_of_Implement, +Type_of_Implement, +Make_of_Implement, +No_of_bottoms_Tyne_Disc_Blade, +Cutting_Width_m, +Implement_Weight_Kg, +Hitch_Category, +Span_cm_For_Mounted_Implement, +Mast_Height_cm_For_Mounted_Implement +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_Implement'' + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +update mmt_staging2.FTDRY_TRS_Implement_Block set dummy_f='dummy' where dummy_f is null; + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_no= (select column2 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_rev_no= (select column4 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_rev_date= (select column6 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +execute 'update mmt_staging2.FTDRY_TRS_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_Implement_Block'); +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_stg2_version2.sql b/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_stg2_version2.sql new file mode 100644 index 0000000..d706daf --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTDRY_TRS_stg2_version2.sql @@ -0,0 +1,468 @@ +/*FTDRY_starts*/ +drop function if exists mmt_staging2.fn_FTDRY_TRS_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_TRS_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + declare v_query int; + + + begin + + +/*********************************************************************************** +Function Name:fn_FTDRY_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTDRY +Sheet Format: FTDRY_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',257); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTDRY_TRS_H1_INT; +truncate mmt_staging2.ftdry_trs_h1_block ; +truncate mmt_staging2.ftdry_trs_implement_block ; +truncate mmt_staging2.ftdry_trs_spec_block; +truncate mmt_staging2.ftdry_trs_engine_rpm_block; +truncate mmt_staging2.stg_specific_table_ftdry_trs; +truncate mmt_staging2.stg_process_table_ftdry_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for ftdry*/ + +execute 'insert into mmt_staging2.stg_specific_table_ftdry_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +select count(*) into v_query from mmt_staging2.stg_specific_table_ftdry_trs; + +/* trimming data */ +update mmt_staging2.stg_specific_table_ftdry_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftdry_trs set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source) ; +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + + +/* keyword match in config table*/ + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftdry_trs b +where trim(upper(F1_source))= trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftdry_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_source))= trim(upper(column2)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null +where f1_modified =''Implement Details'' and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications Sheet'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_ftdry_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftdry_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and a.column2 <> '''' +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Implement Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + + +/*insert data into h1_int */ + +insert into mmt_staging2.FTDRY_TRS_H1_INT( +column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank +from mmt_staging2.stg_process_table_ftdry_trs a where rank_tag='FTDRY_TRS_H1' +order by rank; + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2,column3) +select 'Date of Test',column5 +from mmt_staging2.FTDRY_TRS_H1_INT +where rank=1; + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2,column3) +select 'Report Date',column7 +from mmt_staging2.FTDRY_TRS_H1_INT +where rank=1; + + +insert into mmt_staging2.FTDRY_TRS_H1_INT(column2,column3) +select column5,column6 +from mmt_staging2.FTDRY_TRS_H1_INT where rank between 4 and 7; + +--insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Date of Test'); +-- +--insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Report Date'); +-- +--insert into mmt_staging2.FTDRY_TRS_H1_INT(column2) values ('Season'); +-- +--insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Type of Soil'); +-- +--insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Soil Cone Index (kPa)'); +-- +--insert into mmt_staging2.FTDRY_TRS_H1_INT (column2) values ('Field Condition'); +-- +-- +--update mmt_staging2.FTDRY_TRS_H1_INT a +--set column3=(select column5 from mmt_staging2.FTDRY_TRS_H1_INT b +--where trim(a.column2)=trim(b.column4) +--and b.column4='Date of Test') +--where a.column2='Date of Test'; +-- +-- +--update mmt_staging2.FTDRY_TRS_H1_INT a +--set column3=(select column7 from mmt_staging2.FTDRY_TRS_H1_INT b +--where trim(a.column2)=trim(b.column6) +--and b.column6='Report Date') +--where a.column2='Report Date'; +-- +--update mmt_staging2.FTDRY_TRS_H1_INT a +--set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +--where trim(a.column2)=trim(b.column5) +--and b.column5='Season') +--where a.column2='Season'; +-- +--update mmt_staging2.FTDRY_TRS_H1_INT a +--set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +--where trim(a.column2)=trim(b.column5) +--and b.column5='Type of Soil') +--where a.column2='Type of Soil'; +-- +-- +--update mmt_staging2.FTDRY_TRS_H1_INT a +--set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +--where trim(a.column2)=trim(b.column5) +--and b.column5='Soil Cone Index (kPa)') +--where a.column2='Soil Cone Index (kPa)'; +-- +-- +--update mmt_staging2.FTDRY_TRS_H1_INT a +--set column3=(select column6 from mmt_staging2.FTDRY_TRS_H1_INT b +--where trim(a.column2)=trim(b.column5) +--and b.column5='Field Condition') +--where a.column2='Field Condition'; + + +/*inserting data into block -FTDRY_TRS_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_H1_Block',__file_format,__sheet_mnemonic,1); + +v_block:='FTDRY_TRS_H1_Block'; +insert into mmt_staging2.FTDRY_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Soil_Moisture_Content_, +Soil_Bulk_Density_g_cc, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Season, +Type_of_Soil, +Soil_Cone_Index_kPa, +Field_Condition +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTDRY_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + +delete from mmt_staging2.FTDRY_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_H1_Block'); + + +/*inserting data into block -FTDRY_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); + +v_block:='FTDRY_TRS_SPEC_Block'; + +insert into mmt_staging2.FTDRY_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear, +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text); + +delete from mmt_staging2.FTDRY_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + +delete from mmt_staging2.FTDRY_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_SPEC_Block'); + + +/*inserting data into block -FTDRY_TRS_Engine_RPM_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); + +v_block:='FTDRY_TRS_Engine_RPM_Block'; +insert into mmt_staging2.FTDRY_TRS_Engine_RPM_Block +( +dummy_f, +tractor_model, +tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_Engine_RPM'' + or (rank_tag=''FTDRY_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + +delete from mmt_staging2.FTDRY_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTDRY_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTDRY_TRS_Implement_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTDRY_TRS_Implement_Block',__file_format,__sheet_mnemonic,4); + +v_block:='FTDRY_TRS_Implement_Block'; +insert into mmt_staging2.FTDRY_TRS_Implement_Block +( +dummy_f, +Name_of_Implement, +Type_of_Implement, +Make_of_Implement, +No_of_bottoms_Tyne_Disc_Blade, +Cutting_Width_m, +Implement_Weight_Kg, +Hitch_Category, +Span_cm_For_Mounted_Implement, +Mast_Height_cm_For_Mounted_Implement +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_ftdry_trs where rank_tag=''FTDRY_TRS_Implement'' + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text); + +update mmt_staging2.FTDRY_TRS_Implement_Block set dummy_f='dummy' where dummy_f is null; + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_no= (select column2 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_rev_no= (select column4 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +update mmt_staging2.FTDRY_TRS_Implement_Block set report_template_rev_date= (select column6 from mmt_staging2.stg_process_table_ftdry_trs where rank=10 and rank_tag='FTDRY_TRS_Implement'); + + +execute 'update mmt_staging2.FTDRY_TRS_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTDRY_TRS_Implement_Block'); + +if v_query>1 then + v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +else + v_context := 'data not present'; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +end if; +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTDRY_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_ods.txt b/deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_ods.txt new file mode 100644 index 0000000..4608590 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_ods.txt @@ -0,0 +1,357 @@ +drop function if exists mmt_staging2.fn_FTHLG_SUM_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTHLG_SUM_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_FTHLG_SUM_ODS +Function Desc: This function populates data into ODS +File Format: FTHLG +Sheet Format: FTHLG_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTHLG_SUM_ODS(); +***************************************************************/ + + +/*delete from mmt_ods.field_perf_summary where test_file_ref_no =259; + +delete from mmt_ods.field_perf_summary_implement_info where test_file_ref_no =259; + +delete from mmt_ods.field_perf_summary_tractor_info where test_file_ref_no =259; + +delete from mmt_ods.field_perf_summary_trailer_info where test_file_ref_no =259;*/ + +select file_syspk into __file_syspk from mmt_staging2.fthlg_sum_trac_h1_block; + +insert into mmt_ods.field_perf_summary_tractor_info +( +client_id, +function_id, +tractor_model, +tractor_make, +tractor_engine_hp, +rated_rpm, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_front_kg, +tractor_weight_rear_kg, +tractor_weight_total_kg, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +tractor_model, +tractor_make , +tractor_engine_hp::numeric, +rated_rpm::numeric, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_kg_front::numeric tractor_weight_front_kg, +tractor_weight_kg_rear::numeric tractor_weight_rear_kg, +tractor_weight_kg_total::numeric tractor_weight_total_kg, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.fthlg_sum_trac_h1_block where ods_record=1; + +update mmt_ods.field_perf_summary_tractor_info a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=trim(b.tractor_model) and a.test_file_ref_no =b.test_file_ref_no +)where a.test_file_ref_no =__file_syspk; + +insert into mmt_ods.field_perf_summary_trailer_info +( +client_id, +function_id, +trailer_type, +tire_size_and_inflation_pressure_psi, +no_of_axle, +no_of_wheels, +trailer_gross_weight_kg, +tractor_rwc_to_hitch_point_center_dist_mm, +tractor_hitch_ht_mm, +trailer_hitch_height_above_ground_level_mm, +gradient_slope_1_degree, +gradient_slope_2_degree, +tractor_hitch_type, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +Trailer_Type, +Tire_size_and_inflation_pressure_psi, +No_Of_Axle::numeric , +No_Of_Wheels::numeric, +Trailer_Gross_Weight_Kg::numeric, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm::numeric, +Tractor_Hitch_Height_from_Ground_mm::numeric, +Trailer_hitch_Height_above_ground_level_mm::numeric, +Gradient_Slope_1_Degree::numeric, +Gradient_Slope_2_degree::numeric, +Tractor_Hitch_Type, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.FTHLG_SUM_Trail_Type_Block where ods_record=1 and Trailer_Type not in ('Performance Test Results'); + +insert into mmt_ods.field_perf_summary +( +client_id, +function_id, +test_iteration_number, +test_condition, +test_date, +tractor_model, +fuel_consumption_lit_per_hr, +mileage_km_per_ltr, +avg_speed_of_travel_kmph, +total_dist_travelled_km, +gear_used_on_straight_road, +straight_road_rpm_drop, +gear_used_on_up_slope_1, +up_slope_rpm_drop_1, +gear_used_on_up_slope_2, +up_slope_rpm_drop_2, +gear_used_on_down_slope, +down_slope_rpm_shoot_up, +fuel_consumption_var_lit_per_hr, +mileage_var_km_per_ltr, +fuel_consumption_var_pct_lit_per_hr, +mileage_var_pct_km_per_ltr, +engine_smoke_on_load, +engine_acceleration_smoke, +range_gear_shifting, +speed_gear_shifting, +tractor_steer_ability, +tractor_braking_perf, +front_visibility, +implement_accessibility, +front_end_lifting_during_operation, +rpm_recovery_time, +engine_vibration, +engine_sound, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +test_iterationnumber::numeric, +Test_Condition, +Test_Date::date, +Tractor_Model, +Fuel_consumption_Ltr_hr::numeric fuel_consumption_lit_per_hr , +Mileage_Km_Ltr ::numeric mileage_km_per_ltr , +Average_speed_of_travel_kmph::numeric avg_speed_of_travel_kmph , +Total_distance_travelled_km::numeric total_dist_travelled_km , +Gear_used_on_Straight_Road, +Straight_road_RPM_Drop, +Gear_used_on_Up_Slope_1, +Up_Slope_RPM_Drop_1 , +Gear_used_on_Up_Slope_2, +Up_Slope_RPM_Drop_2, +Gear_used_on_Down_Slope, +Down_Slope_RPM_Shoot_up, +fuel_consumption_lit_hr_2::numeric , +Mileage_Km_Ltr_2::numeric , +fuel_consumption_lit_hr_3::numeric , +Mileage_Km_Ltr_3::numeric, +engine_smoke_on_load, +Engine_acceleration_smoke, +Range_Gear_Shifting, +Speed_Gear_Shifting, +Tractor_Steer_ability, +Tractor_braking_performance tractor_braking_perf , +Front_Visibility, +Implement_Accessibility, +Front_end_lifting_during_operation, +RPM_Recovery_Time, +Engine_Vibration, +Engine_Sound, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.fthlg_sum_test_condition_1_block +where ods_record=1; + + + +insert into mmt_ods.field_perf_summary +( +client_id, +function_id, +test_iteration_number, +test_condition, +test_date, +tractor_model, +fuel_consumption_lit_per_hr, +mileage_km_per_ltr, +avg_speed_of_travel_kmph, +total_dist_travelled_km, +gear_used_on_straight_road, +straight_road_rpm_drop, +gear_used_on_up_slope_1, +up_slope_rpm_drop_1, +gear_used_on_up_slope_2, +up_slope_rpm_drop_2, +gear_used_on_down_slope, +down_slope_rpm_shoot_up, +fuel_consumption_var_lit_per_hr, +mileage_var_km_per_ltr, +fuel_consumption_var_pct_lit_per_hr, +mileage_var_pct_km_per_ltr, +engine_smoke_on_load, +engine_acceleration_smoke, +range_gear_shifting, +speed_gear_shifting, +tractor_steer_ability, +tractor_braking_perf, +front_visibility, +implement_accessibility, +front_end_lifting_during_operation, +rpm_recovery_time, +engine_vibration, +engine_sound, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +test_iterationnumber::numeric, +Test_Condition, +Test_Date::date, +Tractor_Model, +Fuel_consumption_Ltr_hr::numeric fuel_consumption_lit_per_hr , +Mileage_Km_Ltr ::numeric mileage_km_per_ltr , +Average_speed_of_travel_kmph::numeric avg_speed_of_travel_kmph , +Total_distance_travelled_km::numeric total_dist_travelled_km , +Gear_used_on_Straight_Road, +Straight_road_RPM_Drop, +Gear_used_on_Up_Slope_1, +Up_Slope_RPM_Drop_1 , +Gear_used_on_Up_Slope_2, +Up_Slope_RPM_Drop_2, +Gear_used_on_Down_Slope, +Down_Slope_RPM_Shoot_up, +fuel_consumption_lit_hr_2::numeric , +Mileage_Km_Ltr_2::numeric, +fuel_consumption_lit_hr_3::numeric , +Mileage_Km_Ltr_3::numeric, +engine_smoke_on_load, +Engine_acceleration_smoke, +Range_Gear_Shifting, +Speed_Gear_Shifting, +Tractor_Steer_ability, +Tractor_braking_performance tractor_braking_perf , +Front_Visibility, +Implement_Accessibility, +Front_end_lifting_during_operation, +RPM_Recovery_Time, +Engine_Vibration, +Engine_Sound, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.fthlg_sum_test_condition_2_block +where ods_record=1; + +update mmt_ods.field_perf_summary +set test_engr_comments=b.test_engineer_comments_1, +test_mgr_comments =b.test_manager_comments_1 +from mmt_staging2.ftdry_sum_comments_by_block b; + +select file_syspk into __file_syspk from mmt_staging2.fthlg_sum_trac_h1_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.field_perf_summary +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.field_perf_summary_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.field_perf_summary_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.field_perf_summary_trailer_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =1 and a.test_file_ref_no =__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =2 and a.test_file_ref_no =__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =3 and a.test_file_ref_no =__file_syspk; + + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =4 and a.test_file_ref_no =__file_syspk; + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTHLG','FTHLG_SUM' ,null,'ods', 'fn_FTHLG_SUM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTHLG','FTHLG_SUM' ,null,'ods', 'fn_FTHLG_SUM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_stg2.txt b/deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_stg2.txt new file mode 100644 index 0000000..45aa9dd --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTHLG-SUM_stg2.txt @@ -0,0 +1,771 @@ +drop function if exists mmt_staging2.fn_FTHLG_SUM_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTHLG_SUM_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + declare v_query int; + + begin + + + +/*********************************************************************************** +Function Name:fn_FTHLG_SUM_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTHLG +Sheet Format: FTHLG_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_fthlg_sum_block(20,1,'FTHLG','FTHLG_SUM',259); +************************************************************************************/ + + +SET search_path TO mmt_staging2; +truncate mmt_staging2.FTHLG_SUM_Trac_H1_Block; +truncate mmt_staging2.FTHLG_SUM_Trail_Type_Block; +truncate mmt_staging2.FTHLG_SUM_Test_Condition_1_Block; +truncate mmt_staging2.FTHLG_SUM_Test_Condition_2_Block; +truncate mmt_staging2.FTHLG_SUM_Comments_By_Block; +truncate mmt_staging2.stg_specific_table_fthlg_sum; +truncate mmt_staging2.stg_process_table_fthlg_sum; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for fthlg*/ + +execute 'insert into mmt_staging2.stg_specific_table_fthlg_sum +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; +select count(*) into v_query from mmt_staging2.stg_specific_table_fthlg_sum; + + +/* trimming data */ +update mmt_staging2.stg_specific_table_fthlg_sum set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_fthlg_sum set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source) ; +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source) ; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_1'','''') +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_fthlg_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null + and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_fthlg_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a set f1_source = replace(f1_source,''_2'','''') + where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_fthlg_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_fthlg_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null where f1_modified =''Test Manager Comments_2'' and + a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Objective Of Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Trailer Type'' + and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition_1:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Engineer Comments_1'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments_1'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition_2:'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Engineer Comments_2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments_2'' + and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +/*inserting data into block -FTHLG_SUM_Trac_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_SUM_Trac_H1_Block',__file_format,__sheet_mnemonic,1); + +v_block:='FTHLG_SUM_Trac_H1_Block'; + +insert into mmt_staging2.FTHLG_SUM_Trac_H1_Block +( +tractor_model, +tractor_make , +tractor_engine_hp, +rated_rpm, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_kg_front, +tractor_weight_kg_rear, +tractor_weight_kg_total, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_fthlg_sum +where rank_tag='FTHLG_SUM_Trac_H1' +order by rank; + +delete from mmt_staging2.FTHLG_SUM_Trac_H1_Block where tractor_model = '0'; + +update mmt_staging2.FTHLG_SUM_Trac_H1_Block set ods_record=0 where rank in (1,2); + + +execute 'update mmt_staging2.FTHLG_SUM_Trac_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_SUM_Trac_H1_Block'); + + +/*inserting data into block -FTHLG_SUM_Trail_Type_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_SUM_Trail_Type_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTHLG_SUM_Trail_Type_Block'; + +insert into mmt_staging2.FTHLG_SUM_Trail_Type_Block +( +Trailer_Type, +Tire_size_and_inflation_pressure_psi, +No_Of_Axle, +No_Of_Wheels, +Trailer_Gross_Weight_Kg, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm, +Tractor_Hitch_Height_from_Ground_mm, +Trailer_hitch_Height_above_ground_level_mm, +Gradient_Slope_1_Degree, +Gradient_Slope_2_degree, +Tractor_Hitch_Type, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_fthlg_sum +where rank_tag='FTHLG_SUM_Trail_Type' +order by rank; + +update mmt_staging2.FTHLG_SUM_Trail_Type_Block set ods_record=0 where rank = 1; + + update mmt_staging2.FTHLG_SUM_Trail_Type_Block a + set trailer_hitch_height_above_ground_level_mm= b.first_value from (SELECT +rank,trailer_hitch_height_above_ground_level_mm, value_partition, first_value(trailer_hitch_height_above_ground_level_mm) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +trailer_hitch_height_above_ground_level_mm, +sum(case when trailer_hitch_height_above_ground_level_mm is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.FTHLG_SUM_Trail_Type_Block where rank >= 2 +ORDER BY rank asc +) as q) b where a.rank = b.rank; + + update mmt_staging2.FTHLG_SUM_Trail_Type_Block a + set tractor_hitch_height_from_ground_mm= b.first_value from (SELECT +rank,tractor_hitch_height_from_ground_mm, value_partition, first_value(tractor_hitch_height_from_ground_mm) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +tractor_hitch_height_from_ground_mm, +sum(case when tractor_hitch_height_from_ground_mm is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.FTHLG_SUM_Trail_Type_Block where rank >= 2 +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + update mmt_staging2.FTHLG_SUM_Trail_Type_Block a + set gradient_slope_1_degree= b.first_value from (SELECT +rank,gradient_slope_1_degree, value_partition, first_value(gradient_slope_1_degree) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +gradient_slope_1_degree, +sum(case when gradient_slope_1_degree is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.FTHLG_SUM_Trail_Type_Block where rank >= 2 +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + update mmt_staging2.FTHLG_SUM_Trail_Type_Block a + set gradient_slope_2_degree= b.first_value from (SELECT +rank,gradient_slope_2_degree, value_partition, first_value(gradient_slope_2_degree) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +gradient_slope_2_degree, +sum(case when gradient_slope_2_degree is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.FTHLG_SUM_Trail_Type_Block where rank >= 2 +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + + update mmt_staging2.FTHLG_SUM_Trail_Type_Block a + set tractor_hitch_type= b.first_value from (SELECT +rank,tractor_hitch_type, value_partition, first_value(tractor_hitch_type) over (partition by value_partition order by rank) +FROM ( +SELECT +rank, +tractor_hitch_type, +sum(case when tractor_hitch_type is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.FTHLG_SUM_Trail_Type_Block where rank >= 2 +ORDER BY rank ASC +) as q) b where a.rank = b.rank; + +execute 'update mmt_staging2.FTHLG_SUM_Trail_Type_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_SUM_Trail_Type_Block'); + + +/*inserting data into block -FTHLG_SUM_Test_Condition_1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_SUM_Test_Condition_1_Block',__file_format,__sheet_mnemonic,3); + +v_block:='FTHLG_SUM_Test_Condition_1_Block'; + +insert into mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Fuel_consumption_Ltr_hr, +Mileage_Km_Ltr, +Average_speed_of_travel_kmph, +Total_distance_travelled_km, +Gear_used_on_Straight_Road, +Straight_road_RPM_Drop, +Gear_used_on_Up_Slope_1, +Up_Slope_RPM_Drop_1, +Gear_used_on_Up_Slope_2, +Up_Slope_RPM_Drop_2, +Gear_used_on_Down_Slope, +Down_Slope_RPM_Shoot_up, +M_M_Performance_compared_to_respective_competitor_tractors_is_better_and_is_poor_than_competitor, +Fuel_consumption_lit_hr_2, +Mileage_Km_Ltr_2, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_3, +Mileage_Km_Ltr_3, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +Range_Gear_Shifting, +Speed_Gear_Shifting, +Tractor_Steer_ability, +Tractor_braking_performance, +Front_Visibility, +Implement_Accessibility, +Front_end_lifting_during_operation, +RPM_Recovery_Time, +Engine_Vibration, +Engine_Sound +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text, +column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_FTHLG_sum where rank_tag=''FTHLG_SUM_Test_Condition_1'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text); + + +update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +set test_iterationnumber=1; + + + +insert into mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Fuel_consumption_Ltr_hr, +Mileage_Km_Ltr, +Average_speed_of_travel_kmph, +Total_distance_travelled_km, +Gear_used_on_Straight_Road, +Straight_road_RPM_Drop, +Gear_used_on_Up_Slope_1, +Up_Slope_RPM_Drop_1, +Gear_used_on_Up_Slope_2, +Up_Slope_RPM_Drop_2, +Gear_used_on_Down_Slope, +Down_Slope_RPM_Shoot_up, +M_M_Performance_compared_to_respective_competitor_tractors_is_better_and_is_poor_than_competitor, +Fuel_consumption_lit_hr_2, +Mileage_Km_Ltr_2, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_3, +Mileage_Km_Ltr_3, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +Range_Gear_Shifting, +Speed_Gear_Shifting, +Tractor_Steer_ability, +Tractor_braking_performance, +Front_Visibility, +Implement_Accessibility, +Front_end_lifting_during_operation, +RPM_Recovery_Time, +Engine_Vibration, +Engine_Sound +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text, +column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_FTHLG_sum where rank_tag=''FTHLG_SUM_Test_Condition_1'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text); + +update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +set test_iterationnumber=2 +where test_iterationnumber is null; + + update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +ORDER BY test_iterationnumber asc +) as q) b where a.test_iterationnumber = b.test_iterationnumber; + +delete from mmt_staging2.FTHLG_SUM_Test_Condition_1_Block where tractor_model = '0' or +fuel_consumption_ltr_hr is NULL; + +update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +set fuel_consumption_lit_hr_2=null where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +set fuel_consumption_lit_hr_2=left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Mileage_Km_Ltr_2 = left(Mileage_Km_Ltr_2,length(Mileage_Km_Ltr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + +update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +set fuel_consumption_lit_hr_3=null where fuel_consumption_lit_hr_3 like '%indicates%'; + +update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +set fuel_consumption_lit_hr_3 = left(fuel_consumption_lit_hr_3,length(fuel_consumption_lit_hr_3)-3), +Mileage_Km_Ltr_3 = left(Mileage_Km_Ltr_3,length(Mileage_Km_Ltr_3)-3) +where fuel_consumption_lit_hr_2 notnull; + +delete from mmt_staging2.FTHLG_SUM_Test_Condition_1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_SUM_Test_Condition_1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_SUM_Test_Condition_1_Block'); + + + +/*inserting data into block -FTHLG_SUM_Test_Condition_2_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_SUM_Test_Condition_2_Block',__file_format,__sheet_mnemonic,4); +v_block:='FTHLG_SUM_Test_Condition_2_Block'; + +insert into mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Fuel_consumption_Ltr_hr, +Mileage_Km_Ltr, +Average_speed_of_travel_kmph, +Total_distance_travelled_km, +Gear_used_on_Straight_Road, +Straight_road_RPM_Drop, +Gear_used_on_Up_Slope_1, +Up_Slope_RPM_Drop_1, +Gear_used_on_Up_Slope_2, +Up_Slope_RPM_Drop_2, +Gear_used_on_Down_Slope, +Down_Slope_RPM_Shoot_up, +M_M_Performance_compared_to_respective_competitor_tractors_is_better_and_is_poor_than_competitor, +Fuel_consumption_lit_hr_2, +Mileage_Km_Ltr_2, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_3, +Mileage_Km_Ltr_3, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +Range_Gear_Shifting, +Speed_Gear_Shifting, +Tractor_Steer_ability, +Tractor_braking_performance, +Front_Visibility, +Implement_Accessibility, +Front_end_lifting_during_operation, +RPM_Recovery_Time, +Engine_Vibration, +Engine_Sound +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_FTHLG_sum where rank_tag=''FTHLG_SUM_Test_Condition_2'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text,a_31 text, + a_32 text,a_33 text); + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set test_iterationnumber=3; + + +insert into mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Fuel_consumption_Ltr_hr, +Mileage_Km_Ltr, +Average_speed_of_travel_kmph, +Total_distance_travelled_km, +Gear_used_on_Straight_Road, +Straight_road_RPM_Drop, +Gear_used_on_Up_Slope_1, +Up_Slope_RPM_Drop_1, +Gear_used_on_Up_Slope_2, +Up_Slope_RPM_Drop_2, +Gear_used_on_Down_Slope, +Down_Slope_RPM_Shoot_up, +M_M_Performance_compared_to_respective_competitor_tractors_is_better_and_is_poor_than_competitor, +Fuel_consumption_lit_hr_2, +Mileage_Km_Ltr_2, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_3, +Mileage_Km_Ltr_3, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +Range_Gear_Shifting, +Speed_Gear_Shifting, +Tractor_Steer_ability, +Tractor_braking_performance, +Front_Visibility, +Implement_Accessibility, +Front_end_lifting_during_operation, +RPM_Recovery_Time, +Engine_Vibration, +Engine_Sound +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text,column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_FTHLG_sum where rank_tag=''FTHLG_SUM_Test_Condition_2'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text,a_31 text, + a_32 text,a_33 text); + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set test_iterationnumber=4 +where test_iterationnumber is null; + + update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +ORDER BY test_iterationnumber asc +) as q) b where a.test_iterationnumber = b.test_iterationnumber; + + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set Test_Date=(select Test_Date from mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +where tractor_model='Mstar Alternate Approach') +where Test_Date='0' and tractor_model ='Mstar Alternate Approach'; + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set Test_Date=(select Test_Date from mmt_staging2.FTHLG_SUM_Test_Condition_1_Block +where tractor_model='Mstar 57 hp BSIII A') +where Test_Date='0' and tractor_model ='Mstar 57 hp BSIII A'; + +delete from mmt_staging2.FTHLG_SUM_Test_Condition_2_Block where tractor_model = '0' or +fuel_consumption_ltr_hr is NULL; + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set fuel_consumption_lit_hr_2=null where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set fuel_consumption_lit_hr_2=left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Mileage_Km_Ltr_2 = left(Mileage_Km_Ltr_2,length(Mileage_Km_Ltr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set fuel_consumption_lit_hr_3=null where fuel_consumption_lit_hr_3 like '%indicates%'; + +update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block +set fuel_consumption_lit_hr_3 = left(fuel_consumption_lit_hr_3,length(fuel_consumption_lit_hr_3)-3), +Mileage_Km_Ltr_3 = left(Mileage_Km_Ltr_3,length(Mileage_Km_Ltr_3)-3) +where fuel_consumption_lit_hr_2 notnull; + + +delete from mmt_staging2.FTHLG_SUM_Test_Condition_2_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_SUM_Test_Condition_2_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_SUM_Test_Condition_2_Block'); + + +/*inserting data into block -FTHLG_SUM_Comments_By_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_SUM_Comments_By_Block',__file_format,__sheet_mnemonic,5); +v_block:='FTHLG_SUM_Comments_By_Block'; + + +insert into mmt_staging2.FTHLG_SUM_Comments_By_Block (dummy_f) values +('dummy'); + +execute 'update mmt_staging2.FTHLG_SUM_Comments_By_Block set test_engineer_comments_1= +(select column3 from mmt_staging2.stg_process_table_fthlg_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTHLG_SUM_Engineer_Comments_1'' +and rank=1 ) where dummy_f=''dummy''' ; + +execute 'update mmt_staging2.FTHLG_SUM_Comments_By_Block set test_engineer_comments_2= +(select column3 from mmt_staging2.stg_process_table_fthlg_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTHLG_SUM_Engineer_Comments_2'' +and rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTHLG_SUM_Comments_By_Block set test_manager_comments_1= +(select column3 from mmt_staging2.stg_process_table_fthlg_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTHLG_SUM_Manager_Comments_1'' +and rank=1 ) where dummy_f=''dummy'''; + +execute 'update mmt_staging2.FTHLG_SUM_Comments_By_Block set test_manager_comments_2= +(select column3 from mmt_staging2.stg_process_table_fthlg_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTHLG_SUM_Manager_Comments_2'' +and rank=1 ) where dummy_f=''dummy'''; + + + +delete from mmt_staging2.FTHLG_SUM_Comments_By_Block where dummy_f is null ; + +execute 'update mmt_staging2.FTHLG_SUM_Comments_By_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_SUM_Comments_By_Block'); + +if v_query>1 then + v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTHLG_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +else + v_context := 'data not present'; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTHLG_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +end if; +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTHLG_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; +end +$$ LANGUAGE plpgsql; + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_ods.txt b/deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_ods.txt new file mode 100644 index 0000000..c7016b9 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_ods.txt @@ -0,0 +1,388 @@ +drop function if exists mmt_staging2.fn_FTHLG_TRS_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTHLG_TRS_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __test_tractor_id int; + declare __test_master_id int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_FTHLG_TRS_ODS +Function Desc: This function populates data into ODS +File Format: FTHLG +Sheet Format: FTHLG_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTHLG_TRS_ODS() +***************************************************************/ + + +/*delete from mmt_ods.test_instance where test_file_ref_no =259; + +delete from mmt_ods.test_instance_engine_info where test_file_ref_no =259; + +delete from mmt_ods.test_instance_implement_info where test_file_ref_no =259; + +delete from mmt_ods.test_instance_tractor_info where test_file_ref_no =259; + + +delete from mmt_ods.test_instance_trailer_info where test_file_ref_no =259; + +delete from mmt_ods.test_instance_tyre_info where test_file_ref_no =259;*/ + +select file_syspk into __file_syspk from mmt_staging2.FTHLG_TRS_H1_Block; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_report_no, +objective_of_test, +background_of_test, +job_order_no, +test_location_name, +gradient_slope_1_degree, +gradient_slope_2_degree, +tractor_hitch_type, +test_engineer, +test_operator, +date_of_test, +test_report_date, +type_of_road, +tractor_hitch_ht_mm, +tractor_rwheel_c2h_dist_mm, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +Report_Reference_No test_report_no , +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location test_location_name, +Gradient_Slope_1_Degree::numeric, +Gradient_Slope_2_Degree::numeric, +Tractor_Hitch_Type, +Test_Engineer, +Test_Operator, +Date_of_Test::date, +Report_Date::date test_report_date, +Type_of_Road, +Tractor_Hitch_Height_from_Ground_mm::numeric tractor_hitch_ht_mm , +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm::numeric tractor_rwheel_c2h_dist_mm, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.FTHLG_TRS_H1_Block where ods_record=1; + + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +tractor_model, +tractor_make, +tractor_sr_no, +tractor_engine_hp, +fip_type, +hour_meter_reading, +steering_type, +transmission_type, +wheel_drive_type, +egr_yn, +brake_type, +pto_type, +standard_pto_speed_rpm, +epto_speed_rpm, +tractor_weight_front_kg, +tractor_weight_rear_kg, +tractor_weight_total_kg, +ballasted_tractor_accessories, +mechanical_ballast_rear, +water_ballast_rear_75_pct, +mechanical_ballast_front_kg, +mechanical_ballast_front, +total_ballast_weight, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP::numeric, +FIP_Type, +Hour_Meter_Reading::float, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No egr_yn, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM::numeric, +EPTO_Speed_RPM, +Tractor_Weight_kg_Front::numeric tractor_weight_front_kg, +Tractor_Weight_kg_Rear::numeric tractor_weight_rear_kg, +Tractor_Weight_kg_Total::numeric tractor_weight_total_kg, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Water_Ballast_Rear_75 water_ballast_rear_75_pct, +Mechanical_Ballast_Front_in_kg::numeric mechanical_ballast_front_kg, +Mechanical_Ballast_Front, +Total_Ballast_Weight::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.fthlg_trs_spec_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_tractor_info +set mahindra_model_yn = ( +case when tractor_make like 'Mahindra%' then 'Y' else 'N' end +) where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info a +set test_tractor_yn ='Y' where syspk in +(select min(syspk) from mmt_ods.test_instance_tractor_info b +where b.test_file_ref_no =a.test_file_ref_no) +and test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_tractor_yn ='N' +where test_tractor_yn is null and test_file_ref_no =__file_syspk; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +tractor_make, +tractor_model, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tyre_type, +tyre_make, +tyre_size, +tyre_pressure_psi +) +select +client_id, +function_id, +tractor_make, +tractor_model, +file_syspk, +file_format, +sheet_mnemonic, +'front', +front_tyre_make tyre_make, +front_tyre_size tyre_size, +front_tyre_pressure_psi::numeric tyre_pressure_psi +from mmt_staging2.fthlg_trs_spec_block where front_tyre_make is not null and ods_record=1; + +update mmt_ods.test_instance_tyre_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.tyre_type ='front' and a.test_file_ref_no =__file_syspk; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +tractor_make, +tractor_model, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tyre_type, +tyre_make, +tyre_size, +tyre_pressure_psi +) +select +client_id, +function_id, +tractor_make, +tractor_model, +file_syspk, +file_format, +sheet_mnemonic, +'rear', +rear_tyre_make tyre_make, +rear_tyre_size tyre_size, +rear_tyre_pressure_psi::numeric tyre_pressure_psi +from mmt_staging2.fthlg_trs_spec_block where rear_tyre_make is not null and ods_record=1; + +update mmt_ods.test_instance_tyre_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.tyre_type ='rear' and a.test_file_ref_no = __file_syspk; + +insert into mmt_ods.test_instance_engine_info +( +client_id, +function_id, +low_idle_declared, +high_idle_declared, +rated_rpm, +engine_to_pto_ratio_540_pto, +engine_to_pto_ratio_540e_pto, +tractor_model, +tractor_make, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +low_idle low_idle_declared, +high_idle high_idle_declared, +rated_rpm::numeric, +engine_to_pto_ratio_540_pto, +engine_to_pto_ratio_540e_pto, +tractor_model, +tractor_make, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.fthlg_trs_engine_rpm_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_engine_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.test_file_ref_no = __file_syspk; + +insert into mmt_ods.test_instance_trailer_info +( +client_id, +function_id, +type_of_trailer, +no_of_axle, +no_of_wheels, +trailer_hitch_ht_above_ground_lvl_mm, +make_model_of_trailer, +trailer_platform_length_mm, +trailer_platform_width_mm, +trailer_platform_height_mm, +tire_size, +inflation_pressure_psi, +track_width_of_trailer_mm, +hzntl_dist_of_hitch_pt_from_trailer_face_mm, +tractor_rwc_to_hitch_pt_center_dist_mm, +dist_from_tractor_rwc_to_trailer_rwc_mm, +dist_from_trailer_front_axle_dist_from_hitch_pt_mm, +trailer_empty_weight_kg, +trailer_gross_weight_kg, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +Type_Of_Trailer, +No_Of_Axle::numeric, +No_Of_Wheels::numeric, +Trailer_hitch_Height_above_ground_level_mm::numeric trailer_hitch_ht_above_ground_lvl_mm, +Make_model_of_trailer, +Trailer_platform_length_mm::numeric, +Trailer_platform_Width_mm::numeric, +Trailer_platform_Height_mm::numeric, +Tire_size, +Inflation_pressure_psi::numeric, +Track_width_of_trailer_mm::numeric, +Horizontal_distance_of_hitch_point_from_trailer_front_face_mm::numeric hzntl_dist_of_hitch_pt_from_trailer_face_mm, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm::numeric tractor_rwc_to_hitch_pt_center_dist_mm, +Distance_from_Trailerfront_axle_distance_from_hitch_point_mm::numeric dist_from_tractor_rwc_to_trailer_rwc_mm, +Distance_from_tractor_rear_wheel_center_to_tractor_rear_wheel_center_mm::numeric dist_from_trailer_front_axle_dist_from_hitch_pt_mm, +Trailer_empty_weight_Kg::numeric, +Trailer_Gross_Weight_Kg::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.fthlg_trs_trailer_block where type_of_trailer is not null and no_of_axle is not null and ods_record=1; + + +update mmt_ods.test_instance a +set report_template_no=b.report_template_no, +report_template_rev_no=b.report_template_rev_no, +report_template_rev_date =b.report_template_rev_date +from mmt_staging2.fthlg_trs_trailer_block b where type_of_trailer is not null and ods_record=1 +and a.test_file_ref_no=b.file_syspk; + + +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select syspk from mmt_ods.test_master into __test_master_id where test_type ='Field'; +select syspk from mmt_ods.test_instance_tractor_info into __test_tractor_id +where test_file_ref_no =__file_syspk and test_tractor_yn ='Y'; + +update mmt_ods.test_instance +set test_master_id =__test_master_id, +test_tractor_id =__test_tractor_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_trailer_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTHLG','FTHLG_TRS' ,null,'ods', 'fn_FTHLG_TRS_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTHLG','FTHLG_TRS' ,null,'ods', 'fn_FTHLG_TRS_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_stg2.txt b/deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_stg2.txt new file mode 100644 index 0000000..c3c0d17 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTHLG-TRS_stg2.txt @@ -0,0 +1,440 @@ +drop function if exists mmt_staging2.fn_fthlg_trs_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_fthlg_trs_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + + + +/*********************************************************************************** +Function Name:fn_FTHLG_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTHLG +Sheet Format: FTHLG_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_fthlg_trs_block(20,1,'FTHLG','FTHLG_TRS',259); +************************************************************************************/ + + SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTHLG_TRS_H1_INT; +truncate mmt_staging2.FTHLG_TRS_H1_Block; +truncate mmt_staging2.FTHLG_TRS_SPEC_Block; +truncate mmt_staging2.FTHLG_TRS_Engine_RPM_Block; +truncate mmt_staging2.FTHLG_TRS_Trailer_Block; +truncate mmt_staging2.stg_specific_table_fthlg_trs; +truncate mmt_staging2.stg_process_table_fthlg_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for ftdry*/ + +execute 'insert into mmt_staging2.stg_specific_table_fthlg_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_fthlg_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_fthlg_trs set column2 = TRIM (LEADING FROM column2 ); + + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_fthlg_trs b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_fthlg_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null where f1_modified =''Trailer Details'' and +a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor specifications sheet'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Trailer Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/*inserting data into FTHLG_TRS_H1_INT*/ +v_block:='FTHLG_TRS_H1_Block'; + +insert into mmt_staging2.FTHLG_TRS_H1_INT +(column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank from mmt_staging2.stg_process_table_fthlg_trs a +where rank_tag='FTHLG_TRS_H1' order by rank; + + +insert into mmt_staging2.FTHLG_TRS_H1_INT(column2) values ('Date of Test'); + +insert into mmt_staging2.FTHLG_TRS_H1_INT(column2) values ('Report Date'); + +insert into mmt_staging2.FTHLG_TRS_H1_INT(column2) values ('Type of Road'); + +insert into mmt_staging2.FTHLG_TRS_H1_INT (column2) values ('Tractor Hitch Height from Ground, mm'); + +insert into mmt_staging2.FTHLG_TRS_H1_INT (column2) values ('Tractor Rear Wheel Center to Hitch Point Center Distance, mm'); + + +update mmt_staging2.FTHLG_TRS_H1_INT a +set column3=(select column5 from mmt_staging2.FTHLG_TRS_H1_INT b +where trim(a.column2)=trim(b.column4) +and b.column4='Date of Test') +where a.column2='Date of Test'; + +update mmt_staging2.FTHLG_TRS_H1_INT a +set column3=(select column7 from mmt_staging2.FTHLG_TRS_H1_INT b +where trim(a.column2)=trim(b.column6) +and b.column6='Report Date') +where a.column2='Report Date'; + +update mmt_staging2.FTHLG_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTHLG_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Type of Road') +where a.column2='Type of Road'; + +update mmt_staging2.FTHLG_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTHLG_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Tractor Hitch Height from Ground, mm') +where a.column2='Tractor Hitch Height from Ground, mm'; + + +update mmt_staging2.FTHLG_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTHLG_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Tractor Rear Wheel Center to Hitch Point Center Distance, mm') +where a.column2='Tractor Rear Wheel Center to Hitch Point Center Distance, mm'; + +/*inserting data into block -.FTHLG_TRS_H1_Block*/ + + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_H1_Block',__file_format,__sheet_mnemonic,1); + + +insert into mmt_staging2.FTHLG_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Gradient_Slope_1_Degree, +Gradient_Slope_2_Degree, +Tractor_Hitch_Type, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Type_of_Road, +Tractor_Hitch_Height_from_Ground_mm, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTHLG_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + + +delete from mmt_staging2.FTHLG_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_H1_Block'); + + + +/*inserting data into block -FTHLG_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTHLG_TRS_SPEC_Block'; + +insert into mmt_staging2.FTHLG_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear_75, +Mechanical_Ballast_Front_in_Kg, +Mechanical_Ballast_Front, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_fthlg_trs where rank_tag=''FTHLG_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text); + +delete from mmt_staging2.FTHLG_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + + +delete from mmt_staging2.FTHLG_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_SPEC_Block'); + + + +/*inserting data into block -FTHLG_TRS_Engine_RPM_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTHLG_TRS_Engine_RPM_Block'; + +insert into mmt_staging2.FTHLG_TRS_Engine_RPM_Block +( +dummy_f, +Tractor_model, +Tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_fthlg_trs where rank_tag=''FTHLG_TRS_Engine_RPM'' + or (rank_tag=''FTHLG_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + +delete from mmt_staging2.FTHLG_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTHLG_TRS_Trailer_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_Trailer_Block',__file_format,__sheet_mnemonic,4); +v_block:='FTHLG_TRS_Trailer_Block'; + +insert into mmt_staging2.FTHLG_TRS_Trailer_Block +( +dummy_f, +Type_Of_Trailer, +No_Of_Axle, +No_Of_Wheels, +Trailer_hitch_Height_above_ground_level_mm, +Make_model_of_trailer, +Trailer_platform_length_mm, +Trailer_platform_Width_mm, +Trailer_platform_Height_mm, +Tire_size, +Inflation_pressure_psi, +Track_width_of_trailer_mm, +Horizontal_distance_of_hitch_point_from_trailer_front_face_mm, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm, +Distance_from_Trailerfront_axle_distance_from_hitch_point_mm, +Distance_from_tractor_rear_wheel_center_to_tractor_rear_wheel_center_mm, +Trailer_empty_weight_Kg, +Trailer_Gross_Weight_Kg +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_fthlg_trs where rank_tag=''FTHLG_TRS_Trailer'' and rank <=17 + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text + ,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text); + + +update mmt_staging2.FTHLG_TRS_Trailer_Block set report_template_no= +(select column2 from mmt_staging2.stg_process_table_fthlg_trs where rank=18 +and rank_tag='FTHLG_TRS_Trailer')where make_model_of_trailer is not null; + +update mmt_staging2.FTHLG_TRS_Trailer_Block set report_template_rev_no= +(select column4 from mmt_staging2.stg_process_table_fthlg_trs where rank=18 +and rank_tag='FTHLG_TRS_Trailer')where make_model_of_trailer is not null; + + +update mmt_staging2.FTHLG_TRS_Trailer_Block set report_template_rev_date= +(select column6 from mmt_staging2.stg_process_table_fthlg_trs where rank=18 and +rank_tag='FTHLG_TRS_Trailer')where make_model_of_trailer is not null; + + +execute 'update mmt_staging2.FTHLG_TRS_Trailer_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_Trailer_Block'); +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTHLG_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTHLG_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTHLG_TRS_stg2_version2.sql b/deployment-20210427T103328Z-001/deployment/field/FTHLG_TRS_stg2_version2.sql new file mode 100644 index 0000000..5ab3dd7 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTHLG_TRS_stg2_version2.sql @@ -0,0 +1,421 @@ +drop function if exists mmt_staging2.fn_fthlg_trs_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_fthlg_trs_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + declare v_query int; + + begin + + + + +/*********************************************************************************** +Function Name:fn_FTHLG_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTHLG +Sheet Format: FTHLG_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_fthlg_trs_block(20,1,'FTHLG','FTHLG_TRS',259); +************************************************************************************/ + + SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTHLG_TRS_H1_INT; +truncate mmt_staging2.FTHLG_TRS_H1_Block; +truncate mmt_staging2.FTHLG_TRS_SPEC_Block; +truncate mmt_staging2.FTHLG_TRS_Engine_RPM_Block; +truncate mmt_staging2.FTHLG_TRS_Trailer_Block; +truncate mmt_staging2.stg_specific_table_fthlg_trs; +truncate mmt_staging2.stg_process_table_fthlg_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for ftdry*/ + +execute 'insert into mmt_staging2.stg_specific_table_fthlg_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; +select count(*) into v_query from mmt_staging2.stg_specific_table_fthlg_trs; + +/* trimming data */ +update mmt_staging2.stg_specific_table_fthlg_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_fthlg_trs set column2 = TRIM (LEADING FROM column2 ); + + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_fthlg_trs b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_fthlg_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null where f1_modified =''Trailer Details'' and +a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor specifications sheet'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_fthlg_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_fthlg_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Trailer Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/*inserting data into FTHLG_TRS_H1_INT*/ +v_block:='FTHLG_TRS_H1_Block'; + +insert into mmt_staging2.FTHLG_TRS_H1_INT +(column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank from mmt_staging2.stg_process_table_fthlg_trs a +where rank_tag='FTHLG_TRS_H1' order by rank; + + + +insert into mmt_staging2.FTHLG_TRS_H1_INT(column2,column3) +select 'Date of Test',column5 +from mmt_staging2.FTHLG_TRS_H1_INT +where rank=1; + +insert into mmt_staging2.FTHLG_TRS_H1_INT(column2,column3) +select 'Report Date',column7 +from mmt_staging2.FTHLG_TRS_H1_INT +where rank=1; + +insert into mmt_staging2.FTHLG_TRS_H1_INT(column2,column3) +select column5,column6 +from mmt_staging2.FTHLG_TRS_H1_INT +where rank in (5,6,8); + +/*inserting data into block -.FTHLG_TRS_H1_Block*/ + + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_H1_Block',__file_format,__sheet_mnemonic,1); + + +insert into mmt_staging2.FTHLG_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Gradient_Slope_1_Degree, +Gradient_Slope_2_Degree, +Tractor_Hitch_Type, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Type_of_Road, +Tractor_Hitch_Height_from_Ground_mm, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTHLG_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + + +delete from mmt_staging2.FTHLG_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_H1_Block'); + + + +/*inserting data into block -FTHLG_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTHLG_TRS_SPEC_Block'; + +insert into mmt_staging2.FTHLG_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear_75, +Mechanical_Ballast_Front_in_Kg, +Mechanical_Ballast_Front, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_fthlg_trs where rank_tag=''FTHLG_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text); + +delete from mmt_staging2.FTHLG_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + + +delete from mmt_staging2.FTHLG_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_SPEC_Block'); + + + +/*inserting data into block -FTHLG_TRS_Engine_RPM_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTHLG_TRS_Engine_RPM_Block'; + +insert into mmt_staging2.FTHLG_TRS_Engine_RPM_Block +( +dummy_f, +Tractor_model, +Tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_fthlg_trs where rank_tag=''FTHLG_TRS_Engine_RPM'' + or (rank_tag=''FTHLG_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + +delete from mmt_staging2.FTHLG_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTHLG_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTHLG_TRS_Trailer_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTHLG_TRS_Trailer_Block',__file_format,__sheet_mnemonic,4); +v_block:='FTHLG_TRS_Trailer_Block'; + +insert into mmt_staging2.FTHLG_TRS_Trailer_Block +( +dummy_f, +Type_Of_Trailer, +No_Of_Axle, +No_Of_Wheels, +Trailer_hitch_Height_above_ground_level_mm, +Make_model_of_trailer, +Trailer_platform_length_mm, +Trailer_platform_Width_mm, +Trailer_platform_Height_mm, +Tire_size, +Inflation_pressure_psi, +Track_width_of_trailer_mm, +Horizontal_distance_of_hitch_point_from_trailer_front_face_mm, +Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm, +Distance_from_Trailerfront_axle_distance_from_hitch_point_mm, +Distance_from_tractor_rear_wheel_center_to_tractor_rear_wheel_center_mm, +Trailer_empty_weight_Kg, +Trailer_Gross_Weight_Kg +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_fthlg_trs where rank_tag=''FTHLG_TRS_Trailer'' and rank <=17 + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text + ,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text); + + +update mmt_staging2.FTHLG_TRS_Trailer_Block set report_template_no= +(select column2 from mmt_staging2.stg_process_table_fthlg_trs where rank=18 +and rank_tag='FTHLG_TRS_Trailer')where make_model_of_trailer is not null; + +update mmt_staging2.FTHLG_TRS_Trailer_Block set report_template_rev_no= +(select column4 from mmt_staging2.stg_process_table_fthlg_trs where rank=18 +and rank_tag='FTHLG_TRS_Trailer')where make_model_of_trailer is not null; + + +update mmt_staging2.FTHLG_TRS_Trailer_Block set report_template_rev_date= +(select column6 from mmt_staging2.stg_process_table_fthlg_trs where rank=18 and +rank_tag='FTHLG_TRS_Trailer')where make_model_of_trailer is not null; + + +execute 'update mmt_staging2.FTHLG_TRS_Trailer_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTHLG_TRS_Trailer_Block'); +if v_query>1 then + v_context := ''; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTHLG_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +else + v_context := 'data not present'; + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTHLG_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +end if; +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTHLG_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + +select mmt_staging2.fn_fthlg_trs_block(20,1,'FTHLG','FTHLG_TRS',702); + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_ods.txt b/deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_ods.txt new file mode 100644 index 0000000..a8ce083 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_ods.txt @@ -0,0 +1,298 @@ +drop function if exists mmt_staging2.fn_FTWET_SUM_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_SUM_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_FTWET_SUM_ODS +Function Desc: This function populates data into ODS +File Format: FTWET +Sheet Format: FTWET_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTWET_SUM_ODS() +***************************************************************/ + + +/*delete from mmt_ods.field_perf_summary where test_file_ref_no =260; + +delete from mmt_ods.field_perf_summary_implement_info where test_file_ref_no =260; + +delete from mmt_ods.field_perf_summary_tractor_info where test_file_ref_no =260;*/ +select file_syspk into __file_syspk from mmt_staging2.ftwet_sum_trac_h1_block; + + +insert into mmt_ods.field_perf_summary_tractor_info +( +client_id, +function_id, +tractor_model, +tractor_make, +tractor_engine_hp, +rated_rpm, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_front_kg, +tractor_weight_rear_kg, +tractor_weight_total_kg, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +tractor_model, +tractor_make, +trim('HP' from tractor_engine_hp)::numeric, +rated_rpm::numeric, +transmission_type, +wheel_drive_type, +fip_type, +steering_type, +tractor_weight_kg_front::numeric, +tractor_weight_kg_rear::numeric, +tractor_weight_kg_total::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftwet_sum_trac_h1_block where ods_record=1; + +update mmt_ods.field_perf_summary_tractor_info a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=trim(b.tractor_model) and a.test_file_ref_no =b.test_file_ref_no +)where a.test_file_ref_no =__file_syspk; + + +insert into mmt_ods.field_perf_summary_implement_info +( +client_id, +function_id, +name_of_implement, +implement_type, +implement_size, +hitch_category, +implement_weight, +soil_type, +soil_moisture_content_pct, +soil_bulk_density_g_per_cc, +soil_cone_index, +field_condition, +season, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +make_of_implement, +implement_type, +implement_size, +hitch_category, +implement_weight::numeric, +soil_type, +moisture_content::numeric soil_moisture_content_pct, +bulk_density_g_cc::numeric soil_bulk_density_g_per_cc, +soil_cone_index::numeric soil_cone_index, +field_condition, +season, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftwet_sum_implement_block where ods_record=1; + + +insert into mmt_ods.field_perf_summary_implement_info +( +client_id, +function_id, +type_of_cage_wheel, +cage_wheel_width_mm, +cage_wheel_weight, +cage_wheel_inner_and_outer_ring_dia_mm, +cage_wheel_center_ring_dia_mm, +no_of_angles_on_cage_wheel, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +Type_of_Cage_Wheel, +Cage_Wheel_Width_mm::numeric, +Cage_wheel_Weight::numeric, +Cage_Wheel_inner_Outer_Ring_Dia_mm::numeric cage_wheel_inner_and_outer_ring_dia_mm, +Cage_Wheel_Center_Ring_Dia_mm::numeric, +No_of_angles_on_cage_wheel::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.FTWET_SUM_Cage_Wheel_Block where ods_record=1; + + +insert into mmt_ods.field_perf_summary +( +client_id, +function_id, +test_iteration_number, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight_1st_Pass, +Engine_RPM_Drop_on_straight_2nd_Pass, +Engine_RPM_Drop_on_straight_3rd_Pass, +Engine_RPM_Drop_on_turn_1st_Pass, +Engine_RPM_Drop_on_turn_2nd_Pass, +Engine_RPM_Drop_on_turn_3rd_Pass, +No_of_passes, +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, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +test_iterationnumber::numeric, +Test_Condition, +Test_Date::date, +Tractor_Model, +Engine_RPM_set::numeric, +PTO_RPM_set::numeric, +Gear_Used, +Nominal_Speed_KMPH::numeric, +Engine_RPM_Drop_on_straight_1st_Pass, +Engine_RPM_Drop_on_straight_2nd_Pass, +Engine_RPM_Drop_on_straight_3rd_Pass, +Engine_RPM_Drop_on_turn_1st_Pass, +Engine_RPM_Drop_on_turn_2nd_Pass, +Engine_RPM_Drop_on_turn_3rd_Pass, +No_of_passes::numeric, +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, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +Draft_Response, +Tractor_Steer_ability, +Tractor_braking_performance 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_Lowering_response implement_lifting_per_lowering_response, +Pulverization_Quality, +Pulverization_Index, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.FTWET_SUM_Test_Condition_Block where ods_record=1; + +update mmt_ods.field_perf_summary +set test_mgr_comments =b.test_manager_comments +from mmt_staging2.ftwet_sum_comments_by_block b; + +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.field_perf_summary +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.field_perf_summary_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.field_perf_summary_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.field_perf_summary_trailer_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.field_perf_summary_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =1 and a.test_file_ref_no =__file_syspk; + +update mmt_ods.field_perf_summary a +set test_instance_tractor_id = (select syspk +from mmt_ods.test_instance_tractor_info b +where a.tractor_model=b.tractor_model and a.test_file_ref_no =b.test_file_ref_no +)where test_iteration_number =2 and a.test_file_ref_no =__file_syspk; + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTWET','FTWET_SUM' ,null,'ods', 'fn_FTWET_SUM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTWET','FTWET_SUM' ,null,'ods', 'fn_FTWET_SUM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_stg2.txt b/deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_stg2.txt new file mode 100644 index 0000000..381929e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTWET-SUM_stg2.txt @@ -0,0 +1,477 @@ +drop function if exists mmt_staging2.fn_FTWET_SUM_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_SUM_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + + +/*********************************************************************************** +Function Name:fn_FTWET_SUM_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTWET +Sheet Format: FTWET_SUM +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_ftwet_sum_block(20,1,'FTWET','FTWET_SUM',260); +************************************************************************************/ + +SET search_path TO mmt_staging2; +truncate mmt_staging2.FTWET_SUM_Trac_H1_Block; +truncate mmt_staging2.FTWET_SUM_Implement_Block; +truncate mmt_staging2.FTWET_SUM_Cage_Wheel_Block; +truncate mmt_staging2.FTWET_SUM_Test_Condition_Block; +truncate mmt_staging2.FTWET_SUM_Comments_By_Block; +truncate mmt_staging2.stg_specific_table_ftwet_sum; +truncate mmt_staging2.stg_process_table_ftwet_sum; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for ftwet*/ + +execute 'insert into mmt_staging2.stg_specific_table_ftwet_sum +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' + and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_ftwet_sum set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftwet_sum set column2 = TRIM (LEADING FROM column2 ); + + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftwet_sum b +where F1_source=column2 +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftwet_sum a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where F1_source=column2 +and b.row_number_start=a.row_number +and is_rownumber_fetched is null and +a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null where f1_modified =''Test Manager Comments'' and +a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_ftwet_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Model'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_ftwet_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Make of Implement'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Type of Cage Wheel'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Condition:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_sum +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_sum a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Manager Comments'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +/*inserting data into block -FTWET_SUM_Trac_H1_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_SUM_Trac_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='FTWET_SUM_Trac_H1_Block'; + +insert into mmt_staging2.FTWET_SUM_Trac_H1_Block +( +Tractor_Model, +Tractor_Make, +Tractor_Engine_HP, +Rated_RPM, +Transmission_Type, +Wheel_Drive_Type, +FIP_Type, +Steering_Type, +Tractor_Weight_kg_Front, +Tractor_Weight_kg_Rear, +Tractor_Weight_kg_Total, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_FTWET_sum +where rank_tag='FTWET_SUM_Trac_H1' +order by rank; + +delete from mmt_staging2.FTWET_SUM_Trac_H1_Block where tractor_model='0'; + +update mmt_staging2.FTWET_SUM_Trac_H1_Block set ods_record=0 where rank=1; + + +execute 'update mmt_staging2.FTWET_SUM_Trac_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_SUM_Trac_H1_Block'); + +/*inserting data into block -FTWET_SUM_Implement_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_SUM_Implement_Block',__file_format,__sheet_mnemonic,2); + +v_block:='FTWET_SUM_Implement_Block'; + +insert into mmt_staging2.FTWET_SUM_Implement_Block +( +Make_of_Implement, +Implement_Type, +Implement_Size, +Hitch_Category, +Implement_Weight, +Soil_Type, +Moisture_Content , +Bulk_Density_g_cc , +Soil_Cone_index, +Field_Condition , +Season, +rank +) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_FTWET_sum +where rank_tag='FTWET_SUM_Impement' +order by rank; + +execute 'update mmt_staging2.FTWET_SUM_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +update mmt_staging2.FTWET_SUM_Implement_Block set ods_record=0 where rank=1; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_SUM_Implement_Block'); + + +/*inserting data into block -FTWET_SUM_Cage_Wheel_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_SUM_Cage_Wheel_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTWET_SUM_Cage_Wheel_Block'; + +insert into mmt_staging2.FTWET_SUM_Cage_Wheel_Block +( +Type_of_Cage_Wheel, +Cage_Wheel_Width_mm, +Cage_wheel_Weight, +Cage_Wheel_inner_Outer_Ring_Dia_mm, +Cage_Wheel_Center_Ring_Dia_mm, +Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm, +No_of_angles_on_cage_wheel, +rank +) +select column2,column3,column4,column5,column6,column7,column8,rank +from mmt_staging2.stg_process_table_FTWET_sum +where rank_tag='FTWET_SUM_Cage_Wheel' +order by rank; + +update mmt_staging2.FTWET_SUM_Cage_Wheel_Block +set ods_record=0 where rank in (1,3); + +execute 'update mmt_staging2.FTWET_SUM_Cage_Wheel_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_SUM_Cage_Wheel_Block'); + + +/*inserting data into block -FTWET_SUM_Test_Condition_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_SUM_Test_Condition_Block',__file_format,__sheet_mnemonic,4); +v_block:='FTWET_SUM_Test_Condition_Block'; + +insert into mmt_staging2.FTWET_SUM_Test_Condition_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight_1st_Pass, +Engine_RPM_Drop_on_straight_2nd_Pass, +Engine_RPM_Drop_on_straight_3rd_Pass, +Engine_RPM_Drop_on_turn_1st_Pass, +Engine_RPM_Drop_on_turn_2nd_Pass, +Engine_RPM_Drop_on_turn_3rd_Pass, +No_of_passes, +Avg_Depth_of_cut_cm, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text, +column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_FTWET_sum where rank_tag=''FTWET_SUM_Test_Condition'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text,a_34 text,a_35 text,a_36 text,a_37 text,a_38 text); + +update mmt_staging2.FTWET_SUM_Test_Condition_Block +set test_iterationnumber=1 +where test_iterationnumber is null; + +insert into mmt_staging2.FTWET_SUM_Test_Condition_Block +( +dummy_f, +Test_Condition, +Test_Date, +Tractor_Model, +Engine_RPM_set, +PTO_RPM_set, +Gear_Used, +Nominal_Speed_KMPH, +Engine_RPM_Drop_on_straight_1st_Pass, +Engine_RPM_Drop_on_straight_2nd_Pass, +Engine_RPM_Drop_on_straight_3rd_Pass, +Engine_RPM_Drop_on_turn_1st_Pass, +Engine_RPM_Drop_on_turn_2nd_Pass, +Engine_RPM_Drop_on_turn_3rd_Pass, +No_of_passes, +Avg_Depth_of_cut_cm, +Fuel_consumption_lit_hr, +Area_covered_acr_hr, +Fuel_consumption_lit_Acr, +M_M_Performance_in_compared_to_respective_competitor_tractors, +Fuel_consumption_lit_hr_2, +Area_covered_acr_hr_2, +Fuel_consumption_lit_Acr_2, +Trail_Observations, +Engine_Smoke_on_Load, +Engine_acceleration_smoke, +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_Lifting_Lowering_response, +Pulverization_Quality, +Pulverization_Index +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column8,column9,column10,column11,column12}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column8::text, +column9::text,column10::text,column11::text,column12::text]) AS val + FROM mmt_staging2.stg_process_table_FTWET_sum where rank_tag=''FTWET_SUM_Test_Condition'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text + ,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text,a_30 text, +a_31 text,a_32 text,a_33 text,a_34 text,a_35 text,a_36 text,a_37 text,a_38 text); + +update mmt_staging2.FTWET_SUM_Test_Condition_Block +set test_iterationnumber=2 +where test_iterationnumber is null; + + update mmt_staging2.FTWET_SUM_Test_Condition_Block a + set Test_Condition= b.first_value from (SELECT +test_iterationnumber,Test_Condition, value_partition, first_value(Test_Condition) over (partition by value_partition order by test_iterationnumber) +FROM ( +SELECT +test_iterationnumber, +Test_Condition, +sum(case when Test_Condition is null then 0 else 1 end) over (order by test_iterationnumber) as value_partition + FROM mmt_staging2.FTWET_SUM_Test_Condition_Block +ORDER BY test_iterationnumber asc +) as q) b where a.test_iterationnumber = b.test_iterationnumber; + + +delete from mmt_staging2.FTWET_SUM_Test_Condition_Block +where tractor_model is null or engine_rpm_set = '0'; + +update mmt_staging2.FTWET_SUM_Test_Condition_Block set fuel_consumption_lit_hr_2=null +where fuel_consumption_lit_hr_2 like '%indicates%'; + +update mmt_staging2.FTWET_SUM_Test_Condition_Block set fuel_consumption_lit_hr_2 = left(fuel_consumption_lit_hr_2,length(fuel_consumption_lit_hr_2)-3), +Area_covered_acr_hr_2 = left(Area_covered_acr_hr_2,length(Area_covered_acr_hr_2)-3) , +Fuel_consumption_lit_Acr_2 = left(Fuel_consumption_lit_Acr_2,length(Fuel_consumption_lit_Acr_2)-3) +where fuel_consumption_lit_hr_2 notnull; + + +delete from mmt_staging2.FTWET_SUM_Test_Condition_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_SUM_Test_Condition_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_SUM_Test_Condition_Block'); + + +/*inserting data into block -FTWET_SUM_Comments_By_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_SUM_Comments_By_Block',__file_format,__sheet_mnemonic,5); +v_block:='FTWET_SUM_Comments_By_Block'; + + +insert into mmt_staging2.FTWET_SUM_Comments_By_Block (dummy_f) values ('dummy'); + +execute 'update mmt_staging2.FTWET_SUM_Comments_By_Block set test_manager_comments= +(select column3 from mmt_staging2.stg_process_table_FTWET_sum a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.rank_tag=''FTWET_SUM_Manager_Comments'' +and a.rank=1 ) where dummy_f=''dummy'''; + + +delete from mmt_staging2.FTWET_SUM_Comments_By_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_SUM_Comments_By_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_SUM_Comments_By_Block'); +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTWET_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTWET_SUM_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); + return v_context; +end +$$ LANGUAGE plpgsql; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_ods.txt b/deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_ods.txt new file mode 100644 index 0000000..84c300e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_ods.txt @@ -0,0 +1,390 @@ +drop function if exists mmt_staging2.fn_FTWET_TRS_ODS ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_TRS_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __test_tractor_id int; + declare __test_master_id int; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + + +__file_syspk := p_file_syspk; + +/************************************************************ +Function Name:fn_FTWET_TRS_ODS +Function Desc: This function populates data into ODS +File Format: FTWET +Sheet Format: FTWET_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_FTWET_TRS_ODS() +***************************************************************/ + + +/*delete from mmt_ods.test_instance where test_file_ref_no =260; + +delete from mmt_ods.test_instance_engine_info where test_file_ref_no =260; + +delete from mmt_ods.test_instance_implement_info where test_file_ref_no =260; + +delete from mmt_ods.test_instance_tractor_info where test_file_ref_no =260; + + +delete from mmt_ods.test_instance_trailer_info where test_file_ref_no =260; + +delete from mmt_ods.test_instance_tyre_info where test_file_ref_no =260;*/ + +select file_syspk into __file_syspk from mmt_staging2.FTWET_TRS_H1_Block; + + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_report_no, +objective_of_test, +background_of_test, +job_order_no, +test_location_name, +soil_moisture_content_pct, +soil_bulk_density_g_per_cc, +test_engineer, +test_operator, +date_of_test, +test_report_date, +season, +type_of_soil, +soil_cone_index, +field_condition, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select client_id, +function_id, +report_reference_no test_report_no, +objective_of_test, +background_of_test, +job_order_no, +test_location test_location_name, +soil_moisture_content_::numeric soil_moisture_content_pct , +soil_bulk_density_g_cc::numeric soil_bulk_density_g_per_cc, +test_engineer, +test_operator, +date_of_test::date, +report_date::date test_report_date, +season, +type_of_soil, +soil_cone_index_kpa::int soil_cone_index, +field_condition, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftwet_trs_h1_block where ods_record=1; + + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +tractor_model, +tractor_make, +tractor_sr_no, +tractor_engine_hp, +fip_type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +wheel_drive_type, +egr_yn, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +tractor_weight_front_kg, +tractor_weight_rear_kg, +tractor_weight_total_kg, +Ballasted_Tractor_Accessories, +mechanical_ballast_rear_in_kg, +water_ballast_rear_75_pct , +Mechanical_Ballast_Front, +mechanical_ballast_front_kg , +Total_Ballast_Weight, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select client_id, +function_id, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +trim('HP' from Tractor_Engine_HP)::numeric, +FIP_Type, +hour_Meter_Reading::numeric, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD wheel_drive_type , +EGR_Yes_No egr_yn, +Brake_Type , +PTO_Type , +Standard_PTO_Speed_RPM::numeric, +EPTO_Speed_RPM::numeric, +Tractor_Weight_kg_Front::numeric tractor_weight_front_kg , +Tractor_Weight_kg_Rear::numeric tractor_weight_rear_kg , +Tractor_Weight_kg_Total::numeric tractor_weight_total_kg , +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear_in_KG::numeric mechanical_ballast_rear_in_kg , +Water_Ballast_Rear water_ballast_rear_75_pct , +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg::int mechanical_ballast_front_kg , +Total_Ballast_Weight::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftwet_trs_spec_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_tractor_info +set mahindra_model_yn = ( +case when tractor_make like 'Mahindra%' then 'Y' else 'N' end +) where test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info a +set test_tractor_yn ='Y' where syspk in +(select min(syspk) from mmt_ods.test_instance_tractor_info b +where b.test_file_ref_no =a.test_file_ref_no) +and test_file_ref_no =__file_syspk; + +update mmt_ods.test_instance_tractor_info +set test_tractor_yn ='N' +where test_tractor_yn is null and test_file_ref_no =__file_syspk; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +tractor_make, +tractor_model, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tyre_type, +tyre_make, +tyre_size, +tyre_pressure_psi +) +select +client_id, +function_id, +tractor_make, +tractor_model, +file_syspk, +file_format, +sheet_mnemonic, +'front', +front_tyre_make tyre_make, +front_tyre_size tyre_size, +front_tyre_pressure_psi::int tyre_pressure_psi +from mmt_staging2.ftwet_trs_spec_block where front_tyre_make is not null and ods_record=1; + +update mmt_ods.test_instance_tyre_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.tyre_type ='front' and a.test_file_ref_no =__file_syspk; + +insert into mmt_ods.test_instance_tyre_info +( +client_id, +function_id, +tractor_make, +tractor_model, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tyre_type, +tyre_make, +tyre_size, +tyre_pressure_psi +) +select +client_id, +function_id, +tractor_make, +tractor_model, +file_syspk, +file_format, +sheet_mnemonic, +'rear', +rear_tyre_make tyre_make, +rear_tyre_size tyre_size, +rear_tyre_pressure_psi::numeric tyre_pressure_psi +from mmt_staging2.ftwet_trs_spec_block where rear_tyre_make is not null and ods_record=1; + +update mmt_ods.test_instance_tyre_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.tyre_type ='rear' and a.test_file_ref_no = __file_syspk; + +insert into mmt_ods.test_instance_engine_info +( +client_id, +function_id, +low_idle_declared, +high_idle_declared, +rated_rpm, +engine_to_pto_ratio_540_pto, +engine_to_pto_ratio_540e_pto, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +low_idle low_idle_declared, +high_idle high_idle_declared, +rated_rpm::numeric, +engine_to_pto_ratio_540_pto, +engine_to_pto_ratio_540e_pto, +file_syspk, +file_format, +sheet_mnemonic + from mmt_staging2.ftwet_trs_engine_rpm_block where tractor_model is not null and ods_record=1; + +update mmt_ods.test_instance_engine_info a +set test_instance_tractor_id =(select syspk +from mmt_ods.test_instance_tractor_info b +where a.test_file_ref_no=b.test_file_ref_no and +a.tractor_model=b.tractor_model) +where a.test_file_ref_no = __file_syspk; + +insert into mmt_ods.test_instance_implement_info +( +client_id, +function_id, +name_of_implement, +type_of_implement, +make_of_implement, +no_of_disc_blades_bottoms, +cutting_width_m, +implement_weight_kg, +hitch_category, +span_for_mounted_implement_mm, +mast_height_for_mounted_implement_mm, +type_of_cage_wheel_hcw_fcw, +Cage_Wheel_Width_mm, +cage_wheel_weight_kg, +cage_wheel_inner_ring_dia_mm, +cage_wheel_outer_ring_dia_mm, +cage_wheel_center_ring_dia_mm, +dist_btwn_lhs_fcw_to_rhs_fcw_mm, +No_of_angles_on_cage_wheel, +No_of_days_of_water_logging, +Depth_of_water_mm, +test_file_ref_no, +test_file_format, +test_file_sheet_format +) +select +client_id, +function_id, +name_of_implement, +type_of_implement, +make_of_implement, +no_of_bottoms_tyne_disc_blade::numeric no_of_disc_blades_bottoms, +cutting_width_m, +implement_weight_kg::numeric, +hitch_category, +span_cm_for_mounted_implement::numeric span_for_mounted_implement_cm , +mast_height_cm_for_mounted_implement::numeric mast_height_for_mounted_implement_cm, +Type_of_Cage_Wheel_Half_Cage_wheel_Full_Cage_Wheel type_of_cage_wheel_hcw_fcw , +Cage_Wheel_Width_mm::numeric, +Cage_wheel_Weight::numeric cage_wheel_weight_kg, +Cage_Wheel_inner_Outer_Ring_Dia_mm::numeric cage_wheel_inner_ring_dia_mm , +Cage_Wheel_inner_Outer_Ring_Dia_mm::numeric cage_wheel_outer_ring_dia_mm, +Cage_Wheel_Center_Ring_Dia_mm::numeric cage_wheel_center_ring_dia_mm , +Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel::int dist_btwn_lhs_fcw_to_rhs_fcw_mm, +No_of_angles_on_cage_wheel::numeric, +No_of_days_of_water_logging::numeric, +Depth_of_water_mm::numeric, +file_syspk, +file_format, +sheet_mnemonic +from mmt_staging2.ftwet_trs_implement_block where name_of_implement is not null and ods_record=1; + + +update mmt_ods.test_instance a +set report_template_no=b.report_template_no, +report_template_rev_no=b.report_template_rev_no, +report_template_rev_date =b.report_template_rev_date +from mmt_staging2.ftwet_trs_implement_block b where name_of_implement is not null +and a.test_file_ref_no=b.file_syspk; + + +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; +select syspk from mmt_ods.test_master into __test_master_id where test_type ='Field'; +select syspk from mmt_ods.test_instance_tractor_info into __test_tractor_id +where test_file_ref_no =__file_syspk and test_tractor_yn ='Y'; + + +update mmt_ods.test_instance +set test_master_id =__test_master_id, +test_tractor_id =__test_tractor_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + + +update mmt_ods.test_instance_tyre_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_implement_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_trailer_info +set test_instance_id=__test_instance_id +where test_file_ref_no=__file_syspk; + +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTWET','FTWET_TRS' ,null,'ods', 'fn_FTWET_TRS_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'FTWET','FTWET_TRS' ,null,'ods', 'fn_FTWET_TRS_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_stg2.txt b/deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_stg2.txt new file mode 100644 index 0000000..ff9504e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTWET-TRS_stg2.txt @@ -0,0 +1,441 @@ +/*FTWET_TRS starts*/ + +drop function if exists mmt_staging2.fn_FTWET_TRS_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_TRS_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + + +/*********************************************************************************** +Function Name:fn_FTWET_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTWET +Sheet Format: FTWET_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_fthlg_trs_block(20,1,'FTHLG','FTWET_TRS',260); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTWET_TRS_H1_INT; +truncate mmt_staging2.FTWET_TRS_H1_Block; +truncate mmt_staging2.FTWET_TRS_Engine_RPM_Block; +truncate mmt_staging2.FTWET_TRS_Implement_Block; +truncate mmt_staging2.ftwet_trs_spec_block; +truncate mmt_staging2.stg_specific_table_ftwet_trs; +truncate mmt_staging2.stg_process_table_ftwet_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for ftdry*/ +execute 'insert into mmt_staging2.stg_specific_table_ftwet_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +update mmt_staging2.stg_specific_table_ftwet_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftwet_trs set column2 = TRIM (LEADING FROM column2 ); + + +/* trimming data */ + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftwet_trs b +where upper(trim(F1_source))=upper(trim(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftwet_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where upper(trim(F1_source))=upper(trim(column2)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null where f1_modified =''Implement Details'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications Sheet'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and a.column2 <> '''' +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Implement Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/*inserting data into FTHLG_TRS_H1_INT*/ +insert into mmt_staging2.FTWET_TRS_H1_INT(column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank from mmt_staging2.stg_process_table_ftwet_trs a +where rank_tag='FTWET_TRS_H1'; + + +insert into mmt_staging2.FTWET_TRS_H1_INT(column2) values ('Date of Test'); + +insert into mmt_staging2.FTWET_TRS_H1_INT(column2) values ('Report Date'); + +insert into mmt_staging2.FTWET_TRS_H1_INT(column2) values ('Season'); + +insert into mmt_staging2.FTWET_TRS_H1_INT (column2) values ('Type of Soil'); + +insert into mmt_staging2.FTWET_TRS_H1_INT (column2) values ('Soil Cone Index (kPa)'); + +insert into mmt_staging2.FTWET_TRS_H1_INT (column2) values ('Field Condition'); + +update mmt_staging2.FTWET_TRS_H1_INT a +set column3=(select column5 from mmt_staging2.FTWET_TRS_H1_INT b +where trim(a.column2)=trim(b.column4) +and b.column4='Date of Test') +where a.column2='Date of Test'; + +update mmt_staging2.FTWET_TRS_H1_INT a +set column3=(select column7 from mmt_staging2.FTWET_TRS_H1_INT b +where trim(a.column2)=trim(b.column6) +and b.column6='Report Date') +where a.column2='Report Date'; + +update mmt_staging2.FTWET_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTWET_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Season') +where a.column2='Season'; + +update mmt_staging2.FTWET_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTWET_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Type of Soil') +where a.column2='Type of Soil'; + + +update mmt_staging2.FTWET_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTWET_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Soil Cone Index (kPa)') +where a.column2='Soil Cone Index (kPa)'; + + +update mmt_staging2.FTWET_TRS_H1_INT a +set column3=(select column6 from mmt_staging2.FTWET_TRS_H1_INT b +where trim(a.column2)=trim(b.column5) +and b.column5='Field Condition') +where a.column2='Field Condition'; + + +/*inserting data into block -.FTWET_TRS_H1_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='FTWET_TRS_H1_Block'; + +insert into mmt_staging2.FTWET_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Soil_Moisture_Content_, +Soil_Bulk_Density_g_cc, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Season, +Type_of_Soil, +Soil_Cone_Index_kPa, +Field_Condition +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTWET_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + + + +delete from mmt_staging2.FTWET_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_H1_Block'); + + +/*inserting data into block -FTWET_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTWET_TRS_SPEC_Block'; + +insert into mmt_staging2.FTWET_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear, +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftwet_trs where rank_tag=''FTWET_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text); + +delete from mmt_staging2.FTWET_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + +delete from mmt_staging2.FTWET_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_SPEC_Block'); + +/*inserting data into block -FTWET_TRS_SPEC_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTWET_TRS_Engine_RPM_Block'; + + +insert into mmt_staging2.FTWET_TRS_Engine_RPM_Block +( +dummy_f, +Tractor_model, +Tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftwet_trs where rank_tag=''FTWET_TRS_Engine_RPM'' + or (rank_tag=''FTWET_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + + +delete from mmt_staging2.FTWET_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTWET_TRS_Implement_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_Implement_Block',__file_format,__sheet_mnemonic,4); + +v_block:='FTWET_TRS_Implement_Block'; + +insert into mmt_staging2.FTWET_TRS_Implement_Block +( +dummy_f, +Name_of_Implement, +Type_of_Implement, +Make_of_Implement, +No_of_bottoms_Tyne_Disc_Blade, +Cutting_Width_m, +Implement_Weight_Kg, +Span_cm_For_Mounted_Implement, +Hitch_Category, +Mast_Height_cm_For_Mounted_Implement, +Type_of_Cage_Wheel_Half_Cage_wheel_Full_Cage_Wheel, +Cage_Wheel_Width_mm, +Cage_wheel_Weight, +Cage_Wheel_inner_Outer_Ring_Dia_mm, +Cage_Wheel_Center_Ring_Dia_mm, +Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel, +No_of_angles_on_cage_wheel, +No_of_days_of_water_logging, +Depth_of_water_mm +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_ftwet_trs where rank_tag=''FTWET_TRS_Implement'' + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text + ,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text); + +update mmt_staging2.FTWET_TRS_Implement_Block set Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel = null where Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel ='_'; + +update mmt_staging2.FTWET_TRS_Implement_Block set report_template_no= (select column2 from mmt_staging2.stg_process_table_ftwet_trs where rank=19 and rank_tag='FTWET_TRS_Implement'); + + +update mmt_staging2.FTWET_TRS_Implement_Block set report_template_rev_no= (select column4 from mmt_staging2.stg_process_table_ftwet_trs where rank=19 and rank_tag='FTWET_TRS_Implement'); + + +update mmt_staging2.FTWET_TRS_Implement_Block set report_template_rev_date= (select column6 from mmt_staging2.stg_process_table_ftwet_trs where rank=19 and rank_tag='FTWET_TRS_Implement'); + + +execute 'update mmt_staging2.FTWET_TRS_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_Implement_Block'); +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTWET_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTWET_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + + diff --git a/deployment-20210427T103328Z-001/deployment/field/FTWET_TRS_stg2_version2.sql b/deployment-20210427T103328Z-001/deployment/field/FTWET_TRS_stg2_version2.sql new file mode 100644 index 0000000..538603c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/field/FTWET_TRS_stg2_version2.sql @@ -0,0 +1,406 @@ +/*FTWET_TRS starts*/ + +drop function if exists mmt_staging2.fn_FTWET_TRS_Block ; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_TRS_Block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + + + +/*********************************************************************************** +Function Name:fn_FTWET_TRS_Block +Function Desc: This function populates data into staging2 blocks +File Format: FTWET +Sheet Format: FTWET_TRS +Creation Date: +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_fthlg_trs_block(20,1,'FTHLG','FTWET_TRS',260); +************************************************************************************/ + +SET search_path TO mmt_staging2; + +truncate mmt_staging2.FTWET_TRS_H1_INT; +truncate mmt_staging2.FTWET_TRS_H1_Block; +truncate mmt_staging2.FTWET_TRS_Engine_RPM_Block; +truncate mmt_staging2.FTWET_TRS_Implement_Block; +truncate mmt_staging2.ftwet_trs_spec_block; +truncate mmt_staging2.stg_specific_table_ftwet_trs; +truncate mmt_staging2.stg_process_table_ftwet_trs; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for ftdry*/ +execute 'insert into mmt_staging2.stg_specific_table_ftwet_trs +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +update mmt_staging2.stg_specific_table_ftwet_trs set column2 = TRIM (TRAILING FROM column2 ); +update mmt_staging2.stg_specific_table_ftwet_trs set column2 = TRIM (LEADING FROM column2 ); + + +/* trimming data */ + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified); +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified); +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_ftwet_trs b +where upper(trim(F1_source))=upper(trim(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_ftwet_trs a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where upper(trim(F1_source))=upper(trim(column2)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a set row_read_end = null where f1_modified =''Implement Details'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/*inserting run_time in config*/ +execute 'update mmt_ods.mmt_config a +set run_time=current_timestamp where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications Sheet'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + + +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Tractor Specifications'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine RPM Data:'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + +execute 'insert into mmt_staging2.stg_process_table_ftwet_trs +select a.* , RANK () OVER ( ORDER BY row_number),b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_ftwet_trs a +join mmt_ods.mmt_config b +on a.row_number >row_number_start +and a.column2 <> '''' +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Implement Details'' and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''' +order by a.row_number'; + + +/*inserting data into FTHLG_TRS_H1_INT*/ +insert into mmt_staging2.FTWET_TRS_H1_INT(column2,column3,column4,column5,column6,column7,rank) +select column2,column3,column4,column5,column6,column7,rank from mmt_staging2.stg_process_table_ftwet_trs a +where rank_tag='FTWET_TRS_H1'; + + +insert into mmt_staging2.FTWET_TRS_H1_INT(column2,column3) +select 'Date of Test',column5 +from mmt_staging2.FTDRY_TRS_H1_INT +where rank=1; + +insert into mmt_staging2.FTWET_TRS_H1_INT(column2,column3) +select 'Report Date',column7 +from mmt_staging2.FTDRY_TRS_H1_INT +where rank=1; + + +insert into mmt_staging2.FTWET_TRS_H1_INT(column2,column3) +select column5,column6 +from mmt_staging2.FTDRY_TRS_H1_INT where rank between 4 and 7; + + +/*inserting data into block -.FTWET_TRS_H1_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_H1_Block',__file_format,__sheet_mnemonic,1); +v_block:='FTWET_TRS_H1_Block'; + +insert into mmt_staging2.FTWET_TRS_H1_Block +( +dummy_f, +Report_Reference_No, +Objective_Of_Test, +Background_of_Test, +Job_Order_No, +Test_Location, +Soil_Moisture_Content_, +Soil_Bulk_Density_g_cc, +Test_Engineer, +Test_Operator, +Date_of_Test, +Report_Date, +Season, +Type_of_Soil, +Soil_Cone_Index_kPa, +Field_Condition +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text]) AS val + FROM mmt_staging2.FTWET_TRS_H1_INT + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text,a_10 text, + a_11 text,a_12 text,a_13 text,a_14 text,a_15 text); + + + +delete from mmt_staging2.FTWET_TRS_H1_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_TRS_H1_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_H1_Block'); + + +/*inserting data into block -FTWET_TRS_SPEC_Block*/ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_SPEC_Block',__file_format,__sheet_mnemonic,2); +v_block:='FTWET_TRS_SPEC_Block'; + +insert into mmt_staging2.FTWET_TRS_SPEC_Block +( +dummy_f, +Tractor_Model, +Tractor_Make, +Tractor_Sr_No, +Tractor_Engine_HP, +FIP_Type, +hour_Meter_Reading, +Steering_Type, +Transmission_Type, +Wheel_Drive_Type_WD, +EGR_Yes_No, +Brake_Type, +PTO_Type, +Standard_PTO_Speed_RPM, +EPTO_Speed_RPM, +Front_Tyre_Make, +Front_Tyre_Size, +Front_Tyre_Pressure_psi, +Rear_Tyre_Make, +Rear_Tyre_Size, +Rear_Tyre_Pressure_psi , +Tractor_Weight_kg_Front , +Tractor_Weight_kg_Rear , +Tractor_Weight_kg_Total, +Ballasted_Tractor_Accessories, +Mechanical_Ballast_Rear_in_KG , +Water_Ballast_Rear, +Mechanical_Ballast_Front, +Mechanical_Ballast_Front_in_Kg, +Total_Ballast_Weight +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftwet_trs where rank_tag=''FTWET_TRS_SPEC'' + ORDER BY generate_series(1,15),rank,2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text, + a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text, + a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text); + +delete from mmt_staging2.FTWET_TRS_SPEC_Block where tractor_make is null and tractor_sr_no is null; + +delete from mmt_staging2.FTWET_TRS_SPEC_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_TRS_SPEC_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_SPEC_Block'); + +/*inserting data into block -FTWET_TRS_SPEC_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_Engine_RPM_Block',__file_format,__sheet_mnemonic,3); +v_block:='FTWET_TRS_Engine_RPM_Block'; + + +insert into mmt_staging2.FTWET_TRS_Engine_RPM_Block +( +dummy_f, +Tractor_model, +Tractor_make, +Low_Idle, +High_Idle, +Rated_RPM, +Engine_to_PTO_Ratio_540_PTO, +Engine_to_PTO_Ratio_540E_PTO +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6,column7}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text,column7::text]) AS val + FROM mmt_staging2.stg_process_table_ftwet_trs where rank_tag=''FTWET_TRS_Engine_RPM'' + or (rank_tag=''FTWET_TRS_SPEC'' and rank in (1,2)) + ORDER BY generate_series(1,15),2' + ) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text); + + + +delete from mmt_staging2.FTWET_TRS_Engine_RPM_Block where dummy_f is null ; +execute 'update mmt_staging2.FTWET_TRS_Engine_RPM_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_Engine_RPM_Block'); + + +/*inserting data into block -FTWET_TRS_Implement_Block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'FTWET_TRS_Implement_Block',__file_format,__sheet_mnemonic,4); + +v_block:='FTWET_TRS_Implement_Block'; + +insert into mmt_staging2.FTWET_TRS_Implement_Block +( +dummy_f, +Name_of_Implement, +Type_of_Implement, +Make_of_Implement, +No_of_bottoms_Tyne_Disc_Blade, +Cutting_Width_m, +Implement_Weight_Kg, +Span_cm_For_Mounted_Implement, +Hitch_Category, +Mast_Height_cm_For_Mounted_Implement, +Type_of_Cage_Wheel_Half_Cage_wheel_Full_Cage_Wheel, +Cage_Wheel_Width_mm, +Cage_wheel_Weight, +Cage_Wheel_inner_Outer_Ring_Dia_mm, +Cage_Wheel_Center_Ring_Dia_mm, +Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel, +No_of_angles_on_cage_wheel, +No_of_days_of_water_logging, +Depth_of_water_mm +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{column3,column4,column5,column6}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[column3::text,column4::text,column5::text,column6::text]) AS val + FROM mmt_staging2.stg_process_table_ftwet_trs where rank_tag=''FTWET_TRS_Implement'' + ORDER BY generate_series(1,15),rank,2' + ) t ( col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,a_9 text + ,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text); + +update mmt_staging2.FTWET_TRS_Implement_Block set Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel = null where Distance_between_RHS_LHS_cage_wheel_Inner_Ring_mm_For_Full_Cage_wheel ='_'; + +update mmt_staging2.FTWET_TRS_Implement_Block set report_template_no= (select column2 from mmt_staging2.stg_process_table_ftwet_trs where rank=19 and rank_tag='FTWET_TRS_Implement'); + + +update mmt_staging2.FTWET_TRS_Implement_Block set report_template_rev_no= (select column4 from mmt_staging2.stg_process_table_ftwet_trs where rank=19 and rank_tag='FTWET_TRS_Implement'); + + +update mmt_staging2.FTWET_TRS_Implement_Block set report_template_rev_date= (select column6 from mmt_staging2.stg_process_table_ftwet_trs where rank=19 and rank_tag='FTWET_TRS_Implement'); + + +execute 'update mmt_staging2.FTWET_TRS_Implement_Block set +client_id='||p_client_id||', +function_id='||p_function_id||', +file_syspk='||p_file_syspk||', +file_format='''||p_file_format||''', +sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'FTWET_TRS_Implement_Block'); +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_FTWET_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_FTWET_TRS_Block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + +select mmt_staging2.fn_fthlg_trs_block(20,1,'FTHLG','FTWET_TRS',704); + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_ods.txt new file mode 100644 index 0000000..f1ddc56 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_ods.txt @@ -0,0 +1,196 @@ +drop function if exists mmt_staging2.fn_PTO_GVG_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_GVG_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + + __file_syspk := p_file_syspk; + SET search_path TO mmt_staging2; + +/************************************************************* +Function Name:fn_PTO_GVG_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_GVG +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_GVG_ODS(880) +***************************************************************/ + select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + +insert into mmt_ods.PTO_Perf_Governing_Graph +(client_id, +function_id, +test_file_ref_no, +tractor_model, +tractor_make, +test_condition, +engine_speed_rpm, +torque_kg_m, +power_hp, +sfc_gm_per_hp_hr, +fuelling_mm3_per_stroke_per_cyl, +test_file_format, +test_file_sheet_format) +select +client_id, +function_id, +file_syspk, +model, +make, +c1, +c2::numeric, +c3::numeric, +c4::numeric, +c5::numeric, +c6::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +union +select +client_id, +function_id, +file_syspk, +model, +make, +c7_1, +c7::numeric, +c8::numeric, +c9::numeric, +c10::numeric, +c11::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +and (c7 is not null and c8 is not null and c9 is not null and c10 is not null and c11 is not null) +union +select +client_id, +function_id, +file_syspk, +model, +make, +c12_1, +c12::numeric, +c13::numeric, +c14::numeric, +c15::numeric, +c16::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +and (c12 is not null and c13 is not null and c14 is not null and c15 is not null and c16 is not null) +union +select +client_id, +function_id, +file_syspk, +model, +make, +c17_1, +c17::numeric, +c18::numeric, +c19::numeric, +c20::numeric, +c21::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +and (c17 is not null and c18 is not null and c19 is not null and c20 is not null and c21 is not null) +union +select +client_id, +function_id, +file_syspk, +model, +make, +c22_1, +c22::numeric, +c23::numeric, +c24::numeric, +c25::numeric, +c26::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +and (c22 is not null and c23 is not null and c24 is not null and c25 is not null and c26 is not null) +union +select +client_id, +function_id, +file_syspk, +model, +make, +c27_1, +c27::numeric, +c28::numeric, +c29::numeric, +c30::numeric, +c31::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +and (c27 is not null and c28 is not null and c29 is not null and c30 is not null and c32 is not null) +union +select +client_id, +function_id, +file_syspk, +model, +make, +c32_1, +c32::numeric, +c33::numeric, +c34::numeric, +c35::numeric, +c36::numeric, +file_format, +sheet_mnemonic +from mmt_staging2.PTOBST_GVG_performance_governing_trails_block +where ods_record=1 +and (c32 is not null and c33 is not null and c34 is not null and c35 is not null and c36 is not null); + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Perf_Governing_Graph +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_GVG' ,null,'ods', 'fn_PTO_GVG_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_GVG' ,null,'ods', 'fn_PTO_GVG_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_stg2.txt new file mode 100644 index 0000000..73c5b7c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-GVG_stg2.txt @@ -0,0 +1,373 @@ +drop function if exists mmt_staging2.fn_PTO_GVG_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_GVG_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************************************** +Function Name:fn_PTO_GVG_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_GVG +Creation Date: March 25 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_GVG_block(1,1,'PTOBST','PTOBST_GVG',880) +***************************************************************************************/ + +SET search_path TO mmt_staging2; + + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_GVG; +truncate table mmt_staging2.stg_process_table_PTO_GVG; +truncate table mmt_staging2.PTOBST_GVG_performance_governing_trails_block; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_GVG +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_GVG set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_GVG set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_GVG b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* keyword match in config table*/ +execute 'update mmt_staging2.stg_specific_table_PTO_GVG a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Graphs - for Example'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_GVG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_GVG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Governing Trails on Boost Mode'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_GVG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_GVG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Graphs - for Example'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + + +/* block PTOBST_GVG_performance_governing_trails_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_GVG_performance_governing_trails_block',__file_format,__sheet_mnemonic,1); + +v_block := 'PTOBST_GVG_performance_governing_trails_block'; + +insert into mmt_staging2.PTOBST_GVG_performance_governing_trails_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +c26, +c27, +c28, +c29, +c30, +c31, +c32, +c33, +c34, +c35, +c36, +rank +) + +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +column26, +column27, +column28, +column29, +column30, +column31, +column32, +column33, +column34, +column35, +column36, +rank + from mmt_staging2.stg_process_table_PTO_GVG a +where rank_tag='PTOBST_GVG_performance_governing_trails'; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set test_condition=c2 +where rank=1; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c2=null +where rank=1; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c1=c2 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c1= b.first_value from (SELECT + rank, c1, value_partition, first_value(c1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c1, + sum(case when c1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c7_1=c7 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c7_1= b.first_value from (SELECT + rank, c7_1, value_partition, first_value(c7_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c7_1, + sum(case when c7_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c12_1=c12 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c12_1= b.first_value from (SELECT + rank, c12_1, value_partition, first_value(c12_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c12_1, + sum(case when c12_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c17_1=c17 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c17_1= b.first_value from (SELECT + rank, c17_1, value_partition, first_value(c17_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c17_1, + sum(case when c17_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c22_1=c22 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c22_1= b.first_value from (SELECT + rank, c22_1, value_partition, first_value(c22_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c22_1, + sum(case when c22_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c27_1=c27 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c27_1= b.first_value from (SELECT + rank, c27_1, value_partition, first_value(c27_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c27_1, + sum(case when c27_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c32_1=c32 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c32_1= b.first_value from (SELECT + rank, c32_1, value_partition, first_value(c32_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c32_1, + sum(case when c32_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set ods_record=0 where rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set make=__make; + update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_GVG_performance_governing_trails_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_GVG_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_GVG_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM-stg2.txt new file mode 100644 index 0000000..e5ecd4e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM-stg2.txt @@ -0,0 +1,188 @@ +drop function if exists mmt_staging2.fn_PTO_MPM_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_MPM_block(p_client_id int,p_function_id int, p_file_format text,p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************************************** +Function Name:fn_PTO_MPM_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_MPM +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_MPM_block(1,1,'PTOBST','PTOBST_MPM',880) +***************************************************************************************/ + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_MPM; +truncate table mmt_staging2.stg_process_table_PTO_MPM; +truncate table mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_MPM +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_MPM set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_MPM set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_MPM b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update*/ +execute 'update mmt_staging2.stg_specific_table_PTO_MPM a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Performance - Boost Mode @ Natural Ambient'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_MPM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_MPM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Performance - Boost Mode @ Natural Ambient'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + +/* block - PTOBST_MPM_performance_boost_natuaral_block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_MPM_performance_boost_natuaral_block',__file_format,__sheet_mnemonic,1); +v_block :='PTOBST_MPM_performance_boost_natuaral_block'; +insert into mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +( +c2, +c3, +c4, +c5, +rank +) +select column2,column3,column4 ,column5,rank from mmt_staging2.stg_process_table_PTO_MPM +where rank_tag='PTOBST_MPM_performance_boost_natuaral'; + + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +set test_condition=c2 +where rank=1; + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +set c2=null +where rank=1; + + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +set ods_record=0 +where rank in (1,2); + + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set make=__make; + update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_MPM_performance_boost_natuaral_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_MPM_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_MPM_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM_ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM_ods.txt new file mode 100644 index 0000000..214df28 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-MPM_ods.txt @@ -0,0 +1,72 @@ +drop function if exists mmt_staging2.fn_PTO_MPM_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_MPM_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; +begin + __file_syspk := p_file_syspk; + +/************************************************************* +Function Name:fn_PTO_MPM_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_MPM +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_MPM_ODS(880) +***************************************************************/ + +select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + + insert into mmt_ods.PTO_Multipoint_Mapping +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make ,tractor_model , +test_condition, +engine_speed_rpm, +engine_load_pct, +sfc_gm_per_hp_hr, +fuel_consumption_ltr_per_hr +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model,test_condition, +c2::numeric,c3::numeric,c4::numeric,c5::numeric +from mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +where ods_record=1 ; + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Multipoint_Mapping +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_MPM' ,null,'ods', 'fn_PTO_MPM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_MPM' ,null,'ods', 'fn_PTO_MPM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA-stg2.txt new file mode 100644 index 0000000..40e589a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA-stg2.txt @@ -0,0 +1,479 @@ +/* +select mmt_staging2.fn_PTO_PHA_block(1,1,'PTOBST','PTOBST_PHA',183) + +select * from mmt_ods.mmt_config where file_format='PTOBST' and sheet_mnemonic ='PTOBST_PHA' order by syspk +select * from mmt_staging1.mmt_staging_generic_table where file_format='PTOBST' and sheet_mnemonic ='PTOBST_PHA' + +*/ + +drop function if exists mmt_staging2.fn_PTO_PHA_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PHA_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + /************************************************************************************** +Function Name:fn_PTO_PHA_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_PHA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PHA_block(1,1,'PTOBST','PTOBST_PHA',880) +***************************************************************************************/ + + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_PHA; +truncate table mmt_staging2.stg_process_table_PTO_PHA; +truncate table mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int; +truncate table mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block; +truncate table mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block; +truncate table mmt_staging2.PTOBST_PHA_varying_speed_test_block; +truncate table mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block; + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_PHA +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_PHA set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_PHA set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_PHA b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_staging2.stg_specific_table_PTO_PHA a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Engine Oil Consumption'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''KEY Performance Parameters'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''2Hrs Max Power Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Varying Speed Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine Oil Consumption'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* +execute format('select column6 from mmt_staging2.stg_process_table_PTO a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and rank_tag=''PTO_test_tractor_specifications'' and trim(column4)=''Make''') into __make; + +execute format('select column6 from mmt_staging2.stg_process_table_PTO a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and rank_tag=''PTO_test_tractor_specifications'' and trim(column4)=''Model''') into __model; +*/ + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + +/* int data loading PTOBST_PHA_key_perfomrance_parameters_int */ +insert into mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int +( file_syspk,c1,c2,rank) +select file_syspk,column2,column5,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column8,column12,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column13,column16,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column17,column20,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column21,column24 ,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +order by rank,column2; + + +delete from mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int where c1 is null; + +/* block data loading PTOBST_PHA_key_perfomrance_parameters_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_key_perfomrance_parameters_block',__file_format,__sheet_mnemonic,1); +v_block := 'PTOBST_PHA_key_perfomrance_parameters_block'; + +insert into mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block +( +dummy_f, +Ambient_pressure_mm_of_hg , +PTO_gear_ratio , +PTO_power_hp , +Rated_engine_speed , +Test_engineer , +Engine_high_Idle_speed , +PTO_SFC_gm_hp , +Relative_humidity , +Test_bed , +Backup_Torque , +Engine_low_idle_speed , +Exhaust_temperature , +Place , +Specific_gravity_of_Fuel , +back_pressure , +Dyno_Constant , +Engine_oil_temp , +Maximum_Equ_Crankshaft , +Total_run_hrs , +Coolant_temp , +Engine_oil_pressure_bar , +Equ_crankshaft_torque_at_maximum_power , +Test_date +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c1,c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c1::text,c2::text]) AS val + FROM mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int + ORDER BY generate_series(1,15),2' + ) t (col text,a1 text,a2 text,a3 text,a4 text,a5 text, + a6 text,a7 text,a8 text,a9 text,a10 text,a11 text,a12 text,a13 text,a14 text, + a15 text,a16 text,a17 text,a18 text,a19 text,a20 text,a21 text,a22 text,a23 text); + delete from mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block where dummy_f is null; + +update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set ods_record=0 where dummy_f='c1'; + +update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set test_condition='key_performance_parameters'; + + + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set make=__make; + update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_key_perfomrance_parameters_block'); + +/* block - PTOBST_PHA_2Hrs_max_power_test_block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_2Hrs_max_power_test_block',__file_format,__sheet_mnemonic,2); +v_block := 'PTOBST_PHA_2Hrs_max_power_test_block'; + +insert into mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_2Hrs_max_power_test'; + +update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set make=__make; + update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_2Hrs_max_power_test_block'); + +/* block - PTOBST_PHA_varying_speed_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_varying_speed_test_block',__file_format,__sheet_mnemonic,3); +v_block := 'PTOBST_PHA_varying_speed_test_block'; + + +insert into mmt_staging2.PTOBST_PHA_varying_speed_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag='PTOBST_PHA_varying_speed_test'; + +update mmt_staging2.PTOBST_PHA_varying_speed_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PHA_varying_speed_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PHA_varying_speed_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PHA_varying_speed_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_varying_speed_test_block set make=__make; + update mmt_staging2.PTOBST_PHA_varying_speed_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_varying_speed_test_block'); + + /* block PTOBST_PHA_Engine_oil_consumption_block*/ + + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_Engine_oil_consumption_block',__file_format,__sheet_mnemonic,4); +v_block := 'PTOBST_PHA_Engine_oil_consumption_block'; + + insert into mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block +( +c2, +c3,c5, +rank +) +select column2,column3,column5 ,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag='PTOBST_PHA_Engine_oil_consumption'; + +update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set ods_record=0 where +rank in (1,2); + + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set make=__make; + update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_Engine_oil_consumption_block'); + + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_PHA_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_PHA_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA_ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA_ods.txt new file mode 100644 index 0000000..725ea84 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PHA_ods.txt @@ -0,0 +1,155 @@ +drop function if exists mmt_staging2.fn_PTO_PHA_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PHA_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + __file_syspk := p_file_syspk; +/************************************************************* +Function Name:fn_PTO_PHA_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_PHA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PHA_ODS(880) +***************************************************************/ + + + SET search_path TO mmt_staging2; + select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + insert into mmt_ods.PTO_Key_Perf_Parameters +(client_id,function_id,test_condtion,test_file_ref_no, +tractor_model,tractor_make,pto_gear_ratio,specific_gravity_of_fuel,dyno_constant,pto_power_hp, +pto_sfc_gm_per_hp_hr,backup_torque_pct,engine_oil_temp_c,coolant_temp_c,rated_engine_speed_rpm, +engine_high_idle_speed_rpm,engine_low_idle_speed_rpm,maximum_equi_crankshaft_torque_nm, +equi_crankshaft_torque_at_max_power_nm,ambient_presure_mm_of_hg,related_humidity_pct, +exhaust_temperature_c,back_pressure_mm_of_hg,engine_oil_pressure_bar,test_engineer,test_bed, +location_name,total_run_hrs,test_date,test_file_format,test_file_sheet_format +) +select +client_id,function_id,test_condition,file_syspk, +model,make,pto_gear_ratio::numeric,specific_gravity_of_fuel::numeric,dyno_constant::numeric,pto_power_hp::numeric, +pto_sfc_gm_hp::numeric,backup_torque::numeric,engine_oil_temp::numeric,coolant_temp::numeric, +rated_engine_speed::numeric,engine_high_idle_speed::numeric,engine_low_idle_speed::numeric, +maximum_equ_crankshaft::numeric,equ_crankshaft_torque_at_maximum_power::numeric, +ambient_pressure_mm_of_hg::numeric,relative_humidity::numeric, +exhaust_temperature::numeric,back_pressure::numeric,engine_oil_pressure_bar::numeric,test_engineer,test_bed, +place,total_run_hrs::int, to_Date(test_Date, 'DD-MM-YYYY'),file_format,sheet_mnemonic +from mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block +where ods_record=1; + + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric + from mmt_staging2.PTOBST_PHA_varying_speed_test_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.pto_engine_oil_consumption +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +oil_consumption_gm_per_hr, +oil_consumption_pct_of_fuel_consumption +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +c2::int,c3::numeric,c5::numeric +from mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block +where ods_record=1; + + + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Key_Perf_Parameters +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.pto_engine_oil_consumption +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PHA' ,null,'ods', 'fn_PTO_PHA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PHA' ,null,'ods', 'fn_PTO_PHA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-ods.txt new file mode 100644 index 0000000..1064325 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-ods.txt @@ -0,0 +1,226 @@ +drop function if exists mmt_staging2.fn_PTO_PNA_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PNA_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + __file_syspk := p_file_syspk; +/************************************************************* +Function Name:fn_PTO_PNA_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_PNA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PNA_ODS(880) +***************************************************************/ + + + SET search_path TO mmt_staging2; + select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + insert into mmt_ods.PTO_Key_Perf_Parameters +(client_id,function_id,test_condtion,test_file_ref_no, +tractor_model,tractor_make,pto_gear_ratio,specific_gravity_of_fuel,dyno_constant,pto_power_hp, +pto_sfc_gm_per_hp_hr,backup_torque_pct,engine_oil_temp_c,coolant_temp_c,rated_engine_speed_rpm, +engine_high_idle_speed_rpm,engine_low_idle_speed_rpm,maximum_equi_crankshaft_torque_nm, +equi_crankshaft_torque_at_max_Power_Nm,ambient_presure_mm_of_hg,related_humidity_pct, +exhaust_temperature_c,back_pressure_mm_of_hg,engine_oil_pressure_bar,test_engineer,test_bed, +location_name,total_run_hrs,test_date,test_file_format,test_file_sheet_format +) +select +client_id,function_id,test_condition,file_syspk, +model,make,pto_gear_ratio::numeric,specific_gravity_of_fuel::numeric,dyno_constant::numeric,pto_power_hp::numeric, +pto_sfc_gm_hp::numeric,backup_torque::numeric,engine_oil_temp::numeric,coolant_temp::numeric, +rated_engine_speed::numeric,engine_high_idle_speed::numeric,engine_low_idle_speed::numeric, +maximum_equ_crankshaft::numeric,equ_crankshaft_torque_at_maximum_power::numeric, +ambient_pressure_mm_of_hg::numeric,relative_humidity::numeric, +exhaust_temperature::numeric,back_pressure::numeric,engine_oil_pressure_bar::numeric,test_engineer,test_bed, +place,total_run_hrs::int, to_Date(test_Date, 'DD-MM-YYYY'),file_format,sheet_mnemonic +from mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block +where ods_record=1; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::int,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric + from mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +where ods_record=1; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +where ods_record=1 ; +/*and c2<>'Avg' */ + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::int,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_varying_speed_test_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,pto_test_sub_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c1,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,pto_test_sub_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c1,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_varying_load_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.pto_smoke_test +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +engine_speed_rpm, +pto_speed_rpm , +torque_100_pct , +torque_80_pct , +smoke_fsn_100_pct , +smoke_fsn_80_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +c2::numeric,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric +from mmt_staging2.PTOBST_PNA_smoke_test_block +where ods_record=1 ; + + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Key_Perf_Parameters +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.pto_smoke_test +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PNA' ,null,'ods', 'fn_PTO_PNA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PNA' ,null,'ods', 'fn_PTO_PNA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-stg2.txt new file mode 100644 index 0000000..139b53c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-PNA-stg2.txt @@ -0,0 +1,837 @@ +drop function if exists mmt_staging2.fn_PTO_PNA_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PNA_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + + /************************************************************************************** +Function Name:fn_PTO_PNA_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_PNA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PNA_block(1,1,'PTOBST','PTOBST_PNA',880) +***************************************************************************************/ + + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_PNA; +truncate table mmt_staging2.stg_process_table_PTO_PNA; +truncate table mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int; +truncate table mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block; +truncate table mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block; +truncate table mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block; +truncate table mmt_staging2.PTOBST_PNA_varying_speed_test_block; +truncate table mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block; +truncate table mmt_staging2.PTOBST_PNA_varying_load_block; +truncate table mmt_staging2.PTOBST_PNA_smoke_test_block ; + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_PNA +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_PNA set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_PNA set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_PNA b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* update config files for row numbers start, end */ +execute 'update mmt_staging2.stg_specific_table_PTO_PNA a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Smoke Test'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Key Performance Parameters'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Max Power Occurring Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''2Hrs Max Power Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Varying Speed Test - Full Throttle Performance'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Part load @ Rated RPM'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Varying load @ STD. PTO'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Smoke Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* fetcching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + + +/* blocks data loading start - PTOBST_PNA_key_perfomrance_parameters_int */ + +insert into mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int +( file_syspk,c1,c2,rank) +select file_syspk,column2,column5,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column8,column12,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column13,column16,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column17,column20,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column21,column24 ,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +order by rank,column2; + + +delete from mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int where c1 is null; + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_key_perfomrance_parameters_block',__file_format,__sheet_mnemonic,1); +v_block := 'PTOBST_PNA_key_perfomrance_parameters_block'; +insert into mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block +( +dummy_f, +Ambient_pressure_mm_of_hg , +PTO_gear_ratio , +PTO_power_hp , +Rated_engine_speed , +Test_engineer , +Engine_high_Idle_speed , +PTO_SFC_gm_hp , +Relative_humidity , +Test_bed , +Backup_Torque , +Engine_low_idle_speed , +Exhaust_temperature , +Place , +Specific_gravity_of_Fuel , +back_pressure , +Dyno_Constant , +Engine_oil_temp , +Maximum_Equ_Crankshaft , +Total_run_hrs , +Coolant_temp , +Engine_oil_pressure_bar , +Equ_crankshaft_torque_at_maximum_power , +Test_date +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c1,c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c1::text,c2::text]) AS val + FROM mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int + ORDER BY generate_series(1,15),2' + ) t (col text,a1 text,a2 text,a3 text,a4 text,a5 text, + a6 text,a7 text,a8 text,a9 text,a10 text,a11 text,a12 text,a13 text,a14 text, + a15 text,a16 text,a17 text,a18 text,a19 text,a20 text,a21 text,a22 text,a23 text); + + +delete from mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block where dummy_f is null; + +update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set ods_record=0 where dummy_f='c1'; + +update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set test_condition='key_performance_parameters'; + + + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set make=__make; + update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_key_perfomrance_parameters_block'); + +/* blocks data loading start - PTOBST_PNA_boostmode_maxpower_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_boostmode_maxpower_test_block',__file_format,__sheet_mnemonic,2); +v_block := 'PTOBST_PNA_boostmode_maxpower_test_block'; + +insert into mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_boostmode_maxpower_test'; + +update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set ods_record=0 where +rank in (1,2,3,4); + + + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_boostmode_maxpower_test_block'); + +/* blocks data loading - PTOBST_PNA_2Hrs_max_power_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_2Hrs_max_power_test_block',__file_format,__sheet_mnemonic,3); +v_block := 'PTOBST_PNA_2Hrs_max_power_test_block'; + +insert into mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_2Hrs_max_power_test'; + +update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_2Hrs_max_power_test_block'); + +/* blocks data loading - PTOBST_PNA_varying_speed_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_varying_speed_test_block',__file_format,__sheet_mnemonic,4); +v_block := 'PTOBST_PNA_varying_speed_test_block'; + + insert into mmt_staging2.PTOBST_PNA_varying_speed_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag='PTOBST_PNA_varying_speed_test'; + +update mmt_staging2.PTOBST_PNA_varying_speed_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_varying_speed_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_varying_speed_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_varying_speed_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_varying_speed_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_varying_speed_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_varying_speed_test_block'); + +/* blocks data loading start - PTOBST_PNA_part_load_rated_rpm_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_part_load_rated_rpm_block',__file_format,__sheet_mnemonic,5); +v_block := 'PTOBST_PNA_part_load_rated_rpm_block'; + + insert into mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag='PTOBST_PNA_part_load_rated_rpm,' ; + + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set ods_record=0 where +rank in (1,2,3,4); + + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +set c1 =c3 +where c2 is null and ods_record=1; + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block a +set c1= b.first_value from (SELECT + rank, c1, value_partition, first_value(c1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c1, + sum(case when c1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +set c3 = null,ods_record=0 +where c1=c3; + + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set make=__make; + update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_part_load_rated_rpm_block'); + +/* block loading data PTOBST_PNA_varying_load_block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_varying_load_block',__file_format,__sheet_mnemonic,6); +v_block := 'PTOBST_PNA_varying_load_block'; + + insert into mmt_staging2.PTOBST_PNA_varying_load_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag='PTOBST_PNA_varying_load,'; + + +update mmt_staging2.PTOBST_PNA_varying_load_block set ods_record=0 where +rank in (1,2,3,4); + + +update mmt_staging2.PTOBST_PNA_varying_load_block +set c1 =c3 +where c2 is null and ods_record=1; + +update mmt_staging2.PTOBST_PNA_varying_load_block a +set c1= b.first_value from (SELECT + rank, c1, value_partition, first_value(c1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c1, + sum(case when c1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_varying_load_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_varying_load_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_varying_load_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_varying_load_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_varying_load_block +set c3 = null,ods_record=0 +where c1=c3; + + + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_varying_load_block set make=__make; + update mmt_staging2.PTOBST_PNA_varying_load_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_varying_load_block'); + + /* block data loading PTOBST_PNA_smoke_test_block*/ + + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_smoke_test_block',__file_format,__sheet_mnemonic,7); +v_block := 'PTOBST_PNA_smoke_test_block'; + + insert into mmt_staging2.PTOBST_PNA_smoke_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +rank +) +select +column2, +column3,column4,column5, +column6,column7 ,rank +from mmt_staging2.stg_process_table_PTO_PNA where rank_tag='PTOBST_PNA_smoke_test'; + + +update mmt_staging2.PTOBST_PNA_smoke_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_smoke_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_smoke_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_smoke_test_block +set ods_record=0 where rank in (1,2,3); + + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_smoke_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_smoke_test_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_smoke_test_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_PNA_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_PNA_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-ods.txt new file mode 100644 index 0000000..6b5a94b --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-ods.txt @@ -0,0 +1,304 @@ +drop function if exists mmt_staging2.fn_PTO_report_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_report_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + + begin + __file_syspk := p_file_syspk; + + SET search_path TO mmt_staging2; +/************************************************************* +Function Name:fn_PTO_REPORT_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_PNA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_report_ODS(880) +***************************************************************/ + +insert into mmt_ods.test_instance_tractor_info +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +tractor_engine_hp, +configuration, +fip_type, +steering_type, +transmission_type, +wheel_drive_type +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model,tractor_HP::int,configuration,FIP_type,steering_type,transmission_type,wheel_drive_type +from + mmt_staging2.PTOBST_RPT_tractor_specs_block; + +select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + +insert into mmt_ods.test_instance +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model +from + mmt_staging2.PTOBST_RPT_tractor_specs_block; + + insert into mmt_ods.test_instance_engine_info + ( + client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +rated_rpm, +engine_to_pto_ratio_540_pto +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model,rated_rpm::int,engine_to_pto_ratio +from mmt_staging2.PTOBST_RPT_tractor_specs_block; + + +/*block */ + +insert into mmt_ods.PTO_Perf_Report_Summary +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +pto_category , +pto_sub_category , +power_kw, +speed_rpm_pto , +speed_rpm_engine , +fuel_consumption_ltr_per_hr , +fuel_consumption_kg_per_h , +sfc_kg_per_kwh , +specifc_energy_kwh_per_ltr +) + +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +c2, +c3, +c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric +from mmt_staging2.PTOBST_RPT_PTO_performance_report_block where ods_record=1 +order by rank; + + +/*block */ +insert into mmt_ods.PTO_Perf_Report_Details +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +ambient_type, +no_load_max_engine_speed_rpm, +equi_crankshaft_torque_at_max_power_nm, +max_equi_crankshaft_torque_nm, +engine_speed_at_max_equi_crankshaft_torque_rpm, +pct_backup_torque, +pct_smoke_level_max_light_absorption_coef_per_mtr, +range_of_atm_conditions_temp_c, +range_of_atm_conditions_pressure_kpa, +range_of_atm_conditions_rel_humidity_pct +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +c3, +c4::int, +c5::numeric, +c6::numeric,c7::int,c8::numeric, +c9::numeric,c10,c11,c12 +from mmt_staging2.PTOBST_RPT_MMTKeyword1_block +where ods_record=1; + +/* block */ + +insert into mmt_ods.PTO_Perf_Report_Details +( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +ambient_type, +max_temp_engine_oil_c, +max_temp_coolant_water_c, +max_temp_fuel_c, +max_temp_air_intake_c, +max_temp_exhaust_gas_c, +pressure_at_max_power_intake_air_kpa, +pressure_at_max_power_exhst_gas_bfr_turbo_charger_kpa, +consumptions_lub_oil_gkwh, +consumptions_coolant_water_pct_of_total_coolant_capacity +) + +select client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make,model, +c3, +c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric,c11::numeric,c12::numeric +from mmt_staging2.PTOBST_RPT_MMTKeyword2_block +where ods_record=1 and c3='High Ambient'; + +update mmt_ods.PTO_Perf_Report_Details a +set +max_temp_engine_oil_c=c4::numeric, +max_temp_coolant_water_c=c5::numeric, +max_temp_fuel_c=c6::numeric, +max_temp_air_intake_c=c7::numeric, +max_temp_exhaust_gas_c=c8::numeric, +pressure_at_max_power_intake_air_kpa=c9::numeric, +pressure_at_max_power_exhst_gas_bfr_turbo_charger_kpa=c10::numeric, +consumptions_lub_oil_gkwh=c11::numeric, +consumptions_coolant_water_pct_of_total_coolant_capacity=c12::numeric +from mmt_staging2.PTOBST_RPT_MMTKeyword2_block b +where a.ambient_type=b.c3 +and a.ambient_type='Natural Ambient' and ods_record=1; + +/* block */ + +insert into mmt_ods.PTO_Perf_Test_Observations( +client_id, +function_id, +test_file_ref_no, +test_file_format, +test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +characteristic, +category_evaluative_or_non_evaluative, +requirements_as_per_is_12207_2008, +values_declared_by_the_applicant_d_rqmt, +as_observed, +whether_meets_the_requirements_yn + +) +select +client_id, +function_id, +file_syspk, +file_format, +sheet_mnemonic, +make, +model, +c3::text, +c4,c7,c8,c10::numeric,c11::numeric,c12 +from mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block +where rank in (3,4) and ods_record=1; + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.test_instance_tractor_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.test_instance_engine_info +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Report_Summary +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Test_Observations +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Report_Details +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; + +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_RPT' ,null,'ods', 'fn_PTO_report_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_RPT' ,null,'ods', 'fn_PTO_report_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-stg2.txt new file mode 100644 index 0000000..6ee91b4 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V0-April22/PTO-RPT-stg2.txt @@ -0,0 +1,352 @@ +drop function if exists mmt_staging2.fn_PTO_report_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_report_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + +/*********************************************************************************** +Function Name:fn_PTO_PNA_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_RPT +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_report_block(1,1,'PTOBST','PTOBST_RPT',880) +************************************************************************************/ + + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_report; +truncate table mmt_staging2.stg_process_table_PTO_report; +truncate table mmt_staging2.PTOBST_RPT_tractor_specs_block; +truncate table mmt_staging2.PTOBST_RPT_PTO_performance_report_block; +truncate table mmt_staging2.PTOBST_RPT_MMTKeyword1_block; +truncate table mmt_staging2.PTOBST_RPT_MMTKeyword2_block; +truncate table mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_report +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_report set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_report set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_report b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update in process table for match*/ +execute 'update mmt_staging2.stg_specific_table_PTO_report a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''PTO Performance Test Observations Summary'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ +execute 'insert into mmt_staging2.stg_process_table_PTO_report +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_report a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Test Tractor Specifiactions'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_report +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_report a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''PTO Performance Report'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_report +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_report a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''MMTKeyword1'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_report +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_report a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''MMTKeyword2'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_report +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_report a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''PTO Performance Test Observations Summary'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + + +/* blocks data loading start - PTOBST_RPT_tractor_specs_block */ + + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_RPT_tractor_specs_block',__file_format,__sheet_mnemonic,1); +v_block :='PTOBST_RPT_tractor_specs_block'; +insert into mmt_staging2.PTOBST_RPT_tractor_specs_block +(make,model,tractor_HP,rated_rpm,configuration,transmission_type,wheel_drive_type,FIP_type,rank) +select column3,column4,column5,column6,column7,column8,column9,column10,rank +from mmt_staging2.stg_process_table_PTO_report where rank_tag='PTOBST_RPT_test_tractor_specifiactions' +and rank=3; + +execute 'update mmt_staging2.PTOBST_RPT_tractor_specs_block set file_syspk='||p_file_syspk||''; + +update mmt_staging2.PTOBST_RPT_tractor_specs_block a +set date= date '1899-12-30' + column12::int * interval '1' day +from mmt_staging2.stg_process_table_PTO_report b +where b.rank_tag='PTOBST_RPT_test_tractor_specifiactions' +and b.rank=1 +and a.file_syspk=b.file_syspk ; + +update mmt_staging2.PTOBST_RPT_tractor_specs_block a +set steering_type=column3,Engine_to_PTO_ratio= column4 +from mmt_staging2.stg_process_table_PTO_report b +where b.rank_tag='PTOBST_RPT_test_tractor_specifiactions' +and b.rank=5 +and a.file_syspk=b.file_syspk; + + update mmt_staging2.PTOBST_RPT_tractor_specs_block set make=__make; + update mmt_staging2.PTOBST_RPT_tractor_specs_block set model=__model; + execute 'update mmt_staging2.PTOBST_RPT_tractor_specs_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_RPT_tractor_specs_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_RPT_tractor_specs_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_RPT_tractor_specs_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_RPT_tractor_specs_block'); + +/* blocks data loading - PTOBST_RPT_PTO_performance_report_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_RPT_PTO_performance_report_block',__file_format,__sheet_mnemonic,2); +v_block :='PTOBST_RPT_PTO_performance_report_block'; + +insert into mmt_staging2.PTOBST_RPT_PTO_performance_report_block +( c2,c3,c4,c5,c6,c7,c8,c9,c10,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,rank +from mmt_staging2.stg_process_table_PTO_report +where rank_tag='PTOBST_RPT_PTO_performance_report'; + + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block +set c2=c3; + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block +set c2=null +where c2 like 'i%'; + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block +set c2=null +where c2 like 'v%'; + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block a +set c2= b.first_value from (SELECT + rank, c2, value_partition, first_value(c2) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c2, + sum(case when c2 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_RPT_PTO_performance_report_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block +set c3 =null +where c2=c3; + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block +set ods_record=0 where rank in (1,2,3); + + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set ods_record=0 where c3 is null +and c2 in( +select c2 from mmt_staging2.PTOBST_RPT_PTO_performance_report_block group by c2 having count(*)>1 +); + + update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set make=__make; + update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set model=__model; + execute 'update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_RPT_PTO_performance_report_block'); + + /* block loading data - PTOBST_RPT_MMTKeyword1_block*/ + + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_RPT_MMTKeyword1_block',__file_format,__sheet_mnemonic,3); + v_block :='PTOBST_RPT_MMTKeyword1_block'; + + insert into mmt_staging2.PTOBST_RPT_MMTKeyword1_block +( c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_PTO_report +where rank_tag='PTOBST_RPT_MMTKeyword1'; + + +update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set ods_record=0 where rank in (1,2); + + update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set make=__make; + update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set model=__model; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword1_block set file_syspk='||p_file_syspk||''; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_RPT_MMTKeyword1_block'); + + /* block loading data PTOBST_RPT_MMTKeyword2_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_RPT_MMTKeyword2_block',__file_format,__sheet_mnemonic,4); + v_block :='PTOBST_RPT_MMTKeyword2_block'; + +insert into mmt_staging2.PTOBST_RPT_MMTKeyword2_block +( c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_PTO_report +where rank_tag='PTOBST_RPT_MMTKeyword2'; + + +update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set ods_record=0 where rank in (1,2); + + + update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set make=__make; + update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set model=__model; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_RPT_MMTKeyword2_block set file_syspk='||p_file_syspk||''; + + perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_RPT_MMTKeyword2_block'); + +/* block loading data PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block',__file_format,__sheet_mnemonic,5); + v_block :='PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block'; + + +insert into mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block +( c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,rank) +select column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,rank +from mmt_staging2.stg_process_table_PTO_report +where rank_tag='PTOBST_RPT_PTO_Performance_Test_Observations_Summary'; + + + +update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set ods_record=0 where rank in (1,2); + + update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set make=__make; + update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set model=__model; + execute 'update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set file_syspk='||p_file_syspk||''; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block'); + +/* final update */ + +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set test_condition='PTO performance report'; +update mmt_staging2.PTOBST_RPT_PTO_performance_report_block set test_condition='PTO performance report'; +update mmt_staging2.PTOBST_RPT_PTO_Performance_Test_Observations_Summary_block set test_condition='PTO_Performance_Test_Observations_Summary'; + + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_report_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_report_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/ETL_MAP_PTOBST_v1.0_20210309_MAH_ PTO LAB _M-Star 65 Hp P- II Trem IV (Boost) SAMPLE TEST DATA MANAGEMENT.xlsx b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/ETL_MAP_PTOBST_v1.0_20210309_MAH_ PTO LAB _M-Star 65 Hp P- II Trem IV (Boost) SAMPLE TEST DATA MANAGEMENT.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..28d2a47951894720c452d3fe50b37481fa9fa048 GIT binary patch literal 397536 zcmeFXWm_CuyDo|ooZv3O9fG?P+$FfXYjBqkAh-s1x8UyX8r&hcyPbkL*Iw_s_CDti z?866&g07-RkLT8Ic`0xRG!Q6|43L@9)Lyv`7e3ea$@#-gxZ=2_SrS78WP}`fA1m#8 z-Y>=ByKosl0;CWhDt0bk!~kU00aqs&)SFx(d)EFXTT)dy3Hx(41`QPvHYUE+0!tD+ z%2%pD^%7E3(0Q?p+Pfasub<vHr^5GF4|4L4{mOH)9ieH#hFog?B* zqj@k`KAKEYZ&Wuz$V-+ch1S1Q3h+>MKlFvs1rHR9H>brVzy9G7;FEG>j`Q<#K+iSV z1|8?m+rX{cbi33enEnjHO%Pg8S>|iGgXDtal4b0rxfAiliY$i$Ta3cx#uiBB4sZ~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*JL6ArynKa2(}~>8W7aj?8E~B{N}|O`eFvVN`Fy746yA*UC%BFcQvv`@ zWZ5=*=WZJk9LWfd^xP2>%81wlJ?LqUa{;CF75EQe^=;sPY2eC1?81XNYN9+`IR6wa zSVft-Fb=l*qZa_EiirUL68VI>1=Y3#tLo1Y4g^mIfx@DO z#Ss#fc+H=ePzbJP)aU>(e-39%=N~0zbBd8{Vzen&Z;{R zSyzFS-~I)xn)nJ3Nd-j%%REgxQtjL`WJ5#CEyPCUEo6 z*idvR4w3%eKqLwtkz@F}M216-mP9DlSaH=7^nrsF+6OMnV8TDWGV0($beE1J@{Q6fd+7-*Q`x7UKR4+fkI=JqO&B9S6C20#qR&`5=&n z!b1G?qL@1n6{^e%E`J=t0MKWy3f)4OAf^IIk_zY}lSp*PwqVgJNbFbiISYiK*$xxF zb?O4`74*>s1gPHe6(F*&jRvAm10X=vmtO(Gkt6Y;fKISSfXba;0e*SfLg%a_K*g@F z0KYtKq0_(-pnNwB6n`5dAt@Z~LUgt;!XpX4!4r#HWL1GqXGM5Dz2D$T9MI@@PzW#n zg9M)F;VCbo4701U>QbKcT-InCQ0+2%0+npU__p(Ybr$2p9l9PGEt5?UbX9 xp1XS~E`D-KOni1P6D^J23qs^mKEZbRi0=&19I@cT1pt=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Governing Trails on Boost Mode'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_GVG +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_GVG a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Graphs - for Example'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + + +/* block PTOBST_GVG_performance_governing_trails_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_GVG_performance_governing_trails_block',__file_format,__sheet_mnemonic,1); + +v_block := 'PTOBST_GVG_performance_governing_trails_block'; + +insert into mmt_staging2.PTOBST_GVG_performance_governing_trails_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +c26, +c27, +c28, +c29, +c30, +c31, +c32, +c33, +c34, +c35, +c36, +rank +) + +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +column26, +column27, +column28, +column29, +column30, +column31, +column32, +column33, +column34, +column35, +column36, +rank + from mmt_staging2.stg_process_table_PTO_GVG a +where rank_tag='PTOBST_GVG_performance_governing_trails'; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set test_condition=c2 +where rank=1; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c2=null +where rank=1; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c1=c2 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c1= b.first_value from (SELECT + rank, c1, value_partition, first_value(c1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c1, + sum(case when c1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c7_1=c7 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c7_1= b.first_value from (SELECT + rank, c7_1, value_partition, first_value(c7_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c7_1, + sum(case when c7_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c12_1=c12 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c12_1= b.first_value from (SELECT + rank, c12_1, value_partition, first_value(c12_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c12_1, + sum(case when c12_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c17_1=c17 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c17_1= b.first_value from (SELECT + rank, c17_1, value_partition, first_value(c17_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c17_1, + sum(case when c17_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c22_1=c22 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c22_1= b.first_value from (SELECT + rank, c22_1, value_partition, first_value(c22_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c22_1, + sum(case when c22_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c27_1=c27 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c27_1= b.first_value from (SELECT + rank, c27_1, value_partition, first_value(c27_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c27_1, + sum(case when c27_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set c32_1=c32 where rank=4; + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block a +set c32_1= b.first_value from (SELECT + rank, c32_1, value_partition, first_value(c32_1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c32_1, + sum(case when c32_1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_GVG_performance_governing_trails_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_GVG_performance_governing_trails_block +set ods_record=0 where rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set make=__make; + update mmt_staging2.PTOBST_GVG_performance_governing_trails_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_GVG_performance_governing_trails_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_GVG_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_GVG_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM-stg2.txt new file mode 100644 index 0000000..e5ecd4e --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM-stg2.txt @@ -0,0 +1,188 @@ +drop function if exists mmt_staging2.fn_PTO_MPM_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_MPM_block(p_client_id int,p_function_id int, p_file_format text,p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + + begin + +/************************************************************************************** +Function Name:fn_PTO_MPM_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_MPM +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_MPM_block(1,1,'PTOBST','PTOBST_MPM',880) +***************************************************************************************/ + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_MPM; +truncate table mmt_staging2.stg_process_table_PTO_MPM; +truncate table mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block; + + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_MPM +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_MPM set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_MPM set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_MPM b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* reverese update*/ +execute 'update mmt_staging2.stg_specific_table_PTO_MPM a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Performance - Boost Mode @ Natural Ambient'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_MPM +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_MPM a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Performance - Boost Mode @ Natural Ambient'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + +/* block - PTOBST_MPM_performance_boost_natuaral_block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_MPM_performance_boost_natuaral_block',__file_format,__sheet_mnemonic,1); +v_block :='PTOBST_MPM_performance_boost_natuaral_block'; +insert into mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +( +c2, +c3, +c4, +c5, +rank +) +select column2,column3,column4 ,column5,rank from mmt_staging2.stg_process_table_PTO_MPM +where rank_tag='PTOBST_MPM_performance_boost_natuaral'; + + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +set test_condition=c2 +where rank=1; + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +set c2=null +where rank=1; + + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +set ods_record=0 +where rank in (1,2); + + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set make=__make; + update mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_MPM_performance_boost_natuaral_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_MPM_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_MPM_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM_ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM_ods.txt new file mode 100644 index 0000000..214df28 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-MPM_ods.txt @@ -0,0 +1,72 @@ +drop function if exists mmt_staging2.fn_PTO_MPM_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_MPM_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; +begin + __file_syspk := p_file_syspk; + +/************************************************************* +Function Name:fn_PTO_MPM_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_MPM +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_MPM_ODS(880) +***************************************************************/ + +select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + + insert into mmt_ods.PTO_Multipoint_Mapping +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make ,tractor_model , +test_condition, +engine_speed_rpm, +engine_load_pct, +sfc_gm_per_hp_hr, +fuel_consumption_ltr_per_hr +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model,test_condition, +c2::numeric,c3::numeric,c4::numeric,c5::numeric +from mmt_staging2.PTOBST_MPM_performance_boost_natuaral_block +where ods_record=1 ; + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Multipoint_Mapping +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_MPM' ,null,'ods', 'fn_PTO_MPM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_MPM' ,null,'ods', 'fn_PTO_MPM_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA-stg2.txt new file mode 100644 index 0000000..40e589a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA-stg2.txt @@ -0,0 +1,479 @@ +/* +select mmt_staging2.fn_PTO_PHA_block(1,1,'PTOBST','PTOBST_PHA',183) + +select * from mmt_ods.mmt_config where file_format='PTOBST' and sheet_mnemonic ='PTOBST_PHA' order by syspk +select * from mmt_staging1.mmt_staging_generic_table where file_format='PTOBST' and sheet_mnemonic ='PTOBST_PHA' + +*/ + +drop function if exists mmt_staging2.fn_PTO_PHA_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PHA_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + /************************************************************************************** +Function Name:fn_PTO_PHA_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_PHA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PHA_block(1,1,'PTOBST','PTOBST_PHA',880) +***************************************************************************************/ + + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_PHA; +truncate table mmt_staging2.stg_process_table_PTO_PHA; +truncate table mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int; +truncate table mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block; +truncate table mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block; +truncate table mmt_staging2.PTOBST_PHA_varying_speed_test_block; +truncate table mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block; + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_PHA +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_PHA set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_PHA set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_PHA b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* update config files for row numbers start, end */ +execute 'update mmt_staging2.stg_specific_table_PTO_PHA a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Engine Oil Consumption'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''KEY Performance Parameters'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''2Hrs Max Power Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Varying Speed Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PHA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PHA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Engine Oil Consumption'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* +execute format('select column6 from mmt_staging2.stg_process_table_PTO a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and rank_tag=''PTO_test_tractor_specifications'' and trim(column4)=''Make''') into __make; + +execute format('select column6 from mmt_staging2.stg_process_table_PTO a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and rank_tag=''PTO_test_tractor_specifications'' and trim(column4)=''Model''') into __model; +*/ + +/* fetching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + +/* int data loading PTOBST_PHA_key_perfomrance_parameters_int */ +insert into mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int +( file_syspk,c1,c2,rank) +select file_syspk,column2,column5,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column8,column12,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column13,column16,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column17,column20,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +union +select file_syspk,column21,column24 ,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_KEY_performance_parameters' and rank<>1 +order by rank,column2; + + +delete from mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int where c1 is null; + +/* block data loading PTOBST_PHA_key_perfomrance_parameters_block */ +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_key_perfomrance_parameters_block',__file_format,__sheet_mnemonic,1); +v_block := 'PTOBST_PHA_key_perfomrance_parameters_block'; + +insert into mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block +( +dummy_f, +Ambient_pressure_mm_of_hg , +PTO_gear_ratio , +PTO_power_hp , +Rated_engine_speed , +Test_engineer , +Engine_high_Idle_speed , +PTO_SFC_gm_hp , +Relative_humidity , +Test_bed , +Backup_Torque , +Engine_low_idle_speed , +Exhaust_temperature , +Place , +Specific_gravity_of_Fuel , +back_pressure , +Dyno_Constant , +Engine_oil_temp , +Maximum_Equ_Crankshaft , +Total_run_hrs , +Coolant_temp , +Engine_oil_pressure_bar , +Equ_crankshaft_torque_at_maximum_power , +Test_date +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c1,c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c1::text,c2::text]) AS val + FROM mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_int + ORDER BY generate_series(1,15),2' + ) t (col text,a1 text,a2 text,a3 text,a4 text,a5 text, + a6 text,a7 text,a8 text,a9 text,a10 text,a11 text,a12 text,a13 text,a14 text, + a15 text,a16 text,a17 text,a18 text,a19 text,a20 text,a21 text,a22 text,a23 text); + delete from mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block where dummy_f is null; + +update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set ods_record=0 where dummy_f='c1'; + +update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set test_condition='key_performance_parameters'; + + + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set make=__make; + update mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_key_perfomrance_parameters_block'); + +/* block - PTOBST_PHA_2Hrs_max_power_test_block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_2Hrs_max_power_test_block',__file_format,__sheet_mnemonic,2); +v_block := 'PTOBST_PHA_2Hrs_max_power_test_block'; + +insert into mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag = 'PTOBST_PHA_2Hrs_max_power_test'; + +update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set make=__make; + update mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_2Hrs_max_power_test_block'); + +/* block - PTOBST_PHA_varying_speed_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_varying_speed_test_block',__file_format,__sheet_mnemonic,3); +v_block := 'PTOBST_PHA_varying_speed_test_block'; + + +insert into mmt_staging2.PTOBST_PHA_varying_speed_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag='PTOBST_PHA_varying_speed_test'; + +update mmt_staging2.PTOBST_PHA_varying_speed_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PHA_varying_speed_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PHA_varying_speed_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PHA_varying_speed_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_varying_speed_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_varying_speed_test_block set make=__make; + update mmt_staging2.PTOBST_PHA_varying_speed_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_varying_speed_test_block'); + + /* block PTOBST_PHA_Engine_oil_consumption_block*/ + + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PHA_Engine_oil_consumption_block',__file_format,__sheet_mnemonic,4); +v_block := 'PTOBST_PHA_Engine_oil_consumption_block'; + + insert into mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block +( +c2, +c3,c5, +rank +) +select column2,column3,column5 ,rank from mmt_staging2.stg_process_table_PTO_PHA +where rank_tag='PTOBST_PHA_Engine_oil_consumption'; + +update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set ods_record=0 where +rank in (1,2); + + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set make=__make; + update mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PHA_Engine_oil_consumption_block'); + + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_PHA_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_PHA_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA_ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA_ods.txt new file mode 100644 index 0000000..725ea84 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PHA_ods.txt @@ -0,0 +1,155 @@ +drop function if exists mmt_staging2.fn_PTO_PHA_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PHA_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + __file_syspk := p_file_syspk; +/************************************************************* +Function Name:fn_PTO_PHA_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_PHA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PHA_ODS(880) +***************************************************************/ + + + SET search_path TO mmt_staging2; + select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + insert into mmt_ods.PTO_Key_Perf_Parameters +(client_id,function_id,test_condtion,test_file_ref_no, +tractor_model,tractor_make,pto_gear_ratio,specific_gravity_of_fuel,dyno_constant,pto_power_hp, +pto_sfc_gm_per_hp_hr,backup_torque_pct,engine_oil_temp_c,coolant_temp_c,rated_engine_speed_rpm, +engine_high_idle_speed_rpm,engine_low_idle_speed_rpm,maximum_equi_crankshaft_torque_nm, +equi_crankshaft_torque_at_max_power_nm,ambient_presure_mm_of_hg,related_humidity_pct, +exhaust_temperature_c,back_pressure_mm_of_hg,engine_oil_pressure_bar,test_engineer,test_bed, +location_name,total_run_hrs,test_date,test_file_format,test_file_sheet_format +) +select +client_id,function_id,test_condition,file_syspk, +model,make,pto_gear_ratio::numeric,specific_gravity_of_fuel::numeric,dyno_constant::numeric,pto_power_hp::numeric, +pto_sfc_gm_hp::numeric,backup_torque::numeric,engine_oil_temp::numeric,coolant_temp::numeric, +rated_engine_speed::numeric,engine_high_idle_speed::numeric,engine_low_idle_speed::numeric, +maximum_equ_crankshaft::numeric,equ_crankshaft_torque_at_maximum_power::numeric, +ambient_pressure_mm_of_hg::numeric,relative_humidity::numeric, +exhaust_temperature::numeric,back_pressure::numeric,engine_oil_pressure_bar::numeric,test_engineer,test_bed, +place,total_run_hrs::int, to_Date(test_Date, 'DD-MM-YYYY'),file_format,sheet_mnemonic +from mmt_staging2.PTOBST_PHA_key_perfomrance_parameters_block +where ods_record=1; + + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PHA_2Hrs_max_power_test_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric + from mmt_staging2.PTOBST_PHA_varying_speed_test_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.pto_engine_oil_consumption +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +srl_no, +oil_consumption_gm_per_hr, +oil_consumption_pct_of_fuel_consumption +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +c2::int,c3::numeric,c5::numeric +from mmt_staging2.PTOBST_PHA_Engine_oil_consumption_block +where ods_record=1; + + + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Key_Perf_Parameters +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.pto_engine_oil_consumption +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PHA' ,null,'ods', 'fn_PTO_PHA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PHA' ,null,'ods', 'fn_PTO_PHA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; + +end +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-ods.txt b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-ods.txt new file mode 100644 index 0000000..1064325 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-ods.txt @@ -0,0 +1,226 @@ +drop function if exists mmt_staging2.fn_PTO_PNA_ODS; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PNA_ODS(p_file_syspk int) + RETURNS text AS $$ + declare __test_instance_id int; + declare __file_syspk int; + declare __make text; + declare __model text; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + begin + __file_syspk := p_file_syspk; +/************************************************************* +Function Name:fn_PTO_PNA_ODS +Function Desc: This function populates data into ODS blocks +File Format: PTOBST +Sheet Format: PTOBST_PNA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PNA_ODS(880) +***************************************************************/ + + + SET search_path TO mmt_staging2; + select tractor_model into __model from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; +select tractor_make into __make from mmt_ods.test_instance_tractor_info where test_file_ref_no =__file_syspk; + insert into mmt_ods.PTO_Key_Perf_Parameters +(client_id,function_id,test_condtion,test_file_ref_no, +tractor_model,tractor_make,pto_gear_ratio,specific_gravity_of_fuel,dyno_constant,pto_power_hp, +pto_sfc_gm_per_hp_hr,backup_torque_pct,engine_oil_temp_c,coolant_temp_c,rated_engine_speed_rpm, +engine_high_idle_speed_rpm,engine_low_idle_speed_rpm,maximum_equi_crankshaft_torque_nm, +equi_crankshaft_torque_at_max_Power_Nm,ambient_presure_mm_of_hg,related_humidity_pct, +exhaust_temperature_c,back_pressure_mm_of_hg,engine_oil_pressure_bar,test_engineer,test_bed, +location_name,total_run_hrs,test_date,test_file_format,test_file_sheet_format +) +select +client_id,function_id,test_condition,file_syspk, +model,make,pto_gear_ratio::numeric,specific_gravity_of_fuel::numeric,dyno_constant::numeric,pto_power_hp::numeric, +pto_sfc_gm_hp::numeric,backup_torque::numeric,engine_oil_temp::numeric,coolant_temp::numeric, +rated_engine_speed::numeric,engine_high_idle_speed::numeric,engine_low_idle_speed::numeric, +maximum_equ_crankshaft::numeric,equ_crankshaft_torque_at_maximum_power::numeric, +ambient_pressure_mm_of_hg::numeric,relative_humidity::numeric, +exhaust_temperature::numeric,back_pressure::numeric,engine_oil_pressure_bar::numeric,test_engineer,test_bed, +place,total_run_hrs::int, to_Date(test_Date, 'DD-MM-YYYY'),file_format,sheet_mnemonic +from mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block +where ods_record=1; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::int,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric + from mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +where ods_record=1; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +where ods_record=1 ; +/*and c2<>'Avg' */ + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c2,c3::int,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_varying_speed_test_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,pto_test_sub_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c1,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.PTO_Perf_Results +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +pto_test_type,pto_test_sub_type,serial_number,speed_engine_rpm, +speed_pto_rpm,torque_n_m,torque_kg_m,power_kw, +power_hp,eq_crank_torque_nm,fuel_consumption_g_per_min,fuel_consumption_kg_per_hr, +fuel_consumption_ltr_per_hr,fuel_consumption_sfc_kg_per_kwh,fuel_consumption_sfc_g_per_hph, +sp_energy_kwh_per_ltr,temperatures_fuel_c,temperatures_ambient_c,temperatures_air_in_c, +temperatures_water_outlet_c,temperatures_exh_c,engine_oil_c,pressure_ambient_mm_of_hg,pressure_exh_mm_of_hg, +pressure_lub_oil_bar,rh_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +test_condition,c1,c2,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric,c8::numeric,c9::numeric,c10::numeric, +c11::numeric, +c12::numeric,c13::numeric,c14::numeric,c15::numeric,c16::numeric,c17::numeric,c18::numeric, +c19::numeric,c20::numeric,c21::numeric,c22::numeric,c23::numeric,c24::numeric,c25::numeric +from mmt_staging2.PTOBST_PNA_varying_load_block +where ods_record=1 ; + +/* block */ +insert into mmt_ods.pto_smoke_test +( +client_id,function_id,test_file_ref_no,test_file_format,test_file_sheet_format, +tractor_make, +tractor_model, +engine_speed_rpm, +pto_speed_rpm , +torque_100_pct , +torque_80_pct , +smoke_fsn_100_pct , +smoke_fsn_80_pct +) + +select client_id,function_id,file_syspk,file_format,sheet_mnemonic,make,model, +c2::numeric,c3::numeric,c4::numeric,c5::numeric,c6::numeric,c7::numeric +from mmt_staging2.PTOBST_PNA_smoke_test_block +where ods_record=1 ; + + +select file_syspk into __file_syspk from mmt_staging2.PTOBST_RPT_tractor_specs_block; +select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk; + + +update mmt_ods.PTO_Key_Perf_Parameters +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.PTO_Perf_Results +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; + +update mmt_ods.pto_smoke_test +set test_instance_id=__test_instance_id, +tractor_model =__model, +tractor_make=__make +where test_file_ref_no=__file_syspk; +v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PNA' ,null,'ods', 'fn_PTO_PNA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( null, null, 1001, 'Compegence', __file_syspk ,'PTO','PTO_PNA' ,null,'ods', 'fn_PTO_PNA_ODS', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; + diff --git a/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-stg2.txt b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-stg2.txt new file mode 100644 index 0000000..139b53c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/pto-V1-April22/PTO-PNA-stg2.txt @@ -0,0 +1,837 @@ +drop function if exists mmt_staging2.fn_PTO_PNA_block; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_PNA_block(p_client_id int,p_function_id int, p_file_format text, +p_sheet_mnemonic text, p_file_syspk int) + RETURNS text AS $$ + declare __make text; + declare __model text; + + declare __client_id int :=p_client_id; + declare __function_id int :=p_function_id; + declare __file_format text :=p_file_format; + declare __sheet_mnemonic text :=p_sheet_mnemonic; + declare __file_syspk int :=p_file_syspk; + declare v_state text; + declare v_msg text; + declare v_detail text; + declare v_hint text; + declare v_context text; + declare _error int; + declare v_block text; + begin + + /************************************************************************************** +Function Name:fn_PTO_PNA_block +Function Desc: This function populates data into staging2 blocks +File Format: PTOBST +Sheet Format: PTOBST_PNA +Creation Date: March 21 2021 +Updation Date: +Author: compegence team +Function Call: select mmt_staging2.fn_PTO_PNA_block(1,1,'PTOBST','PTOBST_PNA',880) +***************************************************************************************/ + + +SET search_path TO mmt_staging2; + +/* rerunnability - delete block tables and update config tables to null */ +truncate table mmt_staging2.stg_specific_table_PTO_PNA; +truncate table mmt_staging2.stg_process_table_PTO_PNA; +truncate table mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int; +truncate table mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block; +truncate table mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block; +truncate table mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block; +truncate table mmt_staging2.PTOBST_PNA_varying_speed_test_block; +truncate table mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block; +truncate table mmt_staging2.PTOBST_PNA_varying_load_block; +truncate table mmt_staging2.PTOBST_PNA_smoke_test_block ; + +execute 'delete from mmt_ods.fw_jobctrl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_number_start=null, +row_previous_number=null, +row_read_end=null, +run_time=null +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* transfer data from generic to specific for PTOBST */ +execute 'insert into mmt_staging2.stg_specific_table_PTO_PNA +select * from mmt_staging1.mmt_staging_generic_table a +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''' +and a.file_syspk='||p_file_syspk||''; + +/* trimming data */ +update mmt_staging2.stg_specific_table_PTO_PNA set column3 = TRIM (TRAILING FROM column3 ); +update mmt_staging2.stg_specific_table_PTO_PNA set column3 = TRIM (LEADING FROM column3 ); + +update mmt_ods.mmt_config set F1_modified = TRIM (TRAILING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_modified = TRIM (LEADING FROM F1_modified) ; +update mmt_ods.mmt_config set F1_source=F1_modified ; +update mmt_ods.mmt_config set F1_source = TRIM (TRAILING FROM F1_source); +update mmt_ods.mmt_config set F1_source = TRIM (LEADING FROM F1_source); + +/* keyword match in config table*/ +execute 'update mmt_ods.mmt_config a +set row_number_start=(select min(b.row_number) +from mmt_staging2.stg_specific_table_PTO_PNA b +where trim(upper(F1_modified))=trim(upper(column2)) +and b.is_rownumber_fetched is null) +where a.row_number_start is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* update config files for row numbers start, end */ +execute 'update mmt_staging2.stg_specific_table_PTO_PNA a +set is_rownumber_fetched=1 +from mmt_ods.mmt_config b +where trim(upper(F1_modified))=trim(upper(column3)) +and b.row_number_start=a.row_number +and is_rownumber_fetched is null +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a set row_previous_number=row_number_start-1 +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'update mmt_ods.mmt_config a +set row_read_end= (select b.row_number_start +from mmt_ods.mmt_config b +where b.syspk=a.syspk+1 and file_format='''||p_file_format||''' and sheet_mnemonic='''||p_sheet_mnemonic||''' ) +where a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +/* config file last field update as null otherwise it picks up next format row number*/ +execute 'update mmt_ods.mmt_config a +set row_read_end = null ,run_time=current_timestamp +where f1_modified =''Smoke Test'' +and a.file_format='''||p_file_format||''' and a.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* tagging ranks for each block in process table*/ + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Key Performance Parameters'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Max Power Occurring Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''2Hrs Max Power Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Varying Speed Test - Full Throttle Performance'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Part load @ Rated RPM'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Varying load @ STD. PTO'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + + +execute 'insert into mmt_staging2.stg_process_table_PTO_PNA +select a.* , RANK () OVER ( ORDER BY row_number) as rank,b.rank_tag as rank_tag +from mmt_staging2.stg_specific_table_PTO_PNA a +join mmt_ods.mmt_config b +on a.row_number >=row_number_start +and (a.row_number< row_read_end or row_read_end is null) +and f1_modified=''Smoke Test'' +and b.file_format='''||p_file_format||''' and b.sheet_mnemonic='''||p_sheet_mnemonic||''''; + +/* fetcching tractor model and make */ +select column3 into __make from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3 ; + +select column4 into __model from mmt_staging2.stg_process_table_PTO_report a +where rank_tag='PTOBST_RPT_test_tractor_specifiactions' and rank=3; + + +/* blocks data loading start - PTOBST_PNA_key_perfomrance_parameters_int */ + +insert into mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int +( file_syspk,c1,c2,rank) +select file_syspk,column2,column5,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column8,column12,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column13,column16,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column17,column20,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +union +select file_syspk,column21,column24 ,rank from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_key_perfomrance_parameters' and rank<>1 +order by rank,column2; + + +delete from mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int where c1 is null; + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_key_perfomrance_parameters_block',__file_format,__sheet_mnemonic,1); +v_block := 'PTOBST_PNA_key_perfomrance_parameters_block'; +insert into mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block +( +dummy_f, +Ambient_pressure_mm_of_hg , +PTO_gear_ratio , +PTO_power_hp , +Rated_engine_speed , +Test_engineer , +Engine_high_Idle_speed , +PTO_SFC_gm_hp , +Relative_humidity , +Test_bed , +Backup_Torque , +Engine_low_idle_speed , +Exhaust_temperature , +Place , +Specific_gravity_of_Fuel , +back_pressure , +Dyno_Constant , +Engine_oil_temp , +Maximum_Equ_Crankshaft , +Total_run_hrs , +Coolant_temp , +Engine_oil_pressure_bar , +Equ_crankshaft_torque_at_maximum_power , +Test_date +) +SELECT * +FROM crosstab( + 'SELECT unnest(''{c1,c2}''::text[]) AS col + , row_number() OVER () + , unnest(ARRAY[c1::text,c2::text]) AS val + FROM mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_int + ORDER BY generate_series(1,15),2' + ) t (col text,a1 text,a2 text,a3 text,a4 text,a5 text, + a6 text,a7 text,a8 text,a9 text,a10 text,a11 text,a12 text,a13 text,a14 text, + a15 text,a16 text,a17 text,a18 text,a19 text,a20 text,a21 text,a22 text,a23 text); + + +delete from mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block where dummy_f is null; + +update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set ods_record=0 where dummy_f='c1'; + +update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set test_condition='key_performance_parameters'; + + + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set make=__make; + update mmt_staging2.PTOBST_PNA_key_perfomrance_parameters_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_key_perfomrance_parameters_block'); + +/* blocks data loading start - PTOBST_PNA_boostmode_maxpower_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_boostmode_maxpower_test_block',__file_format,__sheet_mnemonic,2); +v_block := 'PTOBST_PNA_boostmode_maxpower_test_block'; + +insert into mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_boostmode_maxpower_test'; + +update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set ods_record=0 where +rank in (1,2,3,4); + + + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_boostmode_maxpower_test_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_boostmode_maxpower_test_block'); + +/* blocks data loading - PTOBST_PNA_2Hrs_max_power_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_2Hrs_max_power_test_block',__file_format,__sheet_mnemonic,3); +v_block := 'PTOBST_PNA_2Hrs_max_power_test_block'; + +insert into mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag = 'PTOBST_PNA_2Hrs_max_power_test'; + +update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_2Hrs_max_power_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_2Hrs_max_power_test_block'); + +/* blocks data loading - PTOBST_PNA_varying_speed_test_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_varying_speed_test_block',__file_format,__sheet_mnemonic,4); +v_block := 'PTOBST_PNA_varying_speed_test_block'; + + insert into mmt_staging2.PTOBST_PNA_varying_speed_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag='PTOBST_PNA_varying_speed_test'; + +update mmt_staging2.PTOBST_PNA_varying_speed_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_varying_speed_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_varying_speed_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_varying_speed_test_block set ods_record=0 where +rank in (1,2,3,4); + + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_speed_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_varying_speed_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_varying_speed_test_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_varying_speed_test_block'); + +/* blocks data loading start - PTOBST_PNA_part_load_rated_rpm_block */ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_part_load_rated_rpm_block',__file_format,__sheet_mnemonic,5); +v_block := 'PTOBST_PNA_part_load_rated_rpm_block'; + + insert into mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag='PTOBST_PNA_part_load_rated_rpm,' ; + + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set ods_record=0 where +rank in (1,2,3,4); + + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +set c1 =c3 +where c2 is null and ods_record=1; + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block a +set c1= b.first_value from (SELECT + rank, c1, value_partition, first_value(c1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c1, + sum(case when c1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + + +update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block +set c3 = null,ods_record=0 +where c1=c3; + + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set make=__make; + update mmt_staging2.PTOBST_PNA_part_load_rated_rpm_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_part_load_rated_rpm_block'); + +/* block loading data PTOBST_PNA_varying_load_block*/ + +perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_varying_load_block',__file_format,__sheet_mnemonic,6); +v_block := 'PTOBST_PNA_varying_load_block'; + + insert into mmt_staging2.PTOBST_PNA_varying_load_block +( +c2, +c3, +c4, +c5, +c6, +c7, +c8, +c9, +c10, +c11, +c12, +c13, +c14, +c15, +c16, +c17, +c18, +c19, +c20, +c21, +c22, +c23, +c24, +c25, +rank +) +select column2, +column3, +column4, +column5, +column6, +column7, +column8, +column9, +column10, +column11, +column12, +column13, +column14, +column15, +column16, +column17, +column18, +column19, +column20, +column21, +column22, +column23, +column24, +column25, +rank +from mmt_staging2.stg_process_table_PTO_PNA +where rank_tag='PTOBST_PNA_varying_load,'; + + +update mmt_staging2.PTOBST_PNA_varying_load_block set ods_record=0 where +rank in (1,2,3,4); + + +update mmt_staging2.PTOBST_PNA_varying_load_block +set c1 =c3 +where c2 is null and ods_record=1; + +update mmt_staging2.PTOBST_PNA_varying_load_block a +set c1= b.first_value from (SELECT + rank, c1, value_partition, first_value(c1) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + c1, + sum(case when c1 is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_varying_load_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_varying_load_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_varying_load_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_varying_load_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_varying_load_block +set c3 = null,ods_record=0 +where c1=c3; + + + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_varying_load_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_varying_load_block set make=__make; + update mmt_staging2.PTOBST_PNA_varying_load_block set model=__model; + + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_varying_load_block'); + + /* block data loading PTOBST_PNA_smoke_test_block*/ + + perform mmt_staging2.fn_jobctrl_block_begin(__client_id,__function_id,__file_syspk, +'PTOBST_PNA_smoke_test_block',__file_format,__sheet_mnemonic,7); +v_block := 'PTOBST_PNA_smoke_test_block'; + + insert into mmt_staging2.PTOBST_PNA_smoke_test_block +( +c2, +c3, +c4, +c5, +c6, +c7, +rank +) +select +column2, +column3,column4,column5, +column6,column7 ,rank +from mmt_staging2.stg_process_table_PTO_PNA where rank_tag='PTOBST_PNA_smoke_test'; + + +update mmt_staging2.PTOBST_PNA_smoke_test_block +set test_condition=c2 where rank=1; + +update mmt_staging2.PTOBST_PNA_smoke_test_block a +set test_condition= b.first_value from (SELECT + rank, test_condition, value_partition, first_value(test_condition) over (partition by value_partition order by rank) +FROM ( + SELECT + rank, + test_condition, + sum(case when test_condition is null then 0 else 1 end) over (order by rank) as value_partition + FROM mmt_staging2.PTOBST_PNA_smoke_test_block + ORDER BY rank ASC +) as q) b where a.rank = b.rank ; + +update mmt_staging2.PTOBST_PNA_smoke_test_block +set ods_record=0 where rank in (1,2,3); + + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set client_id='||p_client_id||''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set function_id='||p_function_id||''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set file_format='''||p_file_format||''''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set sheet_mnemonic='''||p_sheet_mnemonic||''''; + execute 'update mmt_staging2.PTOBST_PNA_smoke_test_block set file_syspk='||p_file_syspk||''; + + update mmt_staging2.PTOBST_PNA_smoke_test_block set make=__make; + update mmt_staging2.PTOBST_PNA_smoke_test_block set model=__model; + +perform mmt_staging2.fn_jobctrl_block_end(__file_syspk,'PTOBST_PNA_smoke_test_block'); + v_context := ''; +perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,null,'stg2', 'fn_PTO_PNA_block', v_state, v_msg, v_detail, v_hint, v_context,'success'); +return v_context; + +EXCEPTION when OTHERS then + +GET STACKED DIAGNOSTICS + v_state = returned_sqlstate, + v_msg = message_text, + v_detail = pg_exception_detail, + v_hint = pg_exception_hint, + v_context = pg_exception_context; + + perform mmt_staging2.mmt_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_format,__sheet_mnemonic ,v_block,'stg2', 'fn_PTO_PNA_block', v_state, v_msg, v_detail, v_hint, v_context,'error'); +return v_context; +end +$$ LANGUAGE plpgsql; diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/BUDNI_Wrapper.sql b/deployment-20210427T103328Z-001/deployment/wrappers/BUDNI_Wrapper.sql new file mode 100644 index 0000000..669e78d --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/BUDNI_Wrapper.sql @@ -0,0 +1,80 @@ +drop function if exists mmt_staging2.fn_BUDNI_RUN; +CREATE OR REPLACE FUNCTION mmt_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 mmt_staging1.mmt_staging_generic_table a + where file_format = 'BUDNI' order by file_syspk + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_BUDNI_ARC_Block(20,1,'BUDNI','BUDNI_ARC',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_ARC' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_ARC_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_BRK_Block (20,1,'BUDNI','BUDNI_BRK',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_BRK' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_BRK_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_DBP_Block(20,1,'BUDNI','BUDNI_DBP',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_DBP' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_DBP_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_FLD_Block(20,1,'BUDNI','BUDNI_FLD',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_FLD' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_FLD_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_HDL_Block(20,1,'BUDNI','BUDNI_HDL',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_HDL' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_HDL_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_HLG_Block(20,1,'BUDNI','BUDNI_HLG',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_HLG' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_HLG_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_LCG_Block(20,1,'BUDNI','BUDNI_LCG',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_LCG' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_LCG_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_NMT_Block(20,1,'BUDNI','BUDNI_NMT',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_NMT' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_NMT_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_PTO_Block(20,1,'BUDNI','BUDNI_PTO',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_PTO' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_PTO_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_BUDNI_VMT_Block(20,1,'BUDNI','BUDNI_VMT',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='BUDNI_VMT' into status; + if status = 'success' then + perform mmt_staging2.fn_BUDNI_VMT_ODS(w_file_syspk); + end if; + end loop; + +end; +$$ LANGUAGE plpgsql; + +select mmt_staging2.fn_BUDNI_RUN(); + + +delete from mmt_staging2.mmt_DB_Run_Status where file_format = 'BUDNI'; +select count(distinct file_syspk) from mmt_staging2.mmt_DB_Run_Status +select file_syspk,sheet_mnemonic from mmt_staging2.mmt_DB_Run_Status where status = 'error'; +select * from mmt_staging2.mmt_DB_Run_Status where file_format = 'BUDNI' and status = 'error'; +select distinct file_syspk from mmt_staging2.mmt_DB_Run_Status where file_format = 'BUDNI'; + + + + diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/DBOECD_wrapper.txt b/deployment-20210427T103328Z-001/deployment/wrappers/DBOECD_wrapper.txt new file mode 100644 index 0000000..831d116 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/DBOECD_wrapper.txt @@ -0,0 +1,23 @@ +drop function if exists mmt_staging2.fn_DBOECD_RUN; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_DBOECD_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + for f in select distinct a.file_syspk + from mmt_staging1.mmt_staging_generic_table a + where file_format = 'DBOECD' order by file_syspk + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_dboecd_test_block(1,2,'DBOECD','DBOECD_TEST',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='DBOECD_TEST' into status; + if status = 'success' then + perform mmt_ods.fn_dboecd_test_ods(w_file_syspk); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; + +--select mmt_staging2.fn_DBOECD_RUN() \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/DBSTD_wrapper.txt b/deployment-20210427T103328Z-001/deployment/wrappers/DBSTD_wrapper.txt new file mode 100644 index 0000000..e117d11 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/DBSTD_wrapper.txt @@ -0,0 +1,23 @@ +drop function if exists mmt_staging2.fn_DBSTD_RUN; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_DBSTD_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + for f in select distinct a.file_syspk + from mmt_staging1.mmt_staging_generic_table a + where file_format = 'DBSTD' order by file_syspk + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_dbstd_test_block(1,2,'DBSTD','DBSTD_TEST',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='DBSTD_TEST' into status; + if status = 'success' then + perform mmt_ods.fn_dbstd_test_ods(w_file_syspk); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; + +--select mmt_staging2.fn_DBSTD_RUN() \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper.txt b/deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper.txt new file mode 100644 index 0000000..39ec65a --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper.txt @@ -0,0 +1,29 @@ +drop function if exists mmt_staging2.fn_FTDRY_RUN; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + for f in select distinct a.file_syspk + from mmt_staging1.mmt_staging_generic_table a + where file_format = 'FTDRY' order by file_syspk + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_TRS' into status; + if status = 'success' then + perform mmt_staging2.fn_FTDRY_TRS_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_FTDRY_SUM_Block (20,1,'FTDRY','FTDRY_SUM',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_SUM' into status; + if status = 'success' then + perform mmt_staging2.fn_FTDRY_SUM_ODS(w_file_syspk); + perform mmt_staging2.fn_test_output_FTDRY(w_file_syspk); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; + +--select mmt_staging2.fn_FTDRY_RUN() \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper_v1.txt b/deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper_v1.txt new file mode 100644 index 0000000..dad0c6c --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/FTDRY-wrapper_v1.txt @@ -0,0 +1,26 @@ +drop function if exists mmt_staging2.fn_FTDRY_RUN; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTDRY_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + for f in select file_syspk from mmt_ods.fw_jobctl_file_runschedule + where end_status like 'Staging1 Completed' and file_format='FTDRY' + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_TRS' into status; + if status = 'success' then + perform mmt_staging2.fn_FTDRY_TRS_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_FTDRY_SUM_Block (20,1,'FTDRY','FTDRY_SUM',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTDRY_SUM' into status; + if status = 'success' then + perform mmt_staging2.fn_FTDRY_SUM_ODS(w_file_syspk); + perform mmt_staging2.fn_test_output_FTDRY(w_file_syspk); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/FTHLG-wrapper.txt b/deployment-20210427T103328Z-001/deployment/wrappers/FTHLG-wrapper.txt new file mode 100644 index 0000000..3328f12 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/FTHLG-wrapper.txt @@ -0,0 +1,29 @@ +drop function if exists mmt_staging2.fn_FTHLG_RUN; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTHLG_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + for f in select distinct a.file_syspk + from mmt_staging1.mmt_staging_generic_table a + where file_format = 'FTHLG' order by file_syspk + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_FTHLG_TRS_Block(20,1,'FTHLG','FTHLG_TRS',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTHLG_TRS' into status; + if status = 'success' then + perform mmt_staging2.fn_FTHLG_TRS_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_FTHLG_SUM_Block (20,1,'FTHLG','FTHLG_SUM',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTHLG_SUM' into status; + if status = 'success' then + perform mmt_staging2.fn_FTHLG_SUM_ODS(w_file_syspk); + perform mmt_staging2.fn_test_output_FTHLG(w_file_syspk); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; + +--select mmt_staging2.fn_FTHLG_RUN() \ No newline at end of file diff --git a/deployment-20210427T103328Z-001/deployment/wrappers/FTWET-wrapper.txt b/deployment-20210427T103328Z-001/deployment/wrappers/FTWET-wrapper.txt new file mode 100644 index 0000000..8e23fa4 --- /dev/null +++ b/deployment-20210427T103328Z-001/deployment/wrappers/FTWET-wrapper.txt @@ -0,0 +1,29 @@ +drop function if exists mmt_staging2.fn_FTWET_RUN; +CREATE OR REPLACE FUNCTION mmt_staging2.fn_FTWET_RUN() + RETURNS void AS $$ + declare + f record; + w_file_syspk int; + status text; + begin + for f in select distinct a.file_syspk + from mmt_staging1.mmt_staging_generic_table a + where file_format = 'FTWET' order by file_syspk + loop + select f.file_syspk into w_file_syspk; + perform mmt_staging2.fn_ftwet_trs_block(20,1,'FTWET','FTWET_TRS',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTWET_TRS' into status; + if status = 'success' then + perform mmt_staging2.fn_FTWET_TRS_ODS(w_file_syspk); + end if; + perform mmt_staging2.fn_ftwet_sum_block (20,1,'FTWET','FTWET_SUM',w_file_syspk); + select e.status from mmt_staging2.mmt_DB_Run_Status e where file_syspk = w_file_syspk and sheet_mnemonic ='FTWET_SUM' into status; + if status = 'success' then + perform mmt_staging2.fn_FTWET_SUM_ODS(w_file_syspk); + perform mmt_staging2.fn_test_output_FTWET(w_file_syspk); + end if; + end loop; +end; +$$ LANGUAGE plpgsql; + +--select mmt_staging2.fn_FTWET_RUN() \ No newline at end of file