Files
MMT/MMT_SQL/ods/PTO-MPM_ods.txt

35 lines
1.0 KiB
Plaintext

drop function if exists mmt_staging2.fn_PTO_MPM_ODS;
CREATE OR REPLACE FUNCTION mmt_staging2.fn_PTO_MPM_ODS()
RETURNS void AS $$
begin
/*************************************************************
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()
***************************************************************/
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 ;
end
$$ LANGUAGE plpgsql;