sql
This commit is contained in:
77
onetime/dataloadfunctions/PTO/PTO_GVG_ods.sql
Executable file → Normal file
77
onetime/dataloadfunctions/PTO/PTO_GVG_ods.sql
Executable file → Normal file
@@ -158,8 +158,8 @@ select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
model,
|
||||
make,
|
||||
model,
|
||||
test_condition ,
|
||||
c22_1,
|
||||
c22::numeric,
|
||||
@@ -177,8 +177,8 @@ select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
model,
|
||||
make,
|
||||
model,
|
||||
test_condition ,
|
||||
c27_1,
|
||||
c27::numeric,
|
||||
@@ -196,8 +196,8 @@ select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
model,
|
||||
make,
|
||||
model,
|
||||
test_condition ,
|
||||
c32_1,
|
||||
c32::numeric,
|
||||
@@ -209,7 +209,64 @@ file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_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);
|
||||
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)
|
||||
union
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
test_condition ,
|
||||
c37_1,
|
||||
c37::numeric,
|
||||
c38::numeric,
|
||||
c39::numeric,
|
||||
c30::numeric,
|
||||
c41::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_record=1
|
||||
and (c37 is not null and c38 is not null and c39 is not null and c40 is not null and c41 is not null)
|
||||
union
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
test_condition,
|
||||
c42_1,
|
||||
c42::numeric,
|
||||
c43::numeric,
|
||||
c44::numeric,
|
||||
c45::numeric,
|
||||
c46::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_record=1
|
||||
and (c42 is not null and c43 is not null and c44 is not null and c45 is not null and c46 is not null)
|
||||
union
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
test_condition ,
|
||||
c47_1,
|
||||
c47::numeric,
|
||||
c48::numeric,
|
||||
c49::numeric,
|
||||
c50::numeric,
|
||||
c51::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_record=1
|
||||
and (c47 is not null and c48 is not null and c49 is not null and c50 is not null and c51 is not null);
|
||||
|
||||
update transactional.PTO_Perf_Governing_Graph set test_mode = 'Normal Mode' where file_sheet_mnemonic = 'PTOBEN_GVGN' and file_syspk = __file_syspk;
|
||||
update transactional.PTO_Perf_Governing_Graph set test_mode = 'Boost Mode' where file_sheet_mnemonic = 'PTOBEN_GVGB' and file_syspk = __file_syspk;
|
||||
@@ -232,7 +289,7 @@ test_master_id = __test_master_id
|
||||
where file_syspk=__file_syspk and file_sheet_mnemonic =__file_sheet_mnemonic;
|
||||
|
||||
update transactional.test_instance a
|
||||
set (test_location_name,test_engineer,date_of_test) = (select place,test_engineer,TO_DATE(test_date, 'DD/MM/YYYY') from staging2.PTOBEN_PRF_Key_Performance_Parameters_block where file_syspk = __file_syspk and test_condition='observed')
|
||||
set (test_location_name,test_engineer,date_of_test) = (select place,test_engineer,test_date::date from staging2.PTOBEN_PRF_Key_Performance_Parameters_block where file_syspk = __file_syspk and test_condition='observed')
|
||||
where file_syspk = __file_syspk;
|
||||
|
||||
UPDATE transactional.pto_perf_governing_graph a set test_mode = CASE WHEN a.test_condition like '%Normal%' THEN 'Normal'
|
||||
@@ -242,6 +299,16 @@ UPDATE transactional.pto_perf_governing_graph a set test_mode = CASE WHEN a.tes
|
||||
ELSE NULL
|
||||
end;
|
||||
|
||||
update transactional.test_instance
|
||||
set test_type = a.test_type,
|
||||
test_name= a.test_name
|
||||
from fw_core.test_file_sheet_format_master a
|
||||
where transactional.test_instance.file_sheet_mnemonic = a.file_sheet_mnemonic
|
||||
and transactional.test_instance.file_syspk=__file_syspk;
|
||||
|
||||
|
||||
|
||||
|
||||
err_context := '';
|
||||
perform fw_core.fn_insert_db_error( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_PTO_GVG_trx', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
return err_context;
|
||||
|
||||
Reference in New Issue
Block a user