latest_mmt_version
This commit is contained in:
42
MMT_latest_version/sql/ReadMe.txt
Normal file
42
MMT_latest_version/sql/ReadMe.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
#For folder mmt:
|
||||
pre requisite:
|
||||
1. Table fw_core.fw_jobctl_runschedule has a column (end_time) , this column needs to be updated to current date
|
||||
one can run following queries to update time:
|
||||
update fw_core.fw_jobctl_runschedule set end_time=current_timestamp
|
||||
|
||||
2. (optional): tables <fw_core.fw_jobctl_runschedule>, <fw_core.fw_jobctl_file_sheet_runschedule>, <fw_core.fw_jobctl_file_runschedule> has column <end_status>
|
||||
the data for this column should be "stg1-completed". if this column has different value apart from the expected values then run the below queries:
|
||||
update fw_core.fw_jobctl_runschedule set end_status =case when end_status <> '' then 'stg1-completed' end
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status =case when end_status <> '' then 'stg1-completed' end
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status =case when end_status <> '' then 'stg1-completed' end
|
||||
|
||||
3. select fn_update_na()
|
||||
|
||||
Now
|
||||
1. compile:
|
||||
In unix terminal, navigate to scripts folder ( home/jagadish/mmt/scripts)
|
||||
In terminal type: ./run_onetime_compile.sh
|
||||
In Terminal Type: ./run_onetime_compile.sh 1>/dev/null
|
||||
this will only print errors on the screen.
|
||||
|
||||
This will compile all applications by creating tables,inserting data etc.
|
||||
|
||||
run_onetime_individual will run compile single folder (plz change the script as per needs)
|
||||
|
||||
2. on linux : run wrappers:
|
||||
wrapper : run_master_wrapper.sh is a wrapper that executes all wrapper function
|
||||
it fails to execute if jobctl_runschedule table count is zero for the current date
|
||||
else executes all the wrappers
|
||||
running wrapper:
|
||||
running run_master_wrapper.sh:
|
||||
to run this wrapper just type in terminal: ./run_master_wrapper.sh
|
||||
This will execute all the wrappers function.
|
||||
Done
|
||||
|
||||
one can test things by executing following queries in DBeaver:(
|
||||
select * from fw_core.db_run_status where error_timestamp::date = date'2021-05-25%';
|
||||
select * from fw_core.fw_jobctl_file_runschedule where run_schedule_date::date = date'2021-05-25%';
|
||||
select * from fw_core.fw_jobctl_file_sheet_runschedule where run_schedule_date::date = date'2021-05-25%';
|
||||
select * from fw_core.check_model_count where create_timestamp::date = date'2021-05-25%;
|
||||
select * from fw_core.check_mnemonic_count where create_time::date =date'2021-05-25%;
|
||||
select * from fw_core.check_table_stg_trx_count where create_time::date =date'2021-05-25%;
|
||||
1
MMT_latest_version/sql/con-pwd.sh
Normal file
1
MMT_latest_version/sql/con-pwd.sh
Normal file
@@ -0,0 +1 @@
|
||||
psql -h localhost -d mmt_deploy -U postgres -p 2345
|
||||
1
MMT_latest_version/sql/con_00.sh
Normal file
1
MMT_latest_version/sql/con_00.sh
Normal file
@@ -0,0 +1 @@
|
||||
psql -X -A -t postgresql://postgres:'j3(jLBq}e'@localhost/mmt_deploy?options=--search_path%3Dstaging2
|
||||
8
MMT_latest_version/sql/dummy.sql
Normal file
8
MMT_latest_version/sql/dummy.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
drop function if exists staging2.fn_dummy;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_dummy()
|
||||
RETURNS void AS $$
|
||||
begin
|
||||
select f1_modified='Test equipment’s used' from transactional.source_config;
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
1477
MMT_latest_version/sql/old/DBOECD_TEST_stg2.sql
Normal file
1477
MMT_latest_version/sql/old/DBOECD_TEST_stg2.sql
Normal file
File diff suppressed because it is too large
Load Diff
1375
MMT_latest_version/sql/old/DBSTD_TEST_stg2.sql
Normal file
1375
MMT_latest_version/sql/old/DBSTD_TEST_stg2.sql
Normal file
File diff suppressed because it is too large
Load Diff
124
MMT_latest_version/sql/old/etl-postgres-comp.sh
Normal file
124
MMT_latest_version/sql/old/etl-postgres-comp.sh
Normal file
@@ -0,0 +1,124 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
#Directories
|
||||
homeDir=$HOME/etl
|
||||
dataDir=$homeDir/data
|
||||
backupDir=$homeDir/data/old
|
||||
configDir=$homeDir/conf
|
||||
input_file=$configDir/serverCredentials-postgres.txt
|
||||
declare -A credentials
|
||||
while IFS="=" read -r key value; do
|
||||
credentials[$key]=$value
|
||||
done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file )
|
||||
for i in ${credentials[@]}; do echo ***$i; done
|
||||
|
||||
echo "source user" ${credentials[source_user]}
|
||||
echo "source user" ${credentials[source_password]}
|
||||
echo "source user" ${credentials[source_host]}
|
||||
echo "source user" ${credentials[source_db]}
|
||||
echo "source user" ${credentials[source_protocol]}
|
||||
echo "source user" ${credentials[source_server]}
|
||||
echo "source user" ${credentials[target_user]}
|
||||
echo "source user" ${credentials[target_password]}
|
||||
echo "source user" ${credentials[target_host]}
|
||||
echo "source user" ${credentials[target_db]}
|
||||
echo "source user" ${credentials[target_protocol]}
|
||||
echo "source user" ${credentials[target_server]}
|
||||
|
||||
source_user=${credentials[source_user]}
|
||||
source_password=${credentials[source_password]}
|
||||
source_host=${credentials[source_host]}
|
||||
source_db=${credentials[source_db]}
|
||||
source_sch=${credentials[source_sch]}
|
||||
source_protocol=${credentials[source_protocol]}
|
||||
source_server=${credentials[source_server]}
|
||||
target_user=${credentials[target_user]}
|
||||
target_password=${credentials[target_password]}
|
||||
target_host=${credentials[target_host]}
|
||||
target_db=${credentials[target_db]}
|
||||
target_sch=${credentials[target_sch]}
|
||||
target_protocol=${credentials[target_protocol]}
|
||||
target_server=${credentials[target_server]}
|
||||
|
||||
control_sch='control'
|
||||
|
||||
|
||||
#source_con="PGOPTIONS=--search_path=source PGPASSWORD=$source_password psql -h $source_host -d $source_db -U $source_user"
|
||||
#control_con="PGOPTIONS=--search_path=control PGPASSWORD=$target_password psql -h $target_host -d $target_db -U $target_user"
|
||||
#trx_con="PGOPTIONS=--search_path=trx PGPASSWORD=$target_password psql -h $target_host -d $target_db -U $target_user"
|
||||
|
||||
#source_con="psql -X -A -h $source_host -d $source_db -U $source_user -t"
|
||||
#trx_con="psql -X -A -h $target_host -d $target_db -U $target_user -t"
|
||||
#control_con="psql -X -A -h $target_host -d $target_db -U $target_user -t"
|
||||
|
||||
control_con="psql -X -A -t postgresql://$target_user:$target_password@$target_host/$target_db?options=--search_path%3D$control_sch"
|
||||
trx_con="psql -X -A -t postgresql://$target_user:$target_password@$target_host/$target_db?options=--search_path%3D$target_sch"
|
||||
source_con="psql -X -A -t postgresql://$source_user:$source_password@$source_host/$source_db?options=--search_path%3D$source_sch"
|
||||
|
||||
|
||||
process_count=$($control_con -c "select count(process_flag) from trx_ctl_jobrun where process_flag=0;")
|
||||
$control_con -c "insert into trx_job_log_status(client_id,function_id,job_id) select client_id,function_id,job_id from trx_ctl_jobrun;";
|
||||
while [ $process_count -gt 0 ]
|
||||
do
|
||||
min_dependant_on=$($control_con -c "select min(dependant_on) from trx_ctl_jobrun where process_flag=0 limit 1;")
|
||||
job_id=$($control_con -c "select job_id from trx_ctl_jobrun where dependant_on=$min_dependant_on and process_flag=0 limit 1;")
|
||||
source_sql=$($control_con -c "select source_sql from trx_ctl_jobrun where job_id=$job_id;")
|
||||
source_sql_suffix=$($control_con -c "select source_sql_suffix from trx_ctl_jobrun where job_id=$job_id;")
|
||||
last_run_date=$($control_con -c "select last_run_date from trx_ctl_jobrun where job_id=$job_id;")
|
||||
client_id=$($control_con -c "select client_id from trx_ctl_jobrun where job_id=$job_id;")
|
||||
function_id=$($control_con -c "select function_id from trx_ctl_jobrun where job_id=$job_id;")
|
||||
transactions=$($control_con -c "select transactions from trx_ctl_jobrun where job_id=$job_id;")
|
||||
primary_table=$($control_con -c "select primary_table from trx_ctl_jobrun where job_id=$job_id;")
|
||||
primary_table_id=$($control_con -c "select primary_table_id from trx_ctl_jobrun where job_id=$job_id;")
|
||||
primary_timestamp=$($control_con -c "select primary_table_timestamp from trx_ctl_jobrun where job_id=$job_id;")
|
||||
last_run_id=$($control_con -c "select last_run_id from trx_ctl_jobrun where job_id=$job_id;")
|
||||
target_table=$($control_con -c "select target_table from trx_ctl_jobrun where job_id=$job_id;")
|
||||
#transactions_to=$(expr "$last_run_id" + "$transactions")
|
||||
primary_table_max_id=$($source_con -c "select max($primary_table_id) from $primary_table; ")
|
||||
primary_table_max_time=$($source_con -c "select max($primary_timestamp) from $primary_table where $primary_table_id=$primary_table_max_id ;")
|
||||
#echo "---- prim $source_con -c select max($primary_timestamp) from $primary_table where $primary_table_id=$primary_table_max_id "
|
||||
|
||||
current_timestamp=`date +'%F %T'`
|
||||
$control_con -c "update trx_job_log_status set job_start_time='$current_timestamp',first_run_id=$last_run_id where job_id=$job_id;"
|
||||
source_sql=$(echo $source_sql | sed -e "s/last_run_id/$last_run_id/g")
|
||||
source_sql=$(echo $source_sql | sed -e "s/last_run_date/'$last_run_date'/g")
|
||||
echo "------$source_sql"
|
||||
|
||||
# for nexttime same job have few rows
|
||||
#echo "---- prim $source_con -c select max($primary_timestamp) from $primary_table where $primary_table_id=$primary_table_max_id "
|
||||
while [ $primary_table_max_id -gt $last_run_id ]
|
||||
do
|
||||
diff=$(expr "$primary_table_max_id" - "$last_run_id")
|
||||
if [ $diff -lt $transactions ] || [ $transactions -eq 0 ]
|
||||
then
|
||||
echo "then"
|
||||
run_sql="${source_sql} where $primary_table_id>$last_run_id and $primary_timestamp>='$last_run_date'"
|
||||
run_sql_suffix="${run_sql} ${source_sql_suffix};"
|
||||
$control_con -c "update trx_ctl_jobrun set last_run_id=$primary_table_max_id ,last_run_date='$primary_table_max_time' where job_id=$job_id;"
|
||||
last_run_id=$($control_con -c "select last_run_id from trx_ctl_jobrun where job_id=$job_id;")
|
||||
$source_con -c "$run_sql_suffix">$dataDir/$job_id.csv
|
||||
$trx_con -c "\copy $target_table from $dataDir/$job_id.csv delimiter '|' NULL AS ''"
|
||||
# $control_con -e "LOAD DATA LOCAL INFILE '$dataDir/$job_id.csv' INTO TABLE $control_db.$target_table FIELDS TERMINATED BY '\t'"
|
||||
else
|
||||
echo "else"
|
||||
transactions_to=$(expr "$last_run_id" + "$transactions")
|
||||
primary_table_int_max_time=$($source_con -c "select $primary_timestamp from $primary_table where $primary_table_id=$transactions_to;")
|
||||
run_sql="${source_sql} where $primary_table_id>$last_run_id and $primary_table_id<=$transactions_to and $primary_timestamp>='$last_run_date';"
|
||||
run_sql_suffix="${run_sql} ${source_sql_suffix};"
|
||||
$control_con -c "update trx_ctl_jobrun set last_run_id=$transactions_to,last_run_date='$primary_table_int_max_time' where job_id=$job_id;"
|
||||
last_run_id=$($control_con -c "select last_run_id from trx_ctl_jobrun where job_id=$job_id;")
|
||||
$source_con -c "$run_sql_suffix">$dataDir/$job_id.csv
|
||||
$trx_con -c "\copy $target_table from $dataDir/$job_id.csv delimiter '|' NULL AS ''"
|
||||
#echo "$control_con -c \copy $target_sch.$target_table from $dataDir/$job_id.csv delimiter '|'"
|
||||
#$control_con -e "LOAD DATA LOCAL INFILE '$dataDir/$job_id.csv' INTO TABLE $control_db.$target_table FIELDS TERMINATED BY '\t'"
|
||||
fi
|
||||
done
|
||||
current_timestamp=`date +'%F %T'`
|
||||
$control_con -c "update trx_job_log_status set job_end_time='$current_timestamp',last_run_id=$last_run_id,target_table='$target_table' , job_id=$job_id, duration=EXTRACT(EPOCH FROM (job_end_time-job_start_time)),rows_added=last_run_id-first_run_id where job_status=0 and job_id=$job_id"
|
||||
$control_con -c "update trx_job_log_status set job_status=1 where job_id=$job_id and job_status=0;"
|
||||
# $control_con -c "update trx_job_log_status set rows_added=last_run_id-first_run_id where job_id=$job_id;"
|
||||
$control_con -c "update trx_ctl_jobrun set process_flag=1 where job_id=$job_id;"
|
||||
process_count=$($control_con -c "select count(process_flag) from trx_ctl_jobrun where process_flag=0;")
|
||||
|
||||
done
|
||||
echo "nothing"
|
||||
6
MMT_latest_version/sql/old/final.sh
Normal file
6
MMT_latest_version/sql/old/final.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
echo "************ Compiling mmt/onetime folder ************"
|
||||
echo "************ Errors while compiling are: "
|
||||
./run_onetime_compile.sh 1>/dev/null
|
||||
echo "************ Running wrappers ************"
|
||||
./run_master_wrapper.sh
|
||||
285
MMT_latest_version/sql/old/fn_validation_count_bak.sql
Normal file
285
MMT_latest_version/sql/old/fn_validation_count_bak.sql
Normal file
@@ -0,0 +1,285 @@
|
||||
drop function if exists fw_core.fn_validation_trx_count;
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_validation_trx_count(p_date date)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
begin
|
||||
|
||||
/*
|
||||
selectfw_core.fn_validation_trx_count ('2021-04-12')
|
||||
*/
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_arc_perf_atmos_meas_test_block',count(*) from staging2.budni_arc_perf_atmos_meas_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_arc_spec_h1_block',count(*) from staging2.budni_arc_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_arc_test_obs_summary_block',count(*) from staging2.budni_arc_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_other_observations_block',count(*) from staging2.budni_brk_other_observations_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_parking_barke_test_block',count(*) from staging2.budni_brk_parking_barke_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_ballasted_25kmph_block',count(*) from staging2.budni_brk_service_cold_ballasted_25kmph_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_ballasted_maximum_block',count(*) from staging2.budni_brk_service_cold_ballasted_maximum_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_standard_25kmph_block',count(*) from staging2.budni_brk_service_cold_standard_25kmph_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_standard_maximum_block',count(*) from staging2.budni_brk_service_cold_standard_maximum_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_fade_ballasted_25kmph_block',count(*) from staging2.budni_brk_service_fade_ballasted_25kmph_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_fade_standard_maximum_block',count(*) from staging2.budni_brk_service_fade_standard_maximum_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_spec_h1_block',count(*) from staging2.budni_brk_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_brk_test_obs_summary_block',count(*) from staging2.budni_brk_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_dbp_drawbar_perf_block',count(*) from staging2.budni_dbp_drawbar_perf_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_dbp_spec_h1_block',count(*) from staging2.budni_dbp_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_fld_cage_wheel_block',count(*) from staging2.budni_fld_cage_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_fld_impl_test_block',count(*) from staging2.budni_fld_impl_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_fld_spec_h1_block',count(*) from staging2.budni_fld_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_fld_sum_perf_test_block',count(*) from staging2.budni_fld_sum_perf_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_fld_test_obs_summary_block',count(*) from staging2.budni_fld_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_lifting_capacity_test_block',count(*) from staging2.budni_hdl_lifting_capacity_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_maintenance_of_lift_load_block',count(*) from staging2.budni_hdl_maintenance_of_lift_load_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_power_test_block',count(*) from staging2.budni_hdl_power_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_spec_h1_block',count(*) from staging2.budni_hdl_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_test_obs_summary_block',count(*) from staging2.budni_hdl_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hlg_perf_test_block',count(*) from staging2.budni_hlg_perf_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hlg_spec_h1_block',count(*) from staging2.budni_hlg_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_hlg_test_obs_summary_block',count(*) from staging2.budni_hlg_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_lcg_gravity_test_block',count(*) from staging2.budni_lcg_gravity_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_lcg_spec_h1_block',count(*) from staging2.budni_lcg_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_atmos_cond_2_block',count(*) from staging2.budni_nmt_atmos_cond_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_meas_results_1_block',count(*) from staging2.budni_nmt_meas_results_1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_meas_results_2_block',count(*) from staging2.budni_nmt_meas_results_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_noise_at_bystander_position_block',count(*) from staging2.budni_nmt_noise_at_bystander_position_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_noise_at_operator_ear_level_block',count(*) from staging2.budni_nmt_noise_at_operator_ear_level_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_spec_h1_block',count(*) from staging2.budni_nmt_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_test_obs_summary_block',count(*) from staging2.budni_nmt_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_pto_mmtkeyword1_block',count(*) from staging2.budni_pto_mmtkeyword1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_pto_mmtkeyword2_block',count(*) from staging2.budni_pto_mmtkeyword2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_pto_perf_report_block',count(*) from staging2.budni_pto_perf_report_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_pto_spec_h1_block',count(*) from staging2.budni_pto_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_pto_summary_block',count(*) from staging2.budni_pto_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_vmt_perf_meas_test_block',count(*) from staging2.budni_vmt_perf_meas_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_vmt_spec_h1_block',count(*) from staging2.budni_vmt_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','budni_vmt_test_obs_summary_block',count(*) from staging2.budni_vmt_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_drawbar_performance_fuel_consumption_block',count(*) from staging2.dboecd_test_drawbar_performance_fuel_consumption_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_drawbar_performance_gear_performance_block',count(*) from staging2.dboecd_test_drawbar_performance_gear_performance_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_drawbar_performance_selected_summary_block',count(*) from staging2.dboecd_test_drawbar_performance_selected_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_engine_to_pto_block',count(*) from staging2.dboecd_test_engine_rpm_engine_to_pto_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_required_pull_block',count(*) from staging2.dboecd_test_engine_rpm_required_pull_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_rpm_block',count(*) from staging2.dboecd_test_engine_rpm_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_tyre_details_block',count(*) from staging2.dboecd_test_engine_rpm_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_weight_block',count(*) from staging2.dboecd_test_engine_rpm_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_h1_block',count(*) from staging2.dboecd_test_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_measurement_uncertainty_block',count(*) from staging2.dboecd_test_measurement_uncertainty_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_remarks_block',count(*) from staging2.dboecd_test_remarks_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_remarks_footer_block',count(*) from staging2.dboecd_test_remarks_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_test_condition_block',count(*) from staging2.dboecd_test_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_test_equipment_used_block',count(*) from staging2.dboecd_test_test_equipment_used_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_cleaner_block',count(*) from staging2.dboecd_test_tractor_specifications_cleaner_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_cylinders_block',count(*) from staging2.dboecd_test_tractor_specifications_cylinders_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_engine_details_block',count(*) from staging2.dboecd_test_tractor_specifications_engine_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_fuel_and_injection_block',count(*) from staging2.dboecd_test_tractor_specifications_fuel_and_injection_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_clutch_block',count(*) from staging2.dboecd_test_transmission_clutch_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_drawbar_block',count(*) from staging2.dboecd_test_transmission_drawbar_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_fuel_lubricant_block',count(*) from staging2.dboecd_test_transmission_fuel_lubricant_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_speed_chart_block',count(*) from staging2.dboecd_test_transmission_speed_chart_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_speed_chart_desc_block',count(*) from staging2.dboecd_test_transmission_speed_chart_desc_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_wheels_block',count(*) from staging2.dboecd_test_transmission_wheels_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_drawbar_performance_gear_performance_block',count(*) from staging2.dbstd_test_drawbar_performance_gear_performance_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_drawbar_performance_selected_summary_block',count(*) from staging2.dbstd_test_drawbar_performance_selected_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_engine_to_pto_block',count(*) from staging2.dbstd_test_engine_rpm_engine_to_pto_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_required_pull_block',count(*) from staging2.dbstd_test_engine_rpm_required_pull_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_rpm_block',count(*) from staging2.dbstd_test_engine_rpm_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_tyre_details_block',count(*) from staging2.dbstd_test_engine_rpm_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_weight_block',count(*) from staging2.dbstd_test_engine_rpm_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_h1_block',count(*) from staging2.dbstd_test_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_measurement_uncertainty_block',count(*) from staging2.dbstd_test_measurement_uncertainty_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_remarks_block',count(*) from staging2.dbstd_test_remarks_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_remarks_footer_block',count(*) from staging2.dbstd_test_remarks_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_test_condition_block',count(*) from staging2.dbstd_test_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_test_equipment_used_block',count(*) from staging2.dbstd_test_test_equipment_used_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_cleaner_block',count(*) from staging2.dbstd_test_tractor_specifications_cleaner_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_cylinders_block',count(*) from staging2.dbstd_test_tractor_specifications_cylinders_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_engine_details_block',count(*) from staging2.dbstd_test_tractor_specifications_engine_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_fuel_and_injection_block',count(*) from staging2.dbstd_test_tractor_specifications_fuel_and_injection_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_clutch_block',count(*) from staging2.dbstd_test_transmission_clutch_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_drawbar_block',count(*) from staging2.dbstd_test_transmission_drawbar_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_fuel_lubricant_block',count(*) from staging2.dbstd_test_transmission_fuel_lubricant_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_speed_chart_block',count(*) from staging2.dbstd_test_transmission_speed_chart_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_speed_chart_desc_block',count(*) from staging2.dbstd_test_transmission_speed_chart_desc_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_wheels_block',count(*) from staging2.dbstd_test_transmission_wheels_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_comments_by_block',count(*) from staging2.ftdry_sum_comments_by_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_implement_block',count(*) from staging2.ftdry_sum_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_test_condition_1_block',count(*) from staging2.ftdry_sum_test_condition_1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_test_condition_2_block',count(*) from staging2.ftdry_sum_test_condition_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_trac_h1_block',count(*) from staging2.ftdry_sum_trac_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_engine_rpm_block',count(*) from staging2.ftdry_trs_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_h1_block',count(*) from staging2.ftdry_trs_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_implement_block',count(*) from staging2.ftdry_trs_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_spec_block',count(*) from staging2.ftdry_trs_spec_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_comments_by_block',count(*) from staging2.fthlg_sum_comments_by_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_test_condition_1_block',count(*) from staging2.fthlg_sum_test_condition_1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_test_condition_2_block',count(*) from staging2.fthlg_sum_test_condition_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_trac_h1_block',count(*) from staging2.fthlg_sum_trac_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_trail_type_block',count(*) from staging2.fthlg_sum_trail_type_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_engine_rpm_block',count(*) from staging2.fthlg_trs_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_h1_block',count(*) from staging2.fthlg_trs_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_spec_block',count(*) from staging2.fthlg_trs_spec_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_trailer_block',count(*) from staging2.fthlg_trs_trailer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_cage_wheel_block',count(*) from staging2.ftwet_sum_cage_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_comments_by_block',count(*) from staging2.ftwet_sum_comments_by_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_implement_block',count(*) from staging2.ftwet_sum_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_test_condition_block',count(*) from staging2.ftwet_sum_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_trac_h1_block',count(*) from staging2.ftwet_sum_trac_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_engine_rpm_block',count(*) from staging2.ftwet_trs_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_h1_block',count(*) from staging2.ftwet_trs_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_implement_block',count(*) from staging2.ftwet_trs_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_spec_block',count(*) from staging2.ftwet_trs_spec_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_footer_block',count(*) from staging2.ihtbt30_bt30_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_h1_block',count(*) from staging2.ihtbt30_bt30_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_condition_block',count(*) from staging2.ihtbt30_bt30_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_1_block',count(*) from staging2.ihtbt30_bt30_test_res_1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_2_block',count(*) from staging2.ihtbt30_bt30_test_res_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_3_block',count(*) from staging2.ihtbt30_bt30_test_res_3_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_4_block',count(*) from staging2.ihtbt30_bt30_test_res_4_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_tyre_details_block',count(*) from staging2.ihtbt30_bt30_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_weight_block',count(*) from staging2.ihtbt30_bt30_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_footer_block',count(*) from staging2.ihtbt50_bt50_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_h1_block',count(*) from staging2.ihtbt50_bt50_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_condition_block',count(*) from staging2.ihtbt50_bt50_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_1_block',count(*) from staging2.ihtbt50_bt50_test_res_1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_2_block',count(*) from staging2.ihtbt50_bt50_test_res_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_3_block',count(*) from staging2.ihtbt50_bt50_test_res_3_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_4_block',count(*) from staging2.ihtbt50_bt50_test_res_4_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_tyre_details_block',count(*) from staging2.ihtbt50_bt50_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_weight_block',count(*) from staging2.ihtbt50_bt50_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_footer_block',count(*) from staging2.ihtbtd_btd_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_h1_block',count(*) from staging2.ihtbtd_btd_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_condition_block',count(*) from staging2.ihtbtd_btd_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_1_block',count(*) from staging2.ihtbtd_btd_test_res_1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_2_block',count(*) from staging2.ihtbtd_btd_test_res_2_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_3_block',count(*) from staging2.ihtbtd_btd_test_res_3_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_4_block',count(*) from staging2.ihtbtd_btd_test_res_4_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_5_block',count(*) from staging2.ihtbtd_btd_test_res_5_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_6_block',count(*) from staging2.ihtbtd_btd_test_res_6_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_tyre_details_block',count(*) from staging2.ihtbtd_btd_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_weight_block',count(*) from staging2.ihtbtd_btd_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_footer_block',count(*) from staging2.ihtcgm_cgm_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_h1_block',count(*) from staging2.ihtcgm_cgm_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_lifting_block',count(*) from staging2.ihtcgm_cgm_lifting_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_results_block',count(*) from staging2.ihtcgm_cgm_results_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_tyre_details_block',count(*) from staging2.ihtcgm_cgm_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_weight_block',count(*) from staging2.ihtcgm_cgm_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_wheel_block',count(*) from staging2.ihtcgm_cgm_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_brake_pedal_block',count(*) from staging2.ihtemt_emt_brake_pedal_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_footer_block',count(*) from staging2.ihtemt_emt_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_h1_block',count(*) from staging2.ihtemt_emt_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_pedal_block',count(*) from staging2.ihtemt_emt_pedal_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_steering_block',count(*) from staging2.ihtemt_emt_steering_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_tyre_details_block',count(*) from staging2.ihtemt_emt_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_weight_block',count(*) from staging2.ihtemt_emt_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_wheel_block',count(*) from staging2.ihtemt_emt_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtemt_std_raw_data_block',count(*) from staging2.ihtemt_std_raw_data_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_atmos_cond_block',count(*) from staging2.ihtham_ham_atmos_cond_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_drawbar_block',count(*) from staging2.ihtham_ham_drawbar_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_engine_rpm_block',count(*) from staging2.ihtham_ham_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_footer_block',count(*) from staging2.ihtham_ham_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_h1_block',count(*) from staging2.ihtham_ham_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_results_block',count(*) from staging2.ihtham_ham_results_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_tractor_block',count(*) from staging2.ihtham_ham_tractor_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_tyre_details_block',count(*) from staging2.ihtham_ham_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_weight_block',count(*) from staging2.ihtham_ham_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_footer_block',count(*) from staging2.ihthls_hls_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_h1_block',count(*) from staging2.ihthls_hls_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_numeric_block',count(*) from staging2.ihthls_hls_numeric_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_tyre_details_block',count(*) from staging2.ihthls_hls_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_weight_block',count(*) from staging2.ihthls_hls_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_wheel_block',count(*) from staging2.ihthls_hls_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_atmos_cond_block',count(*) from staging2.ihtnst_nst_atmos_cond_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_engine_rpm_block',count(*) from staging2.ihtnst_nst_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_footer_block',count(*) from staging2.ihtnst_nst_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_h1_block',count(*) from staging2.ihtnst_nst_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_oel_noise_block',count(*) from staging2.ihtnst_nst_oel_noise_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_oel_noise_load_block',count(*) from staging2.ihtnst_nst_oel_noise_load_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_stand_noise_block',count(*) from staging2.ihtnst_nst_stand_noise_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_tyre_details_block',count(*) from staging2.ihtnst_nst_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_weight_block',count(*) from staging2.ihtnst_nst_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_footer_block',count(*) from staging2.ihtsll_sll_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_forward_block',count(*) from staging2.ihtsll_sll_forward_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_h1_block',count(*) from staging2.ihtsll_sll_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_lead_lag_block',count(*) from staging2.ihtsll_sll_lead_lag_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_reverse_block',count(*) from staging2.ihtsll_sll_reverse_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_tyre_details_block',count(*) from staging2.ihtsll_sll_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_weight_block',count(*) from staging2.ihtsll_sll_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_wheel_block',count(*) from staging2.ihtsll_sll_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_gvg_performance_governing_trails_block',count(*) from staging2.ptoben_gvg_performance_governing_trails_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_mpm_performance_boost_natural_block',count(*) from staging2.ptoben_mpm_performance_boost_natural_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_2hrs_max_power_natural_ambient_block',count(*) from staging2.ptoben_prf_2hrs_max_power_natural_ambient_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_2hrs_max_power_test_high_ambient_block',count(*) from staging2.ptoben_prf_2hrs_max_power_test_high_ambient_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_engine_oil_consumption_block',count(*) from staging2.ptoben_prf_engine_oil_consumption_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_key_performance_parameters_block',count(*) from staging2.ptoben_prf_key_performance_parameters_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_smoke_test_block',count(*) from staging2.ptoben_prf_smoke_test_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_tractor_specs_block',count(*) from staging2.ptoben_prf_tractor_specs_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_load_rated_rpm_block',count(*) from staging2.ptoben_prf_varying_load_rated_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_load_std_pto_block',count(*) from staging2.ptoben_prf_varying_load_std_pto_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_speed_natural_ambient_block',count(*) from staging2.ptoben_prf_varying_speed_natural_ambient_block where create_time::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_speed_test_high_ambient_block',count(*) from staging2.ptoben_prf_varying_speed_test_high_ambient_block where create_time::date =p_date;
|
||||
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_air_cleaner_perf_results',count(*) from transactional.budni_air_cleaner_perf_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_brake_perf_parking_brake_test_results',count(*) from transactional.budni_brake_perf_parking_brake_test_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_brake_perf_service_brake_test_results',count(*) from transactional.budni_brake_perf_service_brake_test_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_centre_of_gravity_location',count(*) from transactional.budni_centre_of_gravity_location where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_drawbar_perf_results',count(*) from transactional.budni_drawbar_perf_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_field_perf_results',count(*) from transactional.budni_field_perf_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_haulage_perf_results',count(*) from transactional.budni_haulage_perf_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_hydraulic_lifting_capacity_test_results',count(*) from transactional.budni_hydraulic_lifting_capacity_test_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_hydraulic_maint_of_lift_load_results',count(*) from transactional.budni_hydraulic_maint_of_lift_load_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_hydraulic_power_test_results',count(*) from transactional.budni_hydraulic_power_test_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_noise_atmospheric_conditions',count(*) from transactional.budni_noise_atmospheric_conditions where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_noise_measurement_results',count(*) from transactional.budni_noise_measurement_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_pto_perf_results_details',count(*) from transactional.budni_pto_perf_results_details where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_pto_perf_results_summary',count(*) from transactional.budni_pto_perf_results_summary where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_test_observations',count(*) from transactional.budni_test_observations where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','budni_vibration_measurement',count(*) from transactional.budni_vibration_measurement where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','drawbar_perf_observations',count(*) from transactional.drawbar_perf_observations where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','drawbar_perf_oecd_results',count(*) from transactional.drawbar_perf_oecd_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','drawbar_perf_results',count(*) from transactional.drawbar_perf_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','drawbar_perf_results_summary',count(*) from transactional.drawbar_perf_results_summary where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','field_perf_summary',count(*) from transactional.field_perf_summary where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','field_perf_summary_implement_info',count(*) from transactional.field_perf_summary_implement_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','field_perf_summary_tractor_info',count(*) from transactional.field_perf_summary_tractor_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','field_perf_summary_trailer_info',count(*) from transactional.field_perf_summary_trailer_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_brake_pedal_effort',count(*) from transactional.iht_brake_pedal_effort where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_brake_perf_test_condition',count(*) from transactional.iht_brake_perf_test_condition where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_brake_perf_test_results',count(*) from transactional.iht_brake_perf_test_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_cgm_lifting_angle_load_details',count(*) from transactional.iht_cgm_lifting_angle_load_details where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_cgm_results',count(*) from transactional.iht_cgm_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_clutch_pedal_effort',count(*) from transactional.iht_clutch_pedal_effort where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_gear_effort',count(*) from transactional.iht_gear_effort where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_gear_max_speed',count(*) from transactional.iht_gear_max_speed where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_hot_air_mapping_results',count(*) from transactional.iht_hot_air_mapping_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_hyd_lift_sensitivity',count(*) from transactional.iht_hyd_lift_sensitivity where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_noise_measurement_results',count(*) from transactional.iht_noise_measurement_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_noise_measurement_test',count(*) from transactional.iht_noise_measurement_test where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_pedal_effort',count(*) from transactional.iht_pedal_effort where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_speed_lead_lag_measurement',count(*) from transactional.iht_speed_lead_lag_measurement where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_steering_effort',count(*) from transactional.iht_steering_effort where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','iht_steering_effort_raw_data',count(*) from transactional.iht_steering_effort_raw_data where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','pto_engine_oil_consumption',count(*) from transactional.pto_engine_oil_consumption where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','pto_key_perf_parameters',count(*) from transactional.pto_key_perf_parameters where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','pto_multipoint_mapping',count(*) from transactional.pto_multipoint_mapping where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','pto_perf_governing_graph',count(*) from transactional.pto_perf_governing_graph where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','pto_perf_results',count(*) from transactional.pto_perf_results where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','pto_smoke_test',count(*) from transactional.pto_smoke_test where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance',count(*) from transactional.test_instance where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_atmospheric_info',count(*) from transactional.test_instance_atmospheric_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_drawbar_info',count(*) from transactional.test_instance_drawbar_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_engine_info',count(*) from transactional.test_instance_engine_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_equipment_info',count(*) from transactional.test_instance_equipment_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_fuel_lubricant_info',count(*) from transactional.test_instance_fuel_lubricant_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_gear_speed_chart',count(*) from transactional.test_instance_gear_speed_chart where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_images',count(*) from transactional.test_instance_images where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_implement_info',count(*) from transactional.test_instance_implement_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_measurement_uncertainty',count(*) from transactional.test_instance_measurement_uncertainty where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_tractor_info',count(*) from transactional.test_instance_tractor_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_tractor_info_misc',count(*) from transactional.test_instance_tractor_info_misc where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_trailer_info',count(*) from transactional.test_instance_trailer_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_tyre_info',count(*) from transactional.test_instance_tyre_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_weight_reaction',count(*) from transactional.test_instance_weight_reaction where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_instance_wheels_info',count(*) from transactional.test_instance_wheels_info where create_timestamp::date =p_date;
|
||||
insert into fw_core.run_validation_count(schema_name,table_name,row_count) select 'transactional','test_lab_location_master',count(*) from transactional.test_lab_location_master where create_timestamp::date =p_date;
|
||||
end
|
||||
$function$
|
||||
|
||||
74
MMT_latest_version/sql/old/fn_validation_syspk_count_bak.sql
Normal file
74
MMT_latest_version/sql/old/fn_validation_syspk_count_bak.sql
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
drop function if exists fw_core.fn_validation_syspk_count;
|
||||
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_validation_syspk_count(p_date date)
|
||||
RETURNS void AS $$
|
||||
begin
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_brake_perf_parking_brake_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_brake_perf_parking_brake_test_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_brake_perf_service_brake_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_brake_perf_service_brake_test_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_centre_of_gravity_location',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_centre_of_gravity_location where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_drawbar_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_drawbar_perf_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_field_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_field_perf_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_haulage_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_haulage_perf_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_hydraulic_lifting_capacity_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_hydraulic_lifting_capacity_test_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_hydraulic_maint_of_lift_load_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_hydraulic_maint_of_lift_load_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_hydraulic_power_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_hydraulic_power_test_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_noise_atmospheric_conditions',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_noise_atmospheric_conditions where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_noise_measurement_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_noise_measurement_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_pto_perf_results_details',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_pto_perf_results_details where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_pto_perf_results_summary',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_pto_perf_results_summary where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_test_observations',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_test_observations where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'budni_vibration_measurement',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.budni_vibration_measurement where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'drawbar_perf_observations',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.drawbar_perf_observations where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'drawbar_perf_oecd_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.drawbar_perf_oecd_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'drawbar_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.drawbar_perf_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'drawbar_perf_results_summary',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.drawbar_perf_results_summary where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'field_perf_summary',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.field_perf_summary where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'field_perf_summary_implement_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.field_perf_summary_implement_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'field_perf_summary_tractor_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.field_perf_summary_tractor_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'field_perf_summary_trailer_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.field_perf_summary_trailer_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_brake_pedal_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_brake_pedal_effort where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_brake_perf_test_condition',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_brake_perf_test_condition where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_brake_perf_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_brake_perf_test_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_cgm_lifting_angle_load_details',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_cgm_lifting_angle_load_details where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_cgm_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_cgm_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_clutch_pedal_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_clutch_pedal_effort where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_gear_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_gear_effort where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_gear_max_speed',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_gear_max_speed where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_hot_air_mapping_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_hot_air_mapping_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_hyd_lift_sensitivity',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_hyd_lift_sensitivity where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_noise_measurement_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_noise_measurement_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_noise_measurement_test',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_noise_measurement_test where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_pedal_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_pedal_effort where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_speed_lead_lag_measurement',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_speed_lead_lag_measurement where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_steering_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_steering_effort where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'iht_steering_effort_raw_data',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.iht_steering_effort_raw_data where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'pto_engine_oil_consumption',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.pto_engine_oil_consumption where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'pto_key_perf_parameters',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.pto_key_perf_parameters where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'pto_multipoint_mapping',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.pto_multipoint_mapping where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'pto_perf_governing_graph',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.pto_perf_governing_graph where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'pto_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.pto_perf_results where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'pto_smoke_test',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.pto_smoke_test where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_atmospheric_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_atmospheric_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_drawbar_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_drawbar_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_engine_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_engine_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_equipment_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_equipment_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_fuel_lubricant_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_fuel_lubricant_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_gear_speed_chart',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_gear_speed_chart where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_images',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_images where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_implement_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_implement_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_measurement_uncertainty',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_measurement_uncertainty where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_tractor_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_tractor_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_tractor_info_misc',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_tractor_info_misc where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_trailer_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_trailer_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_tyre_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_tyre_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_weight_reaction',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_weight_reaction where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
insert into fw_core.run_validation_syspk_count(table_name,file_syspk,file_mnemonic,file_sheet_mnemonic,count) select 'test_instance_wheels_info',file_syspk,file_mnemonic,file_sheet_mnemonic,count(*) from transactional.test_instance_wheels_info where create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic;
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
|
||||
--select fw_core.fn_validation_syspk_count('2021-05-31')
|
||||
|
||||
|
||||
269
MMT_latest_version/sql/old/master_wrapper.sql
Normal file
269
MMT_latest_version/sql/old/master_wrapper.sql
Normal file
@@ -0,0 +1,269 @@
|
||||
drop function if exists staging2.run_master_wrapper;
|
||||
CREATE OR REPLACE FUNCTION staging2.run_master_wrapper()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
stg2_status text;
|
||||
error_sum int;
|
||||
err_file_syspk int;
|
||||
TRX_status text;
|
||||
begin
|
||||
for f in select distinct file_syspk,file_mnemonic,file_sheet_mnemonic,client_id,function_id
|
||||
from fw_core.fw_jobctl_file_sheet_runschedule where file_sheet_mnemonic !=''
|
||||
and latest_run_schedule_flag = 1 and end_status != 'error' and end_status_note = 'stg1_completed'--and file_mnemonic not in ('DBOECD','IHTSLL','IHT')
|
||||
order by file_syspk
|
||||
loop
|
||||
|
||||
if err_file_syspk = f.file_syspk then
|
||||
--incase of file stg2/trx fail then dont run script for those files and rollback previous change if any.
|
||||
--rollback for that file syspk needs to be added
|
||||
continue;
|
||||
else
|
||||
--run staging 2 scripts depending on sheet mnemonic
|
||||
if f.file_sheet_mnemonic = 'FTDRY_TRS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTDRY_TRS_Block('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTDRY_SUM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTDRY_SUM_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTWET_TRS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_ftwet_trs_block('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTWET_SUM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTWET_SUM_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTHLG_TRS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTHLG_TRS_Block('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTHLG_SUM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTHLG_SUM_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'DBSTD_TEST' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_dbstd_test_block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'DBOECD_TEST' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_dboecd_test_block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic in ('PTOBEN_PRFN','PTOBEN_PRFE','PTOBEN_PRFB','PTOSTD_PRF') then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_PTO_PRF_block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic in ('PTOBEN_MPM','PTOSTD_MPM') then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_PTO_MPM_block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic in ('PTOBEN_GVG','PTOSTD_GVG') then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_PTO_GVG_block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_BRK' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_BRK_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_FLD' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_FLD_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_HDL' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HDL_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_NMT' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_NMT_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_HLG' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HLG_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_PTO' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_PTO_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_VMT' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_VMT_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_ARC' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_ARC_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_DBP' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_DBP_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_LCG' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_LCG_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTCGM_CGM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTCGM_CGM_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTEMT_STD' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTEMT_STD_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTEMT_EMT' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTEMT_EMT_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTHAM_HAM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTHAM_HAM_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTHLS_HLS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTHLS_HLS_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTNST_NST' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTNST_NST_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTSLL_SLL' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTSLL_SLL_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTBT30_BT30' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTBT30_BT30_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTBT50_BT50' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTBT50_BT50_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTBTD_BTD' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTBTD_BTD_Block ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''||f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
else perform fw_core.fn_insert_db_error ( f.function_id, f.function_id, 1001, 'Compegence', f.file_syspk ,f.file_mnemonic,f.file_sheet_mnemonic ,null,'stg2 wrapper', 'unknown block', null, 'no script found', 'Script not present for the particlar sheet mnemonic', null, null,'error');
|
||||
end if;
|
||||
-- check if staging 2 script ran correctly and update fw_jobctl_file_sheet_runschedule table.
|
||||
select e.status from fw_core.db_run_status e where file_syspk = f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic and staging_type = 'stg2' order by error_timestamp desc into stg2_status;
|
||||
if stg2_status = 'success' then
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg2_completed', end_status='success',staging_type = 'stg2',end_time = (select e.error_timestamp from fw_core.db_run_status e where e.file_syspk=f.file_syspk and e.file_sheet_mnemonic =f.file_sheet_mnemonic and e.staging_type = 'stg2' order by e.error_timestamp desc limit 1)
|
||||
where file_syspk=f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic;
|
||||
else
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg2_failed', end_status='error',staging_type = 'stg2',end_time = (select e.error_timestamp from fw_core.db_run_status e where e.file_syspk=f.file_syspk and e.file_sheet_mnemonic =f.file_sheet_mnemonic and e.staging_type = 'stg2' order by e.error_timestamp desc limit 1)
|
||||
, error_description = (select e.error_detail from fw_core.db_run_status e where e.file_syspk=f.file_syspk and e.file_sheet_mnemonic =f.file_sheet_mnemonic and e.staging_type = 'stg2' order by e.error_timestamp desc limit 1)
|
||||
where file_syspk=f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic;
|
||||
--if error occured store in err_file_syspk variable and go to next file in loop
|
||||
err_file_syspk := f.file_syspk;
|
||||
continue;
|
||||
end if;
|
||||
|
||||
|
||||
--run transactional scripts depending on sheet mnemonic
|
||||
if f.file_sheet_mnemonic = 'FTDRY_TRS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTDRY_TRS_TRX('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTDRY_SUM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTDRY_SUM_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTWET_TRS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_ftwet_trs_TRX('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTWET_SUM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTWET_SUM_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTHLG_TRS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTHLG_TRS_TRX('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'FTHLG_SUM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_FTHLG_SUM_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'DBSTD_TEST' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_dbstd_test_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'DBOECD_TEST' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_dboecd_test_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic in ('PTOBEN_PRFN','PTOBEN_PRFE','PTOBEN_PRFB','PTOSTD_PRF') then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_PTO_PRF_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic in ('PTOBEN_MPM','PTOSTD_MPM') then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_PTO_MPM_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic in ('PTOBEN_GVG','PTOSTD_GVG') then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_PTO_GVG_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_BRK' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_BRK_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_FLD' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_FLD_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_HDL' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HDL_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_NMT' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_NMT_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_HLG' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_HLG_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_PTO' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_PTO_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_VMT' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_VMT_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_ARC' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_ARC_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_DBP' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_DBP_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'BUDNI_LCG' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_BUDNI_LCG_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTCGM_CGM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTCGM_CGM_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTEMT_STD' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTEMT_STD_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTEMT_EMT' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTEMT_EMT_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTHAM_HAM' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTHAM_HAM_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTHLS_HLS' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTHLS_HLS_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTNST_NST' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTNST_NST_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTSLL_SLL' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTSLL_SLL_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTBT30_BT30' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTBT30_BT30_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTBT50_BT50' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTBT50_BT50_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
elsif f.file_sheet_mnemonic = 'IHTBTD_BTD' then
|
||||
perform fw_core.fn_get_function_exception('staging2.fn_IHTBTD_BTD_TRX ('||f.client_id||','||f.function_id||','''||f.file_mnemonic||''','''|| f.file_sheet_mnemonic||''','||f.file_syspk||')');
|
||||
else perform fw_core.fn_insert_db_error ( f.function_id, f.function_id, 1001, 'Compegence', f.file_syspk ,f.file_mnemonic, f.file_sheet_mnemonic ,null,'TRX wrapper', 'unknown TRX', null, 'no script found', null, null, null,'error');
|
||||
end if;
|
||||
-- check if transactional script ran correctly and update fw_jobctl_file_sheet_runschedule table.
|
||||
select e.status from fw_core.db_run_status e where file_syspk = f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic and staging_type = 'trx' order by error_timestamp desc into TRX_status;
|
||||
if TRX_status = 'success' then
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'TRX_completed', end_status='success',staging_type = 'trx',end_time = (select e.error_timestamp from fw_core.db_run_status e where e.file_syspk=f.file_syspk and e.file_sheet_mnemonic =f.file_sheet_mnemonic and e.staging_type = 'trx' order by e.error_timestamp desc limit 1)
|
||||
where file_syspk=f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic;
|
||||
else
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'TRX_failed', end_status='error',staging_type = 'trx',end_time = (select e.error_timestamp from fw_core.db_run_status e where e.file_syspk=f.file_syspk and e.file_sheet_mnemonic =f.file_sheet_mnemonic and e.staging_type = 'trx' order by e.error_timestamp desc limit 1)
|
||||
, error_description = (select e.error_detail from fw_core.db_run_status e where e.file_syspk=f.file_syspk and e.file_sheet_mnemonic =f.file_sheet_mnemonic and e.staging_type = 'trx' order by e.error_timestamp desc limit 1)
|
||||
where file_syspk=f.file_syspk and file_sheet_mnemonic =f.file_sheet_mnemonic;
|
||||
--if error occured store in err_file_syspk variable and go to next file in loop
|
||||
err_file_syspk := f.file_syspk;
|
||||
continue;
|
||||
end if;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
-- update fw_jobctl_file_runschedule table.
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status_note = 'stg2_failed', end_status='error',staging_type = 'stg2' from fw_core.fw_jobctl_file_sheet_runschedule a
|
||||
where a.latest_run_schedule_flag = 1 and a.end_status = 'error' and a.end_status_note = 'stg2_failed' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk;
|
||||
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status_note = 'TRX_failed', end_status='error',staging_type = 'trx' from fw_core.fw_jobctl_file_sheet_runschedule a
|
||||
where a.latest_run_schedule_flag = 1 and a.end_status = 'error' and a.end_status_note = 'TRX_failed' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk;
|
||||
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status_note = 'TRX_completed', end_status='success',staging_type = 'trx' from fw_core.fw_jobctl_file_sheet_runschedule a
|
||||
where a.latest_run_schedule_flag = 1 and a.end_status = 'success' and a.end_status_note ='TRX_completed' and fw_core.fw_jobctl_file_runschedule.end_status !='error' and fw_core.fw_jobctl_file_runschedule.file_syspk = a.file_syspk;
|
||||
|
||||
-- update fw_jobctl_runschedule_jobstep table.
|
||||
SELECT SUM (case WHEN end_status = 'success' THEN 0
|
||||
ELSE 1 END) AS "Error Sum" FROM fw_core.fw_jobctl_file_runschedule where latest_run_schedule_flag = 1 INTO error_sum;
|
||||
if error_sum = 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'run_completed', end_status='success' where latest_run_schedule_flag = true and job_name = 'master load';
|
||||
else
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'run_failed', end_status='error' where latest_run_schedule_flag = true and job_name = 'master load';
|
||||
end if;
|
||||
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
|
||||
|
||||
select staging2.run_master_wrapper()
|
||||
|
||||
--update after each run
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status_note = 'stg1_completed';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg1_completed';
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status='success';
|
||||
update fw_core.fw_jobctl_file_runschedule set staging_type = 'staging1';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set staging_type = 'staging1';
|
||||
update fw_core.fw_jobctl_file_runschedule set latest_run_schedule_flag = 1;
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_syspk_error_flag='success';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status='success';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set latest_run_schedule_flag = 1;
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_syspk_error_flag = 'success';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set error_description = null;
|
||||
|
||||
-- changing file sheet mnemonic
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTNST_NST' where file_sheet_mnemonic = 'IHT_NST';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTSLL_SLL' where file_sheet_mnemonic = 'IHT_SLL';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTHAM_HAM' where file_sheet_mnemonic = 'IHT_HAM';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTBRT_BRT' where file_sheet_mnemonic = 'IHT_BRT';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTEMT_EMT' where file_sheet_mnemonic = 'IHT_EMT';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTHLS_HLS' where file_sheet_mnemonic = 'IHT_HLS';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_sheet_mnemonic = 'IHTCGM_CGM' where file_sheet_mnemonic = 'IHT_CGM';
|
||||
|
||||
|
||||
|
||||
--sheet_runshedule
|
||||
ALTER TABLE fw_core.fw_jobctl_file_sheet_runschedule
|
||||
RENAME COLUMN latest_flag TO latest_run_schedule_flag;
|
||||
alter table fw_core.fw_jobctl_file_sheet_runschedule add column end_status text;
|
||||
alter table fw_core.fw_jobctl_file_sheet_runschedule add column error_description text;
|
||||
alter table fw_core.fw_jobctl_file_sheet_runschedule add column file_syspk_error_flag text;
|
||||
alter table fw_core.fw_jobctl_file_sheet_runschedule add column latest_flag int;
|
||||
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_syspk_error_flag='success';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status='success';
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set latest_run_schedule_flag = 1;
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set file_syspk_error_flag = 'success';
|
||||
|
||||
--file_runshedule
|
||||
ALTER TABLE fw_core.fw_jobctl_file_runschedule
|
||||
RENAME COLUMN latest_flag TO latest_run_schedule_flag;
|
||||
alter table fw_core.fw_jobctl_file_runschedule add column end_status text;
|
||||
alter table fw_core.fw_jobctl_file_runschedule add column latest_flag int;
|
||||
|
||||
update fw_core.fw_jobctl_file_runschedule set end_status='success';
|
||||
update fw_core.fw_jobctl_file_runschedule set latest_run_schedule_flag = 1;
|
||||
|
||||
|
||||
--jobstep
|
||||
ALTER TABLE fw_core.fw_jobctl_runschedule_jobstep
|
||||
RENAME COLUMN latest_flag TO latest_run_schedule_flag;
|
||||
alter table fw_core.fw_jobctl_runschedule_jobstep add column end_status text;
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set latest_run_schedule_flag = true;
|
||||
|
||||
insert into fw_core.fw_jobctl_runschedule_jobstep (client_id,function_id,job_name,step_name,end_status,
|
||||
run_schedule_date,run_frequency,job_id,step_id,job_step_run_dependency_seuqence,data_from_date,
|
||||
data_to_date,job_script,job_function_name)
|
||||
values (20,1,'master load','run_master_wrapper','success','31-May-21',1,1,1,1,'31-May-21','31-May-21','','');
|
||||
delete from fw_core.fw_jobctl_runschedule_jobstep
|
||||
|
||||
--update trx in staging_type in file_sheet and file_runshedule
|
||||
--change run_success to trx_success
|
||||
98
MMT_latest_version/sql/old/odscount.sql
Normal file
98
MMT_latest_version/sql/old/odscount.sql
Normal file
@@ -0,0 +1,98 @@
|
||||
select 'budni_air_cleaner_perf_results',count(*) from transactional.budni_air_cleaner_perf_results;
|
||||
select 'budni_brake_perf_parking_brake_test_results',count(*) from transactional.budni_brake_perf_parking_brake_test_results;
|
||||
select 'budni_brake_perf_service_brake_test_results',count(*) from transactional.budni_brake_perf_service_brake_test_results;
|
||||
select 'budni_centre_of_gravity_location',count(*) from transactional.budni_centre_of_gravity_location;
|
||||
select 'budni_drawbar_perf_results',count(*) from transactional.budni_drawbar_perf_results;
|
||||
select 'budni_field_perf_results',count(*) from transactional.budni_field_perf_results;
|
||||
select 'budni_haulage_perf_results',count(*) from transactional.budni_haulage_perf_results;
|
||||
select 'budni_hydraulic_lifting_capacity_test_results',count(*) from transactional.budni_hydraulic_lifting_capacity_test_results;
|
||||
select 'budni_hydraulic_maint_of_lift_load_results',count(*) from transactional.budni_hydraulic_maint_of_lift_load_results;
|
||||
select 'budni_hydraulic_power_test_results',count(*) from transactional.budni_hydraulic_power_test_results;
|
||||
select 'budni_noise_atmospheric_conditions',count(*) from transactional.budni_noise_atmospheric_conditions;
|
||||
select 'budni_noise_measurement_results',count(*) from transactional.budni_noise_measurement_results;
|
||||
select 'budni_pto_perf_results_details',count(*) from transactional.budni_pto_perf_results_details;
|
||||
select 'budni_pto_perf_results_summary',count(*) from transactional.budni_pto_perf_results_summary;
|
||||
select 'budni_test_observations',count(*) from transactional.budni_test_observations;
|
||||
select 'budni_vibration_measurement',count(*) from transactional.budni_vibration_measurement;
|
||||
select 'drawbar_perf_noise_measurement_results',count(*) from transactional.drawbar_perf_noise_measurement_results;
|
||||
select 'drawbar_perf_observations',count(*) from transactional.drawbar_perf_observations;
|
||||
select 'drawbar_perf_oecd_results',count(*) from transactional.drawbar_perf_oecd_results;
|
||||
select 'drawbar_perf_results',count(*) from transactional.drawbar_perf_results;
|
||||
select 'drawbar_perf_results_summary',count(*) from transactional.drawbar_perf_results_summary;
|
||||
select 'field_perf_summary',count(*) from transactional.field_perf_summary;
|
||||
select 'field_perf_summary_implement_info',count(*) from transactional.field_perf_summary_implement_info;
|
||||
select 'field_perf_summary_soil_info',count(*) from transactional.field_perf_summary_soil_info;
|
||||
select 'field_perf_summary_tractor_info',count(*) from transactional.field_perf_summary_tractor_info;
|
||||
select 'field_perf_summary_trailer_info',count(*) from transactional.field_perf_summary_trailer_info;
|
||||
select 'trx',count(*) from transactional.trx;
|
||||
select 'trx_detailed',count(*) from transactional.trx_detailed;
|
||||
select 'trx_field',count(*) from transactional.trx_field;
|
||||
select 'trx_field_sh',count(*) from transactional.trx_field_sh;
|
||||
select 'trx_mm',count(*) from transactional.trx_mm;
|
||||
select 'trx_monthly_mmt',count(*) from transactional.trx_monthly_mmt;
|
||||
select 'trx_pto',count(*) from transactional.trx_pto;
|
||||
select 'trx_s',count(*) from transactional.trx_s;
|
||||
select 'trx_sh',count(*) from transactional.trx_sh;
|
||||
select 'iht_brake_pedal_effort',count(*) from transactional.iht_brake_pedal_effort;
|
||||
select 'iht_brake_perf_test_condition',count(*) from transactional.iht_brake_perf_test_condition;
|
||||
select 'iht_brake_perf_test_results',count(*) from transactional.iht_brake_perf_test_results;
|
||||
select 'iht_cgm_lifting_angle_load_details',count(*) from transactional.iht_cgm_lifting_angle_load_details;
|
||||
select 'iht_cgm_results',count(*) from transactional.iht_cgm_results;
|
||||
select 'iht_clutch_pedal_effort',count(*) from transactional.iht_clutch_pedal_effort;
|
||||
select 'iht_gear_effort',count(*) from transactional.iht_gear_effort;
|
||||
select 'iht_gear_max_speed',count(*) from transactional.iht_gear_max_speed;
|
||||
select 'iht_hot_air_mapping_results',count(*) from transactional.iht_hot_air_mapping_results;
|
||||
select 'iht_hyd_lift_sensitivity',count(*) from transactional.iht_hyd_lift_sensitivity;
|
||||
select 'iht_noise_measurement_results',count(*) from transactional.iht_noise_measurement_results;
|
||||
select 'iht_noise_measurement_test',count(*) from transactional.iht_noise_measurement_test;
|
||||
select 'iht_pedal_effort',count(*) from transactional.iht_pedal_effort;
|
||||
select 'iht_speed_lead_lag_measurement',count(*) from transactional.iht_speed_lead_lag_measurement;
|
||||
select 'iht_steering_effort',count(*) from transactional.iht_steering_effort;
|
||||
select 'iht_steering_effort_raw_data',count(*) from transactional.iht_steering_effort_raw_data;
|
||||
select 'master_table',count(*) from transactional.master_table;
|
||||
select 'mmt_column_dq',count(*) from transactional.mmt_column_dq;
|
||||
select 'source_config',count(*) from transactional.source_config;
|
||||
select 'mmt_file_sheet_format_master',count(*) from transactional.mmt_file_sheet_format_master;
|
||||
select 'pto_engine_oil_consumption',count(*) from transactional.pto_engine_oil_consumption;
|
||||
select 'pto_key_perf_parameters',count(*) from transactional.pto_key_perf_parameters;
|
||||
select 'pto_multipoint_mapping',count(*) from transactional.pto_multipoint_mapping;
|
||||
select 'pto_perf_governing_graph',count(*) from transactional.pto_perf_governing_graph;
|
||||
select 'pto_perf_results',count(*) from transactional.pto_perf_results;
|
||||
select 'pto_smoke_test',count(*) from transactional.pto_smoke_test;
|
||||
select 'test_data_file_master',count(*) from transactional.test_data_file_master;
|
||||
select 'test_instance',count(*) from transactional.test_instance;
|
||||
select 'test_instance_atmospheric_info',count(*) from transactional.test_instance_atmospheric_info;
|
||||
select 'test_instance_drawbar_info',count(*) from transactional.test_instance_drawbar_info;
|
||||
select 'test_instance_engine_info',count(*) from transactional.test_instance_engine_info;
|
||||
select 'test_instance_equipment_info',count(*) from transactional.test_instance_equipment_info;
|
||||
select 'test_instance_fuel_lubricant_info',count(*) from transactional.test_instance_fuel_lubricant_info;
|
||||
select 'test_instance_gear_speed_chart',count(*) from transactional.test_instance_gear_speed_chart;
|
||||
select 'test_instance_images',count(*) from transactional.test_instance_images;
|
||||
select 'test_instance_implement_info',count(*) from transactional.test_instance_implement_info;
|
||||
select 'test_instance_measurement_uncertainty',count(*) from transactional.test_instance_measurement_uncertainty;
|
||||
select 'test_instance_tractor_info',count(*) from transactional.test_instance_tractor_info;
|
||||
select 'test_instance_tractor_info_misc',count(*) from transactional.test_instance_tractor_info_misc;
|
||||
select 'test_instance_trailer_info',count(*) from transactional.test_instance_trailer_info;
|
||||
select 'test_instance_tyre_info',count(*) from transactional.test_instance_tyre_info;
|
||||
select 'test_instance_weight_reaction',count(*) from transactional.test_instance_weight_reaction;
|
||||
select 'test_instance_wheels_info',count(*) from transactional.test_instance_wheels_info;
|
||||
select 'test_lab_location_master',count(*) from transactional.test_lab_location_master;
|
||||
select 'test_master',count(*) from transactional.test_master;
|
||||
select 'zbkp_field_perf_summary_mm_20210507',count(*) from transactional.zbkp_field_perf_summary_mm_20210507;
|
||||
select 'zbkp_ftdry',count(*) from transactional.zbkp_ftdry;
|
||||
select 'zbkp_fw_jobctl_file_runschedule_vignesh_2104',count(*) from transactional.zbkp_fw_jobctl_file_runschedule_vignesh_2104;
|
||||
select 'zbkp_fw_jobctrl_file_sheet_runschedule_vignesh_2104',count(*) from transactional.zbkp_fw_jobctrl_file_sheet_runschedule_vignesh_2104;
|
||||
select 'zbkp_mmt_file_sheet_format_master',count(*) from transactional.zbkp_mmt_file_sheet_format_master;
|
||||
select 'zbkp_mmt_file_sheet_format_master_mm_20210420',count(*) from transactional.zbkp_mmt_file_sheet_format_master_mm_20210420;
|
||||
select 'zbkp_pto_engine_oil_consumption_mm_20210421',count(*) from transactional.zbkp_pto_engine_oil_consumption_mm_20210421;
|
||||
select 'zbkp_pto_key_perf_parameters_mm_20210421',count(*) from transactional.zbkp_pto_key_perf_parameters_mm_20210421;
|
||||
select 'zbkp_pto_multipoint_mapping_mm_20210421',count(*) from transactional.zbkp_pto_multipoint_mapping_mm_20210421;
|
||||
select 'zbkp_pto_perf_governing_graph_mm_20210421',count(*) from transactional.zbkp_pto_perf_governing_graph_mm_20210421;
|
||||
select 'zbkp_pto_perf_report_details_mm_20210421_discarded',count(*) from transactional.zbkp_pto_perf_report_details_mm_20210421_discarded;
|
||||
select 'zbkp_pto_perf_report_summary_mm_20210421_discarded',count(*) from transactional.zbkp_pto_perf_report_summary_mm_20210421_discarded;
|
||||
select 'zbkp_pto_perf_results_mmm_20210421',count(*) from transactional.zbkp_pto_perf_results_mmm_20210421;
|
||||
select 'zbkp_pto_perf_test_observations_mm_20210421_discarded',count(*) from transactional.zbkp_pto_perf_test_observations_mm_20210421_discarded;
|
||||
select 'zbkp_pto_smoke_test_mm_20210421',count(*) from transactional.zbkp_pto_smoke_test_mm_20210421;
|
||||
select 'zbkp_test_data_file_master',count(*) from transactional.zbkp_test_data_file_master;
|
||||
select 'zbkp_test_data_file_master_mm_20210420',count(*) from transactional.zbkp_test_data_file_master_mm_20210420;
|
||||
select 'zbkp_test_instance_tractor_info_mm_20210415',count(*) from transactional.zbkp_test_instance_tractor_info_mm_20210415;
|
||||
87
MMT_latest_version/sql/old/run_master_wrapper.sh
Normal file
87
MMT_latest_version/sql/old/run_master_wrapper.sh
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
HOME="/home/compegence/customer"
|
||||
#Directories
|
||||
homeDir=$HOME/MMT
|
||||
configDir=$homeDir/conf
|
||||
input_file=$configDir/etl-config.txt
|
||||
declare -A credentials
|
||||
while IFS="=" read -r key value; do
|
||||
credentials[$key]=$value
|
||||
done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file )
|
||||
#for i in ${credentials[@]}; do echo ***$i; done
|
||||
|
||||
user=${credentials[user]}
|
||||
password=${credentials[password]}
|
||||
host=${credentials[host]}
|
||||
db=${credentials[db]}
|
||||
protocol=${credentials[protocol]}
|
||||
server=${credentials[server]}
|
||||
|
||||
postgres_con="psql -X -A -t postgresql://$user:$password@$host/$db"
|
||||
|
||||
echo "Checking Staging 1 Status"
|
||||
|
||||
cdate=$(date +'%Y-%m-%d')
|
||||
value_count=`$postgres_con -c "select count(*) from fw_core.fw_jobctl_runschedule where end_status='stg1-completed' and end_time::date = date'$cdate%';"`
|
||||
|
||||
if [ $value_count == 0 ]
|
||||
then
|
||||
echo "Staging 1 process incomplete"
|
||||
exit
|
||||
else
|
||||
|
||||
echo "Running FTDRY Wrapper"
|
||||
$postgres_con -c "select staging2.fn_FTDRY_RUN();"
|
||||
echo "Running FTHLG Wrapper"
|
||||
$postgres_con -c "select staging2.fn_FTHLG_RUN();"
|
||||
echo "Running FTWET Wrapper"
|
||||
$postgres_con -c "select staging2.fn_FTWET_RUN();"
|
||||
echo "Running Drawbar-DBSTD Wrapper"
|
||||
$postgres_con -c "select staging2.fn_DBSTD_RUN();"
|
||||
echo "Running Drawbar-DBOECD Wrapper"
|
||||
$postgres_con -c "select staging2.fn_DBOECD_RUN();"
|
||||
echo "Running PTO-PTOSTD Wrapper"
|
||||
$postgres_con -c "select staging2.fn_PTOSTD_RUN();"
|
||||
echo "Running PTO-PTOBEN Wrapper"
|
||||
$postgres_con -c "select staging2.fn_PTOBEN_RUN();"
|
||||
echo "Running Budni Wrapper"
|
||||
$postgres_con -c "select staging2.fn_BUDNI_RUN();"
|
||||
echo "Running IHT-IHTBT30 Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTBT30_RUN();"
|
||||
echo "Running IHT-IHTBT50 Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTBT50_RUN();"
|
||||
echo "Running IHT-IHTBT Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTBTD_RUN();"
|
||||
echo "Running IHT-IHTCGM Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTCGM_RUN();"
|
||||
echo "Running IHT-IHTEMT Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTEMT_RUN();"
|
||||
echo "Running IHT-IHTHAM Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTHAM_RUN();"
|
||||
echo "Running IHT-IHTHSL Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTHSL_RUN();"
|
||||
echo "Running IHT-IHTNST Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTNST_RUN();"
|
||||
echo "Running IHT-IHTSLL Wrapper"
|
||||
$postgres_con -c "select staging2.fn_IHTSLL_RUN();"
|
||||
echo "Running Archive wrapper"
|
||||
$postgres_con -c "select archive.fn_block_archive();"
|
||||
|
||||
$postgres_con -c "select transactional.fn_info_column_dq('transactional');"
|
||||
|
||||
$postgres_con -c "select fw_core.fn_check_model_count('$cdate%');"
|
||||
$postgres_con -c "select fw_core.fn_table_count ('$cdate%');"
|
||||
$postgres_con -c "select fw_core.fn_check_mnemonic_count('$cdate%');"
|
||||
|
||||
echo "Finished running"
|
||||
echo "please Check by executing below queries:"
|
||||
echo " select * from fw_core.db_run_status where error_timestamp::date = date'$cdate%' "
|
||||
echo " select * from fw_core.fw_jobctl_file_runschedule where run_schedule_date::date = date'$cdate%' "
|
||||
echo " select * from fw_core.fw_jobctl_file_sheet_runschedule where run_schedule_date::date = date'$cdate%'"
|
||||
echo " select * from fw_core.check_model_count where create_timestamp::date = date'$cdate%';"
|
||||
echo " select * from fw_core.check_mnemonic_count where create_time::date =date'$cdate%';"
|
||||
echo " select * from fw_core.check_table_stg_trx_count where create_time::date =date'$cdate%';"
|
||||
fi
|
||||
|
||||
# $postgres_con -c "select transactional_fn_computation();"
|
||||
65
MMT_latest_version/sql/old/run_onetime_individual.sh
Normal file
65
MMT_latest_version/sql/old/run_onetime_individual.sh
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash -e
|
||||
HOME="/home/jagadish"
|
||||
#Directories
|
||||
homeDir=$HOME/mmt
|
||||
configDir=$homeDir/conf
|
||||
input_file=$configDir/serverCredentials-postgres.txt
|
||||
declare -A credentials
|
||||
while IFS="=" read -r key value; do
|
||||
credentials[$key]=$value
|
||||
done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file )
|
||||
for i in ${credentials[@]}; do echo ***$i; done
|
||||
|
||||
trx_user=${credentials[trx_user]}
|
||||
trx_password=${credentials[trx_password]}
|
||||
trx_host=${credentials[trx_host]}
|
||||
trx_db=${credentials[trx_db]}
|
||||
trx_sch=${credentials[trx_sch]}
|
||||
trx_protocol=${credentials[trx_protocol]}
|
||||
trx_server=${credentials[trx_server]}
|
||||
staging2_user=${credentials[staging2_user]}
|
||||
staging2_password=${credentials[staging2_password]}
|
||||
staging2_host=${credentials[staging2_host]}
|
||||
staging2_db=${credentials[staging2_db]}
|
||||
staging2_sch=${credentials[staging2_sch]}
|
||||
staging2_protocol=${credentials[staging2_protocol]}
|
||||
staging2_server=${credentials[staging2_server]}
|
||||
|
||||
#satging path Dir
|
||||
path=$homeDir/onetime/createtables/staging
|
||||
path=$homeDir/onetime/dataloadfunctions/budni
|
||||
path=$homeDir/onetime/dataloadfunctions/Drawbar
|
||||
path=$homeDir/onetime/dataloadfunctions/IHT
|
||||
path=$homeDir/onetime/dataloadfunctions/field
|
||||
path=$homeDir/onetime/dataloadfunctions/PTO
|
||||
path=$homeDir/onetime/wrappers
|
||||
|
||||
#trx path Dir
|
||||
path=$homeDir/onetime/createtables/common
|
||||
path=$homeDir/onetime/createtables/control
|
||||
path=$homeDir/onetime/createtables/trx
|
||||
path=$homeDir/onetime/commonfunctions
|
||||
path=$homeDir/onetime/configentries
|
||||
|
||||
stgpostgres_con="psql -X -A -t postgresql://$staging2_user:$staging2_password@$staging2_host/$staging2_db?options=--search_path%3D$staging2_sch"
|
||||
trxpostgres_con="psql -X -A -t postgresql://$trx_user:$trx_password@$trx_host/$trx_db?options=--search_path%3D$trx_sch"
|
||||
|
||||
func_execute_conn(){
|
||||
local conn="$1"
|
||||
local -n param=$2
|
||||
for path in "${param[@]}"
|
||||
do
|
||||
for files in "$path"/*
|
||||
do
|
||||
$conn -f $files
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
#staging:
|
||||
declare -a stgpathvar=("$homeDir/onetime/createtables/staging")
|
||||
func_execute_conn "$stg_postgres_con" stgpathvar
|
||||
|
||||
#trx:
|
||||
#declare -a trxpathvar=("$homeDir/onetime/createtables/common" )
|
||||
#func_execute_conn "$trx_postgres_con" trxpathvar
|
||||
42
MMT_latest_version/sql/old/run_post_validation.sql
Normal file
42
MMT_latest_version/sql/old/run_post_validation.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
drop function if exists staging2.run_post_generic_validation;
|
||||
CREATE OR REPLACE FUNCTION staging2.run_post_generic_validation()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
trx_record_count int;
|
||||
begin
|
||||
for f in select distinct file_syspk from fw_core.fw_jobctl_file_runschedule
|
||||
where latest_run_schedule_flag = 1 and end_status != 'error' and end_status_note = 'stg1_completed'
|
||||
loop
|
||||
select count(*) from transactional.test_instance where file_syspk = f.file_syspk into trx_record_count;
|
||||
if trx_record_count > 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'generic_post_validation_failed', end_status='error';
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
select staging2.run_post_generic_validation()
|
||||
|
||||
|
||||
drop function if exists staging2.run_trx_post_validation;
|
||||
CREATE OR REPLACE FUNCTION staging2.run_trx_post_validation()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
trx_record_count int;
|
||||
begin
|
||||
for f in select distinct file_syspk from fw_core.fw_jobctl_file_runschedule
|
||||
where latest_run_schedule_flag = 1 and end_status != 'error' and end_status_note = 'trx_completed'
|
||||
loop
|
||||
select count(*) from transactional.test_instance where file_syspk = f.file_syspk into trx_record_count;
|
||||
if trx_record_count = 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'trx_post_validation_failed', end_status='error';
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
select staging2.run_trx_post_validation()
|
||||
25
MMT_latest_version/sql/old/testingconf.sh
Normal file
25
MMT_latest_version/sql/old/testingconf.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash -e
|
||||
HOME="/home/compegence/customer"
|
||||
#Directories
|
||||
homeDir=$HOME/MMT
|
||||
configDir=$homeDir/conf
|
||||
|
||||
openssl enc -aes-256-cbc -d -in $configDir/etl-config.dat > $configDir/etl-config.config -d -pass pass:$1
|
||||
|
||||
input_file=$configDir/etl-config.config
|
||||
declare -A credentials
|
||||
while IFS="=" read -r key value; do
|
||||
credentials[$key]=$value
|
||||
done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file )
|
||||
for i in ${credentials[@]}; do echo ***$i; done
|
||||
|
||||
rm $configDir/etl-config.config
|
||||
|
||||
user=${credentials[user]}
|
||||
password=${credentials[password]}
|
||||
host=${credentials[host]}
|
||||
db=${credentials[db]}
|
||||
protocol=${credentials[protocol]}
|
||||
server=${credentials[server]}
|
||||
|
||||
|
||||
211
MMT_latest_version/sql/onetime/archive/create/archive_create.sql
Normal file
211
MMT_latest_version/sql/onetime/archive/create/archive_create.sql
Normal file
@@ -0,0 +1,211 @@
|
||||
create schema archive;
|
||||
|
||||
create table archive.budni_arc_perf_atmos_meas_test_block_archive( like staging2.budni_arc_perf_atmos_meas_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_arc_spec_h1_block_archive( like staging2.budni_arc_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_arc_test_obs_summary_block_archive( like staging2.budni_arc_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_other_observations_block_archive( like staging2.budni_brk_other_observations_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_parking_barke_test_block_archive( like staging2.budni_brk_parking_barke_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_service_cold_ballasted_25kmph_block_archive( like staging2.budni_brk_service_cold_ballasted_25kmph_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_service_cold_ballasted_maximum_block_archive( like staging2.budni_brk_service_cold_ballasted_maximum_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_service_cold_standard_25kmph_block_archive( like staging2.budni_brk_service_cold_standard_25kmph_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_service_cold_standard_maximum_block_archive( like staging2.budni_brk_service_cold_standard_maximum_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_service_fade_ballasted_25kmph_block_archive( like staging2.budni_brk_service_fade_ballasted_25kmph_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_service_fade_standard_maximum_block_archive( like staging2.budni_brk_service_fade_standard_maximum_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_spec_h1_block_archive( like staging2.budni_brk_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_brk_test_obs_summary_block_archive( like staging2.budni_brk_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_dbp_drawbar_perf_block_archive( like staging2.budni_dbp_drawbar_perf_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_dbp_spec_h1_block_archive( like staging2.budni_dbp_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_fld_cage_wheel_block_archive( like staging2.budni_fld_cage_wheel_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_fld_impl_test_block_archive( like staging2.budni_fld_impl_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_fld_spec_h1_block_archive( like staging2.budni_fld_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_fld_sum_perf_test_block_archive( like staging2.budni_fld_sum_perf_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_fld_test_obs_summary_block_archive( like staging2.budni_fld_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hdl_lifting_capacity_test_block_archive( like staging2.budni_hdl_lifting_capacity_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hdl_maintenance_of_lift_load_block_archive( like staging2.budni_hdl_maintenance_of_lift_load_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hdl_power_test_block_archive( like staging2.budni_hdl_power_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hdl_spec_h1_block_archive( like staging2.budni_hdl_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hdl_test_obs_summary_block_archive( like staging2.budni_hdl_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hlg_perf_test_block_archive( like staging2.budni_hlg_perf_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hlg_spec_h1_block_archive( like staging2.budni_hlg_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_hlg_test_obs_summary_block_archive( like staging2.budni_hlg_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_lcg_gravity_test_block_archive( like staging2.budni_lcg_gravity_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_lcg_spec_h1_block_archive( like staging2.budni_lcg_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_atmos_cond_1_block_archive( like staging2.budni_nmt_atmos_cond_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_atmos_cond_2_block_archive( like staging2.budni_nmt_atmos_cond_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_meas_results_1_block_archive( like staging2.budni_nmt_meas_results_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_meas_results_2_block_archive( like staging2.budni_nmt_meas_results_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_noise_at_bystander_position_block_archive( like staging2.budni_nmt_noise_at_bystander_position_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_noise_at_operator_ear_level_block_archive( like staging2.budni_nmt_noise_at_operator_ear_level_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_spec_h1_block_archive( like staging2.budni_nmt_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_nmt_test_obs_summary_block_archive( like staging2.budni_nmt_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_pto_mmtkeyword1_block_archive( like staging2.budni_pto_mmtkeyword1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_pto_mmtkeyword2_block_archive( like staging2.budni_pto_mmtkeyword2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_pto_perf_report_block_archive( like staging2.budni_pto_perf_report_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_pto_spec_h1_block_archive( like staging2.budni_pto_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_pto_summary_block_archive( like staging2.budni_pto_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_vmt_perf_meas_test_block_archive( like staging2.budni_vmt_perf_meas_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_vmt_spec_h1_block_archive( like staging2.budni_vmt_spec_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.budni_vmt_test_obs_summary_block_archive( like staging2.budni_vmt_test_obs_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_drawbar_performance_fuel_consumption_block_archive( like staging2.dboecd_test_drawbar_performance_fuel_consumption_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_drawbar_performance_gear_performance_block_archive( like staging2.dboecd_test_drawbar_performance_gear_performance_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_drawbar_performance_selected_summary_block_archive( like staging2.dboecd_test_drawbar_performance_selected_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_engine_rpm_engine_to_pto_block_archive( like staging2.dboecd_test_engine_rpm_engine_to_pto_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_engine_rpm_required_pull_block_archive( like staging2.dboecd_test_engine_rpm_required_pull_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_engine_rpm_rpm_block_archive( like staging2.dboecd_test_engine_rpm_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_engine_rpm_tyre_details_block_archive( like staging2.dboecd_test_engine_rpm_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_engine_rpm_weight_block_archive( like staging2.dboecd_test_engine_rpm_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_h1_block_archive( like staging2.dboecd_test_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_measurement_uncertainty_block_archive( like staging2.dboecd_test_measurement_uncertainty_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_remarks_block_archive( like staging2.dboecd_test_remarks_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_remarks_footer_block_archive( like staging2.dboecd_test_remarks_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_test_condition_block_archive( like staging2.dboecd_test_test_condition_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_test_equipment_used_block_archive( like staging2.dboecd_test_test_equipment_used_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_tractor_specifications_cleaner_block_archive( like staging2.dboecd_test_tractor_specifications_cleaner_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_tractor_specifications_cylinders_block_archive( like staging2.dboecd_test_tractor_specifications_cylinders_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_tractor_specifications_engine_details_block_archive( like staging2.dboecd_test_tractor_specifications_engine_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_tractor_specifications_fuel_and_injection_block( like staging2.dboecd_test_tractor_specifications_fuel_and_injection_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_transmission_clutch_block_archive( like staging2.dboecd_test_transmission_clutch_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_transmission_drawbar_block_archive( like staging2.dboecd_test_transmission_drawbar_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_transmission_fuel_lubricant_block_archive( like staging2.dboecd_test_transmission_fuel_lubricant_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_transmission_speed_chart_block_archive( like staging2.dboecd_test_transmission_speed_chart_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_transmission_speed_chart_desc_block_archive( like staging2.dboecd_test_transmission_speed_chart_desc_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dboecd_test_transmission_wheels_block_archive( like staging2.dboecd_test_transmission_wheels_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_drawbar_performance_gear_performance_block_archive( like staging2.dbstd_test_drawbar_performance_gear_performance_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_drawbar_performance_selected_summary_block_archive( like staging2.dbstd_test_drawbar_performance_selected_summary_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_engine_rpm_engine_to_pto_block_archive( like staging2.dbstd_test_engine_rpm_engine_to_pto_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_engine_rpm_required_pull_block_archive( like staging2.dbstd_test_engine_rpm_required_pull_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_engine_rpm_rpm_block_archive( like staging2.dbstd_test_engine_rpm_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_engine_rpm_tyre_details_block_archive( like staging2.dbstd_test_engine_rpm_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_engine_rpm_weight_block_archive( like staging2.dbstd_test_engine_rpm_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_h1_block_archive( like staging2.dbstd_test_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_measurement_uncertainty_block_archive( like staging2.dbstd_test_measurement_uncertainty_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_remarks_block_archive( like staging2.dbstd_test_remarks_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_remarks_footer_block_archive( like staging2.dbstd_test_remarks_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_test_condition_block_archive( like staging2.dbstd_test_test_condition_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_test_equipment_used_block_archive( like staging2.dbstd_test_test_equipment_used_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_tractor_specifications_cleaner_block_archive( like staging2.dbstd_test_tractor_specifications_cleaner_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_tractor_specifications_cylinders_block_archive( like staging2.dbstd_test_tractor_specifications_cylinders_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_tractor_specifications_engine_details_block_archive( like staging2.dbstd_test_tractor_specifications_engine_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_tractor_specifications_fuel_and_injection_block( like staging2.dbstd_test_tractor_specifications_fuel_and_injection_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_transmission_clutch_block_archive( like staging2.dbstd_test_transmission_clutch_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_transmission_drawbar_block_archive( like staging2.dbstd_test_transmission_drawbar_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_transmission_fuel_lubricant_block_archive( like staging2.dbstd_test_transmission_fuel_lubricant_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_transmission_speed_chart_block_archive( like staging2.dbstd_test_transmission_speed_chart_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_transmission_speed_chart_desc_block_archive( like staging2.dbstd_test_transmission_speed_chart_desc_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.dbstd_test_transmission_wheels_block_archive( like staging2.dbstd_test_transmission_wheels_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_sum_comments_by_block_archive( like staging2.ftdry_sum_comments_by_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_sum_implement_block_archive( like staging2.ftdry_sum_implement_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_sum_test_condition_1_block_archive( like staging2.ftdry_sum_test_condition_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_sum_test_condition_2_block_archive( like staging2.ftdry_sum_test_condition_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_sum_trac_h1_block_archive( like staging2.ftdry_sum_trac_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_trs_engine_rpm_block_archive( like staging2.ftdry_trs_engine_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_trs_h1_block_archive( like staging2.ftdry_trs_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_trs_implement_block_archive( like staging2.ftdry_trs_implement_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftdry_trs_spec_block_archive( like staging2.ftdry_trs_spec_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_sum_comments_by_block_archive( like staging2.fthlg_sum_comments_by_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_sum_test_condition_1_block_archive( like staging2.fthlg_sum_test_condition_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_sum_test_condition_2_block_archive( like staging2.fthlg_sum_test_condition_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_sum_trac_h1_block_archive( like staging2.fthlg_sum_trac_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_sum_trail_type_block_archive( like staging2.fthlg_sum_trail_type_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_trs_engine_rpm_block_archive( like staging2.fthlg_trs_engine_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_trs_h1_block_archive( like staging2.fthlg_trs_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_trs_spec_block_archive( like staging2.fthlg_trs_spec_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.fthlg_trs_trailer_block_archive( like staging2.fthlg_trs_trailer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_sum_cage_wheel_block_archive( like staging2.ftwet_sum_cage_wheel_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_sum_comments_by_block_archive( like staging2.ftwet_sum_comments_by_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_sum_implement_block_archive( like staging2.ftwet_sum_implement_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_sum_test_condition_block_archive( like staging2.ftwet_sum_test_condition_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_sum_trac_h1_block_archive( like staging2.ftwet_sum_trac_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_trs_engine_rpm_block_archive( like staging2.ftwet_trs_engine_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_trs_h1_block_archive( like staging2.ftwet_trs_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_trs_implement_block_archive( like staging2.ftwet_trs_implement_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ftwet_trs_spec_block_archive( like staging2.ftwet_trs_spec_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_footer_block_archive( like staging2.ihtbt30_bt30_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_h1_block_archive( like staging2.ihtbt30_bt30_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_test_condition_block_archive( like staging2.ihtbt30_bt30_test_condition_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_test_res_1_block_archive( like staging2.ihtbt30_bt30_test_res_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_test_res_2_block_archive( like staging2.ihtbt30_bt30_test_res_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_test_res_3_block_archive( like staging2.ihtbt30_bt30_test_res_3_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_test_res_4_block_archive( like staging2.ihtbt30_bt30_test_res_4_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_tyre_details_block_archive( like staging2.ihtbt30_bt30_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt30_bt30_weight_block_archive( like staging2.ihtbt30_bt30_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_footer_block_archive( like staging2.ihtbt50_bt50_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_h1_block_archive( like staging2.ihtbt50_bt50_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_test_condition_block_archive( like staging2.ihtbt50_bt50_test_condition_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_test_res_1_block_archive( like staging2.ihtbt50_bt50_test_res_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_test_res_2_block_archive( like staging2.ihtbt50_bt50_test_res_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_test_res_3_block_archive( like staging2.ihtbt50_bt50_test_res_3_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_test_res_4_block_archive( like staging2.ihtbt50_bt50_test_res_4_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_tyre_details_block_archive( like staging2.ihtbt50_bt50_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbt50_bt50_weight_block_archive( like staging2.ihtbt50_bt50_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_footer_block_archive( like staging2.ihtbtd_btd_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_h1_block_archive( like staging2.ihtbtd_btd_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_condition_block_archive( like staging2.ihtbtd_btd_test_condition_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_res_1_block_archive( like staging2.ihtbtd_btd_test_res_1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_res_2_block_archive( like staging2.ihtbtd_btd_test_res_2_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_res_3_block_archive( like staging2.ihtbtd_btd_test_res_3_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_res_4_block_archive( like staging2.ihtbtd_btd_test_res_4_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_res_5_block_archive( like staging2.ihtbtd_btd_test_res_5_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_test_res_6_block_archive( like staging2.ihtbtd_btd_test_res_6_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_tyre_details_block_archive( like staging2.ihtbtd_btd_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtbtd_btd_weight_block_archive( like staging2.ihtbtd_btd_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_footer_block_archive( like staging2.ihtcgm_cgm_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_h1_block_archive( like staging2.ihtcgm_cgm_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_lifting_block_archive( like staging2.ihtcgm_cgm_lifting_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_results_block_archive( like staging2.ihtcgm_cgm_results_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_tyre_details_block_archive( like staging2.ihtcgm_cgm_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_weight_block_archive( like staging2.ihtcgm_cgm_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtcgm_cgm_wheel_block_archive( like staging2.ihtcgm_cgm_wheel_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_brake_pedal_block_archive( like staging2.ihtemt_emt_brake_pedal_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_footer_block_archive( like staging2.ihtemt_emt_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_h1_block_archive( like staging2.ihtemt_emt_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_pedal_block_archive( like staging2.ihtemt_emt_pedal_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_steering_block_archive( like staging2.ihtemt_emt_steering_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_tyre_details_block_archive( like staging2.ihtemt_emt_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_weight_block_archive( like staging2.ihtemt_emt_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_emt_wheel_block_archive( like staging2.ihtemt_emt_wheel_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtemt_std_raw_data_block_archive( like staging2.ihtemt_std_raw_data_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_atmos_cond_block_archive( like staging2.ihtham_ham_atmos_cond_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_drawbar_block_archive( like staging2.ihtham_ham_drawbar_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_engine_rpm_block_archive( like staging2.ihtham_ham_engine_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_footer_block_archive( like staging2.ihtham_ham_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_h1_block_archive( like staging2.ihtham_ham_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_results_block_archive( like staging2.ihtham_ham_results_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_tractor_block_archive( like staging2.ihtham_ham_tractor_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_tyre_details_block_archive( like staging2.ihtham_ham_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtham_ham_weight_block_archive( like staging2.ihtham_ham_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihthls_hls_footer_block_archive( like staging2.ihthls_hls_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihthls_hls_h1_block_archive( like staging2.ihthls_hls_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihthls_hls_numeric_block_archive( like staging2.ihthls_hls_numeric_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihthls_hls_tyre_details_block_archive( like staging2.ihthls_hls_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihthls_hls_weight_block_archive( like staging2.ihthls_hls_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihthls_hls_wheel_block_archive( like staging2.ihthls_hls_wheel_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_atmos_cond_block_archive( like staging2.ihtnst_nst_atmos_cond_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_engine_rpm_block_archive( like staging2.ihtnst_nst_engine_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_footer_block_archive( like staging2.ihtnst_nst_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_h1_block_archive( like staging2.ihtnst_nst_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_oel_noise_block_archive( like staging2.ihtnst_nst_oel_noise_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_oel_noise_load_block_archive( like staging2.ihtnst_nst_oel_noise_load_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_stand_noise_block_archive( like staging2.ihtnst_nst_stand_noise_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_tyre_details_block_archive( like staging2.ihtnst_nst_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtnst_nst_weight_block_archive( like staging2.ihtnst_nst_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_footer_block_archive( like staging2.ihtsll_sll_footer_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_forward_block_archive( like staging2.ihtsll_sll_forward_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_h1_block_archive( like staging2.ihtsll_sll_h1_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_lead_lag_block_archive( like staging2.ihtsll_sll_lead_lag_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_reverse_block_archive( like staging2.ihtsll_sll_reverse_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_tyre_details_block_archive( like staging2.ihtsll_sll_tyre_details_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_weight_block_archive( like staging2.ihtsll_sll_weight_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ihtsll_sll_wheel_block_archive( like staging2.ihtsll_sll_wheel_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_gvg_performance_governing_trails_block_archive( like staging2.ptoben_gvg_performance_governing_trails_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_mpm_performance_boost_natural_block_archive( like staging2.ptoben_mpm_performance_boost_natural_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_2hrs_max_power_natural_ambient_block_archive( like staging2.ptoben_prf_2hrs_max_power_natural_ambient_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_2hrs_max_power_test_high_ambient_block_archive( like staging2.ptoben_prf_2hrs_max_power_test_high_ambient_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_engine_oil_consumption_block_archive( like staging2.ptoben_prf_engine_oil_consumption_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_key_performance_parameters_block_archive( like staging2.ptoben_prf_key_performance_parameters_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_smoke_test_block_archive( like staging2.ptoben_prf_smoke_test_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_tractor_specs_block_archive( like staging2.ptoben_prf_tractor_specs_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_varying_load_rated_rpm_block_archive( like staging2.ptoben_prf_varying_load_rated_rpm_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_varying_load_std_pto_block_archive( like staging2.ptoben_prf_varying_load_std_pto_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_varying_speed_natural_ambient_block_archive( like staging2.ptoben_prf_varying_speed_natural_ambient_block including all, insert_time timestamp default current_timestamp);
|
||||
create table archive.ptoben_prf_varying_speed_test_high_ambient_block_archive( like staging2.ptoben_prf_varying_speed_test_high_ambient_block including all, insert_time timestamp default current_timestamp);
|
||||
249
MMT_latest_version/sql/onetime/archive/function/fn_archive.sql
Normal file
249
MMT_latest_version/sql/onetime/archive/function/fn_archive.sql
Normal file
@@ -0,0 +1,249 @@
|
||||
--drop function if exists archive.fn_block_archive;
|
||||
|
||||
CREATE OR REPLACE FUNCTION archive.fn_block_archive()
|
||||
RETURNS void AS $$
|
||||
|
||||
declare __client_id int :=21;
|
||||
declare __function_id int :=1;
|
||||
declare __file_mnemonic text :='archive';
|
||||
declare __file_sheet_mnemonic text :='archive_sheet';
|
||||
declare __file_syspk int := null;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
|
||||
begin
|
||||
insert into archive.budni_arc_perf_atmos_meas_test_block_archive select * from staging2.budni_arc_perf_atmos_meas_test_block;
|
||||
insert into archive.budni_arc_spec_h1_block_archive select * from staging2.budni_arc_spec_h1_block;
|
||||
insert into archive.budni_arc_test_obs_summary_block_archive select * from staging2.budni_arc_test_obs_summary_block;
|
||||
insert into archive.budni_brk_other_observations_block_archive select * from staging2.budni_brk_other_observations_block;
|
||||
insert into archive.budni_brk_parking_barke_test_block_archive select * from staging2.budni_brk_parking_barke_test_block;
|
||||
insert into archive.budni_brk_service_cold_ballasted_25kmph_block_archive select * from staging2.budni_brk_service_cold_ballasted_25kmph_block;
|
||||
insert into archive.budni_brk_service_cold_ballasted_maximum_block_archive select * from staging2.budni_brk_service_cold_ballasted_maximum_block;
|
||||
insert into archive.budni_brk_service_cold_standard_25kmph_block_archive select * from staging2.budni_brk_service_cold_standard_25kmph_block;
|
||||
insert into archive.budni_brk_service_cold_standard_maximum_block_archive select * from staging2.budni_brk_service_cold_standard_maximum_block;
|
||||
insert into archive.budni_brk_service_fade_ballasted_25kmph_block_archive select * from staging2.budni_brk_service_fade_ballasted_25kmph_block;
|
||||
insert into archive.budni_brk_service_fade_standard_maximum_block_archive select * from staging2.budni_brk_service_fade_standard_maximum_block;
|
||||
insert into archive.budni_brk_spec_h1_block_archive select * from staging2.budni_brk_spec_h1_block;
|
||||
insert into archive.budni_brk_test_obs_summary_block_archive select * from staging2.budni_brk_test_obs_summary_block;
|
||||
insert into archive.budni_dbp_drawbar_perf_block_archive select * from staging2.budni_dbp_drawbar_perf_block;
|
||||
insert into archive.budni_dbp_spec_h1_block_archive select * from staging2.budni_dbp_spec_h1_block;
|
||||
insert into archive.budni_fld_cage_wheel_block_archive select * from staging2.budni_fld_cage_wheel_block;
|
||||
insert into archive.budni_fld_impl_test_block_archive select * from staging2.budni_fld_impl_test_block;
|
||||
insert into archive.budni_fld_spec_h1_block_archive select * from staging2.budni_fld_spec_h1_block;
|
||||
insert into archive.budni_fld_sum_perf_test_block_archive select * from staging2.budni_fld_sum_perf_test_block;
|
||||
insert into archive.budni_fld_test_obs_summary_block_archive select * from staging2.budni_fld_test_obs_summary_block;
|
||||
insert into archive.budni_hdl_lifting_capacity_test_block_archive select * from staging2.budni_hdl_lifting_capacity_test_block;
|
||||
insert into archive.budni_hdl_maintenance_of_lift_load_block_archive select * from staging2.budni_hdl_maintenance_of_lift_load_block;
|
||||
insert into archive.budni_hdl_power_test_block_archive select * from staging2.budni_hdl_power_test_block;
|
||||
insert into archive.budni_hdl_spec_h1_block_archive select * from staging2.budni_hdl_spec_h1_block;
|
||||
insert into archive.budni_hdl_test_obs_summary_block_archive select * from staging2.budni_hdl_test_obs_summary_block;
|
||||
insert into archive.budni_hlg_perf_test_block_archive select * from staging2.budni_hlg_perf_test_block;
|
||||
insert into archive.budni_hlg_spec_h1_block_archive select * from staging2.budni_hlg_spec_h1_block;
|
||||
insert into archive.budni_hlg_test_obs_summary_block_archive select * from staging2.budni_hlg_test_obs_summary_block;
|
||||
insert into archive.budni_lcg_gravity_test_block_archive select * from staging2.budni_lcg_gravity_test_block;
|
||||
insert into archive.budni_lcg_spec_h1_block_archive select * from staging2.budni_lcg_spec_h1_block;
|
||||
insert into archive.budni_nmt_atmos_cond_1_block_archive select * from staging2.budni_nmt_atmos_cond_1_block;
|
||||
insert into archive.budni_nmt_atmos_cond_2_block_archive select * from staging2.budni_nmt_atmos_cond_2_block;
|
||||
insert into archive.budni_nmt_meas_results_1_block_archive select * from staging2.budni_nmt_meas_results_1_block;
|
||||
insert into archive.budni_nmt_meas_results_2_block_archive select * from staging2.budni_nmt_meas_results_2_block;
|
||||
insert into archive.budni_nmt_noise_at_bystander_position_block_archive select * from staging2.budni_nmt_noise_at_bystander_position_block;
|
||||
insert into archive.budni_nmt_noise_at_operator_ear_level_block_archive select * from staging2.budni_nmt_noise_at_operator_ear_level_block;
|
||||
insert into archive.budni_nmt_spec_h1_block_archive select * from staging2.budni_nmt_spec_h1_block;
|
||||
insert into archive.budni_nmt_test_obs_summary_block_archive select * from staging2.budni_nmt_test_obs_summary_block;
|
||||
insert into archive.budni_pto_mmtkeyword1_block_archive select * from staging2.budni_pto_mmtkeyword1_block;
|
||||
insert into archive.budni_pto_mmtkeyword2_block_archive select * from staging2.budni_pto_mmtkeyword2_block;
|
||||
insert into archive.budni_pto_perf_report_block_archive select * from staging2.budni_pto_perf_report_block;
|
||||
insert into archive.budni_pto_spec_h1_block_archive select * from staging2.budni_pto_spec_h1_block;
|
||||
insert into archive.budni_pto_summary_block_archive select * from staging2.budni_pto_summary_block;
|
||||
insert into archive.budni_vmt_perf_meas_test_block_archive select * from staging2.budni_vmt_perf_meas_test_block;
|
||||
insert into archive.budni_vmt_spec_h1_block_archive select * from staging2.budni_vmt_spec_h1_block;
|
||||
insert into archive.budni_vmt_test_obs_summary_block_archive select * from staging2.budni_vmt_test_obs_summary_block;
|
||||
insert into archive.dboecd_test_drawbar_performance_fuel_consumption_block_archive select * from staging2.dboecd_test_drawbar_performance_fuel_consumption_block;
|
||||
insert into archive.dboecd_test_drawbar_performance_gear_performance_block_archive select * from staging2.dboecd_test_drawbar_performance_gear_performance_block;
|
||||
insert into archive.dboecd_test_drawbar_performance_selected_summary_block_archive select * from staging2.dboecd_test_drawbar_performance_selected_summary_block;
|
||||
insert into archive.dboecd_test_engine_rpm_engine_to_pto_block_archive select * from staging2.dboecd_test_engine_rpm_engine_to_pto_block;
|
||||
insert into archive.dboecd_test_engine_rpm_required_pull_block_archive select * from staging2.dboecd_test_engine_rpm_required_pull_block;
|
||||
insert into archive.dboecd_test_engine_rpm_rpm_block_archive select * from staging2.dboecd_test_engine_rpm_rpm_block;
|
||||
insert into archive.dboecd_test_engine_rpm_tyre_details_block_archive select * from staging2.dboecd_test_engine_rpm_tyre_details_block;
|
||||
insert into archive.dboecd_test_engine_rpm_weight_block_archive select * from staging2.dboecd_test_engine_rpm_weight_block;
|
||||
insert into archive.dboecd_test_h1_block_archive select * from staging2.dboecd_test_h1_block;
|
||||
insert into archive.dboecd_test_measurement_uncertainty_block_archive select * from staging2.dboecd_test_measurement_uncertainty_block;
|
||||
insert into archive.dboecd_test_remarks_block_archive select * from staging2.dboecd_test_remarks_block;
|
||||
insert into archive.dboecd_test_remarks_footer_block_archive select * from staging2.dboecd_test_remarks_footer_block;
|
||||
insert into archive.dboecd_test_test_condition_block_archive select * from staging2.dboecd_test_test_condition_block;
|
||||
insert into archive.dboecd_test_test_equipment_used_block_archive select * from staging2.dboecd_test_test_equipment_used_block;
|
||||
insert into archive.dboecd_test_tractor_specifications_cleaner_block_archive select * from staging2.dboecd_test_tractor_specifications_cleaner_block;
|
||||
insert into archive.dboecd_test_tractor_specifications_cylinders_block_archive select * from staging2.dboecd_test_tractor_specifications_cylinders_block;
|
||||
insert into archive.dboecd_test_tractor_specifications_engine_details_block_archive select * from staging2.dboecd_test_tractor_specifications_engine_details_block;
|
||||
insert into archive.dboecd_test_tractor_specifications_fuel_and_injection_block select * from staging2.dboecd_test_tractor_specifications_fuel_and_injection_block;
|
||||
insert into archive.dboecd_test_transmission_clutch_block_archive select * from staging2.dboecd_test_transmission_clutch_block;
|
||||
insert into archive.dboecd_test_transmission_drawbar_block_archive select * from staging2.dboecd_test_transmission_drawbar_block;
|
||||
insert into archive.dboecd_test_transmission_fuel_lubricant_block_archive select * from staging2.dboecd_test_transmission_fuel_lubricant_block;
|
||||
insert into archive.dboecd_test_transmission_speed_chart_block_archive select * from staging2.dboecd_test_transmission_speed_chart_block;
|
||||
insert into archive.dboecd_test_transmission_speed_chart_desc_block_archive select * from staging2.dboecd_test_transmission_speed_chart_desc_block;
|
||||
insert into archive.dboecd_test_transmission_wheels_block_archive select * from staging2.dboecd_test_transmission_wheels_block;
|
||||
insert into archive.dbstd_test_drawbar_performance_gear_performance_block_archive select * from staging2.dbstd_test_drawbar_performance_gear_performance_block;
|
||||
insert into archive.dbstd_test_drawbar_performance_selected_summary_block_archive select * from staging2.dbstd_test_drawbar_performance_selected_summary_block;
|
||||
insert into archive.dbstd_test_engine_rpm_engine_to_pto_block_archive select * from staging2.dbstd_test_engine_rpm_engine_to_pto_block;
|
||||
insert into archive.dbstd_test_engine_rpm_required_pull_block_archive select * from staging2.dbstd_test_engine_rpm_required_pull_block;
|
||||
insert into archive.dbstd_test_engine_rpm_rpm_block_archive select * from staging2.dbstd_test_engine_rpm_rpm_block;
|
||||
insert into archive.dbstd_test_engine_rpm_tyre_details_block_archive select * from staging2.dbstd_test_engine_rpm_tyre_details_block;
|
||||
insert into archive.dbstd_test_engine_rpm_weight_block_archive select * from staging2.dbstd_test_engine_rpm_weight_block;
|
||||
insert into archive.dbstd_test_h1_block_archive select * from staging2.dbstd_test_h1_block;
|
||||
insert into archive.dbstd_test_measurement_uncertainty_block_archive select * from staging2.dbstd_test_measurement_uncertainty_block;
|
||||
insert into archive.dbstd_test_remarks_block_archive select * from staging2.dbstd_test_remarks_block;
|
||||
insert into archive.dbstd_test_remarks_footer_block_archive select * from staging2.dbstd_test_remarks_footer_block;
|
||||
insert into archive.dbstd_test_test_condition_block_archive select * from staging2.dbstd_test_test_condition_block;
|
||||
insert into archive.dbstd_test_test_equipment_used_block_archive select * from staging2.dbstd_test_test_equipment_used_block;
|
||||
insert into archive.dbstd_test_tractor_specifications_cleaner_block_archive select * from staging2.dbstd_test_tractor_specifications_cleaner_block;
|
||||
insert into archive.dbstd_test_tractor_specifications_cylinders_block_archive select * from staging2.dbstd_test_tractor_specifications_cylinders_block;
|
||||
insert into archive.dbstd_test_tractor_specifications_engine_details_block_archive select * from staging2.dbstd_test_tractor_specifications_engine_details_block;
|
||||
insert into archive.dbstd_test_tractor_specifications_fuel_and_injection_block select * from staging2.dbstd_test_tractor_specifications_fuel_and_injection_block;
|
||||
insert into archive.dbstd_test_transmission_clutch_block_archive select * from staging2.dbstd_test_transmission_clutch_block;
|
||||
insert into archive.dbstd_test_transmission_drawbar_block_archive select * from staging2.dbstd_test_transmission_drawbar_block;
|
||||
insert into archive.dbstd_test_transmission_fuel_lubricant_block_archive select * from staging2.dbstd_test_transmission_fuel_lubricant_block;
|
||||
insert into archive.dbstd_test_transmission_speed_chart_block_archive select * from staging2.dbstd_test_transmission_speed_chart_block;
|
||||
insert into archive.dbstd_test_transmission_speed_chart_desc_block_archive select * from staging2.dbstd_test_transmission_speed_chart_desc_block;
|
||||
insert into archive.dbstd_test_transmission_wheels_block_archive select * from staging2.dbstd_test_transmission_wheels_block;
|
||||
insert into archive.ftdry_sum_comments_by_block_archive select * from staging2.ftdry_sum_comments_by_block;
|
||||
insert into archive.ftdry_sum_implement_block_archive select * from staging2.ftdry_sum_implement_block;
|
||||
insert into archive.ftdry_sum_test_condition_1_block_archive select * from staging2.ftdry_sum_test_condition_1_block;
|
||||
insert into archive.ftdry_sum_test_condition_2_block_archive select * from staging2.ftdry_sum_test_condition_2_block;
|
||||
insert into archive.ftdry_sum_trac_h1_block_archive select * from staging2.ftdry_sum_trac_h1_block;
|
||||
insert into archive.ftdry_trs_engine_rpm_block_archive select * from staging2.ftdry_trs_engine_rpm_block;
|
||||
insert into archive.ftdry_trs_h1_block_archive select * from staging2.ftdry_trs_h1_block;
|
||||
insert into archive.ftdry_trs_implement_block_archive select * from staging2.ftdry_trs_implement_block;
|
||||
insert into archive.ftdry_trs_spec_block_archive select * from staging2.ftdry_trs_spec_block;
|
||||
insert into archive.fthlg_sum_comments_by_block_archive select * from staging2.fthlg_sum_comments_by_block;
|
||||
insert into archive.fthlg_sum_test_condition_1_block_archive select * from staging2.fthlg_sum_test_condition_1_block;
|
||||
insert into archive.fthlg_sum_test_condition_2_block_archive select * from staging2.fthlg_sum_test_condition_2_block;
|
||||
insert into archive.fthlg_sum_trac_h1_block_archive select * from staging2.fthlg_sum_trac_h1_block;
|
||||
insert into archive.fthlg_sum_trail_type_block_archive select * from staging2.fthlg_sum_trail_type_block;
|
||||
insert into archive.fthlg_trs_engine_rpm_block_archive select * from staging2.fthlg_trs_engine_rpm_block;
|
||||
insert into archive.fthlg_trs_h1_block_archive select * from staging2.fthlg_trs_h1_block;
|
||||
insert into archive.fthlg_trs_spec_block_archive select * from staging2.fthlg_trs_spec_block;
|
||||
insert into archive.fthlg_trs_trailer_block_archive select * from staging2.fthlg_trs_trailer_block;
|
||||
insert into archive.ftwet_sum_cage_wheel_block_archive select * from staging2.ftwet_sum_cage_wheel_block;
|
||||
insert into archive.ftwet_sum_comments_by_block_archive select * from staging2.ftwet_sum_comments_by_block;
|
||||
insert into archive.ftwet_sum_implement_block_archive select * from staging2.ftwet_sum_implement_block;
|
||||
insert into archive.ftwet_sum_test_condition_block_archive select * from staging2.ftwet_sum_test_condition_block;
|
||||
insert into archive.ftwet_sum_trac_h1_block_archive select * from staging2.ftwet_sum_trac_h1_block;
|
||||
insert into archive.ftwet_trs_engine_rpm_block_archive select * from staging2.ftwet_trs_engine_rpm_block;
|
||||
insert into archive.ftwet_trs_h1_block_archive select * from staging2.ftwet_trs_h1_block;
|
||||
insert into archive.ftwet_trs_implement_block_archive select * from staging2.ftwet_trs_implement_block;
|
||||
insert into archive.ftwet_trs_spec_block_archive select * from staging2.ftwet_trs_spec_block;
|
||||
insert into archive.ihtbt30_bt30_footer_block_archive select * from staging2.ihtbt30_bt30_footer_block;
|
||||
insert into archive.ihtbt30_bt30_h1_block_archive select * from staging2.ihtbt30_bt30_h1_block;
|
||||
insert into archive.ihtbt30_bt30_test_condition_block_archive select * from staging2.ihtbt30_bt30_test_condition_block;
|
||||
insert into archive.ihtbt30_bt30_test_res_1_block_archive select * from staging2.ihtbt30_bt30_test_res_1_block;
|
||||
insert into archive.ihtbt30_bt30_test_res_2_block_archive select * from staging2.ihtbt30_bt30_test_res_2_block;
|
||||
insert into archive.ihtbt30_bt30_test_res_3_block_archive select * from staging2.ihtbt30_bt30_test_res_3_block;
|
||||
insert into archive.ihtbt30_bt30_test_res_4_block_archive select * from staging2.ihtbt30_bt30_test_res_4_block;
|
||||
insert into archive.ihtbt30_bt30_tyre_details_block_archive select * from staging2.ihtbt30_bt30_tyre_details_block;
|
||||
insert into archive.ihtbt30_bt30_weight_block_archive select * from staging2.ihtbt30_bt30_weight_block;
|
||||
insert into archive.ihtbt50_bt50_footer_block_archive select * from staging2.ihtbt50_bt50_footer_block;
|
||||
insert into archive.ihtbt50_bt50_h1_block_archive select * from staging2.ihtbt50_bt50_h1_block;
|
||||
insert into archive.ihtbt50_bt50_test_condition_block_archive select * from staging2.ihtbt50_bt50_test_condition_block;
|
||||
insert into archive.ihtbt50_bt50_test_res_1_block_archive select * from staging2.ihtbt50_bt50_test_res_1_block;
|
||||
insert into archive.ihtbt50_bt50_test_res_2_block_archive select * from staging2.ihtbt50_bt50_test_res_2_block;
|
||||
insert into archive.ihtbt50_bt50_test_res_3_block_archive select * from staging2.ihtbt50_bt50_test_res_3_block;
|
||||
insert into archive.ihtbt50_bt50_test_res_4_block_archive select * from staging2.ihtbt50_bt50_test_res_4_block;
|
||||
insert into archive.ihtbt50_bt50_tyre_details_block_archive select * from staging2.ihtbt50_bt50_tyre_details_block;
|
||||
insert into archive.ihtbt50_bt50_weight_block_archive select * from staging2.ihtbt50_bt50_weight_block;
|
||||
insert into archive.ihtbtd_btd_footer_block_archive select * from staging2.ihtbtd_btd_footer_block;
|
||||
insert into archive.ihtbtd_btd_h1_block_archive select * from staging2.ihtbtd_btd_h1_block;
|
||||
insert into archive.ihtbtd_btd_test_condition_block_archive select * from staging2.ihtbtd_btd_test_condition_block;
|
||||
insert into archive.ihtbtd_btd_test_res_1_block_archive select * from staging2.ihtbtd_btd_test_res_1_block;
|
||||
insert into archive.ihtbtd_btd_test_res_2_block_archive select * from staging2.ihtbtd_btd_test_res_2_block;
|
||||
insert into archive.ihtbtd_btd_test_res_3_block_archive select * from staging2.ihtbtd_btd_test_res_3_block;
|
||||
insert into archive.ihtbtd_btd_test_res_4_block_archive select * from staging2.ihtbtd_btd_test_res_4_block;
|
||||
insert into archive.ihtbtd_btd_test_res_5_block_archive select * from staging2.ihtbtd_btd_test_res_5_block;
|
||||
insert into archive.ihtbtd_btd_test_res_6_block_archive select * from staging2.ihtbtd_btd_test_res_6_block;
|
||||
insert into archive.ihtbtd_btd_tyre_details_block_archive select * from staging2.ihtbtd_btd_tyre_details_block;
|
||||
insert into archive.ihtbtd_btd_weight_block_archive select * from staging2.ihtbtd_btd_weight_block;
|
||||
insert into archive.ihtcgm_cgm_footer_block_archive select * from staging2.ihtcgm_cgm_footer_block;
|
||||
insert into archive.ihtcgm_cgm_h1_block_archive select * from staging2.ihtcgm_cgm_h1_block;
|
||||
insert into archive.ihtcgm_cgm_lifting_block_archive select * from staging2.ihtcgm_cgm_lifting_block;
|
||||
insert into archive.ihtcgm_cgm_results_block_archive select * from staging2.ihtcgm_cgm_results_block;
|
||||
insert into archive.ihtcgm_cgm_tyre_details_block_archive select * from staging2.ihtcgm_cgm_tyre_details_block;
|
||||
insert into archive.ihtcgm_cgm_weight_block_archive select * from staging2.ihtcgm_cgm_weight_block;
|
||||
insert into archive.ihtcgm_cgm_wheel_block_archive select * from staging2.ihtcgm_cgm_wheel_block;
|
||||
insert into archive.ihtemt_emt_brake_pedal_block_archive select * from staging2.ihtemt_emt_brake_pedal_block;
|
||||
insert into archive.ihtemt_emt_footer_block_archive select * from staging2.ihtemt_emt_footer_block;
|
||||
insert into archive.ihtemt_emt_h1_block_archive select * from staging2.ihtemt_emt_h1_block;
|
||||
insert into archive.ihtemt_emt_pedal_block_archive select * from staging2.ihtemt_emt_pedal_block;
|
||||
insert into archive.ihtemt_emt_steering_block_archive select * from staging2.ihtemt_emt_steering_block;
|
||||
insert into archive.ihtemt_emt_tyre_details_block_archive select * from staging2.ihtemt_emt_tyre_details_block;
|
||||
insert into archive.ihtemt_emt_weight_block_archive select * from staging2.ihtemt_emt_weight_block;
|
||||
insert into archive.ihtemt_emt_wheel_block_archive select * from staging2.ihtemt_emt_wheel_block;
|
||||
insert into archive.ihtemt_std_raw_data_block_archive select * from staging2.ihtemt_std_raw_data_block;
|
||||
insert into archive.ihtham_ham_atmos_cond_block_archive select * from staging2.ihtham_ham_atmos_cond_block;
|
||||
insert into archive.ihtham_ham_drawbar_block_archive select * from staging2.ihtham_ham_drawbar_block;
|
||||
insert into archive.ihtham_ham_engine_rpm_block_archive select * from staging2.ihtham_ham_engine_rpm_block;
|
||||
insert into archive.ihtham_ham_footer_block_archive select * from staging2.ihtham_ham_footer_block;
|
||||
insert into archive.ihtham_ham_h1_block_archive select * from staging2.ihtham_ham_h1_block;
|
||||
insert into archive.ihtham_ham_results_block_archive select * from staging2.ihtham_ham_results_block;
|
||||
insert into archive.ihtham_ham_tractor_block_archive select * from staging2.ihtham_ham_tractor_block;
|
||||
insert into archive.ihtham_ham_tyre_details_block_archive select * from staging2.ihtham_ham_tyre_details_block;
|
||||
insert into archive.ihtham_ham_weight_block_archive select * from staging2.ihtham_ham_weight_block;
|
||||
insert into archive.ihthls_hls_footer_block_archive select * from staging2.ihthls_hls_footer_block;
|
||||
insert into archive.ihthls_hls_h1_block_archive select * from staging2.ihthls_hls_h1_block;
|
||||
insert into archive.ihthls_hls_numeric_block_archive select * from staging2.ihthls_hls_numeric_block;
|
||||
insert into archive.ihthls_hls_tyre_details_block_archive select * from staging2.ihthls_hls_tyre_details_block;
|
||||
insert into archive.ihthls_hls_weight_block_archive select * from staging2.ihthls_hls_weight_block;
|
||||
insert into archive.ihthls_hls_wheel_block_archive select * from staging2.ihthls_hls_wheel_block;
|
||||
insert into archive.ihtnst_nst_atmos_cond_block_archive select * from staging2.ihtnst_nst_atmos_cond_block;
|
||||
insert into archive.ihtnst_nst_engine_rpm_block_archive select * from staging2.ihtnst_nst_engine_rpm_block;
|
||||
insert into archive.ihtnst_nst_footer_block_archive select * from staging2.ihtnst_nst_footer_block;
|
||||
insert into archive.ihtnst_nst_h1_block_archive select * from staging2.ihtnst_nst_h1_block;
|
||||
insert into archive.ihtnst_nst_oel_noise_block_archive select * from staging2.ihtnst_nst_oel_noise_block;
|
||||
insert into archive.ihtnst_nst_oel_noise_load_block_archive select * from staging2.ihtnst_nst_oel_noise_load_block;
|
||||
insert into archive.ihtnst_nst_stand_noise_block_archive select * from staging2.ihtnst_nst_stand_noise_block;
|
||||
insert into archive.ihtnst_nst_tyre_details_block_archive select * from staging2.ihtnst_nst_tyre_details_block;
|
||||
insert into archive.ihtnst_nst_weight_block_archive select * from staging2.ihtnst_nst_weight_block;
|
||||
insert into archive.ihtsll_sll_footer_block_archive select * from staging2.ihtsll_sll_footer_block;
|
||||
insert into archive.ihtsll_sll_forward_block_archive select * from staging2.ihtsll_sll_forward_block;
|
||||
insert into archive.ihtsll_sll_h1_block_archive select * from staging2.ihtsll_sll_h1_block;
|
||||
insert into archive.ihtsll_sll_lead_lag_block_archive select * from staging2.ihtsll_sll_lead_lag_block;
|
||||
insert into archive.ihtsll_sll_reverse_block_archive select * from staging2.ihtsll_sll_reverse_block;
|
||||
insert into archive.ihtsll_sll_tyre_details_block_archive select * from staging2.ihtsll_sll_tyre_details_block;
|
||||
insert into archive.ihtsll_sll_weight_block_archive select * from staging2.ihtsll_sll_weight_block;
|
||||
insert into archive.ihtsll_sll_wheel_block_archive select * from staging2.ihtsll_sll_wheel_block;
|
||||
insert into archive.ptoben_gvg_performance_governing_trails_block_archive select * from staging2.ptoben_gvg_performance_governing_trails_block;
|
||||
insert into archive.ptoben_mpm_performance_boost_natural_block_archive select * from staging2.ptoben_mpm_performance_boost_natural_block;
|
||||
insert into archive.ptoben_prf_2hrs_max_power_natural_ambient_block_archive select * from staging2.ptoben_prf_2hrs_max_power_natural_ambient_block;
|
||||
insert into archive.ptoben_prf_2hrs_max_power_test_high_ambient_block_archive select * from staging2.ptoben_prf_2hrs_max_power_test_high_ambient_block;
|
||||
insert into archive.ptoben_prf_engine_oil_consumption_block_archive select * from staging2.ptoben_prf_engine_oil_consumption_block;
|
||||
insert into archive.ptoben_prf_key_performance_parameters_block_archive select * from staging2.ptoben_prf_key_performance_parameters_block;
|
||||
insert into archive.ptoben_prf_smoke_test_block_archive select * from staging2.ptoben_prf_smoke_test_block;
|
||||
insert into archive.ptoben_prf_tractor_specs_block_archive select * from staging2.ptoben_prf_tractor_specs_block;
|
||||
insert into archive.ptoben_prf_varying_load_rated_rpm_block_archive select * from staging2.ptoben_prf_varying_load_rated_rpm_block;
|
||||
insert into archive.ptoben_prf_varying_load_std_pto_block_archive select * from staging2.ptoben_prf_varying_load_std_pto_block;
|
||||
insert into archive.ptoben_prf_varying_speed_natural_ambient_block_archive select * from staging2.ptoben_prf_varying_speed_natural_ambient_block;
|
||||
insert into archive.ptoben_prf_varying_speed_test_high_ambient_block_archive select * from staging2.ptoben_prf_varying_speed_test_high_ambient_block;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'archive function success', end_status='success',end_time= now() where job_id=6 and step_id=1 and latest_runschedule_flag='1';
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'Archive', 'fn_block_archive', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
EXCEPTION when OTHERS then
|
||||
GET STACKED DIAGNOSTICS
|
||||
err_state = returned_sqlstate, /* P0002 */
|
||||
err_msg = message_text, /* No Data in FTDRY */
|
||||
err_detail = pg_exception_detail, /* No data in table t_test_new */
|
||||
err_hint = pg_exception_hint, /* No data error capture */
|
||||
err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/
|
||||
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'archive function failed', end_status='error' ,end_time= now() where job_id=6 and step_id=1 and latest_runschedule_flag='1';
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'Archive', 'fn_block_archive', err_state, err_msg, err_detail, err_hint, err_context,'error');
|
||||
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
1
MMT_latest_version/sql/onetime/archive/schema/drop.sql
Normal file
1
MMT_latest_version/sql/onetime/archive/schema/drop.sql
Normal file
@@ -0,0 +1 @@
|
||||
drop schema if exists archive cascade;
|
||||
@@ -0,0 +1,332 @@
|
||||
|
||||
--drop function if exists fw_core.fn_check_count();
|
||||
|
||||
CREATE or REPLACE FUNCTION fw_core.fn_check_count(p_date date)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
|
||||
|
||||
declare __client_id int :=21;
|
||||
declare __function_id int :=1;
|
||||
declare __file_mnemonic text := null;
|
||||
declare __file_sheet_mnemonic text :=null;
|
||||
declare __file_syspk int := null;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
|
||||
begin
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_brake_perf_parking_brake_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_brake_perf_parking_brake_test_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_brake_perf_service_brake_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_brake_perf_service_brake_test_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_centre_of_gravity_location',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_centre_of_gravity_location a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_drawbar_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_drawbar_perf_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_field_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_field_perf_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_haulage_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_haulage_perf_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_hydraulic_lifting_capacity_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_hydraulic_lifting_capacity_test_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_hydraulic_maint_of_lift_load_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_hydraulic_maint_of_lift_load_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_hydraulic_power_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_hydraulic_power_test_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_noise_atmospheric_conditions',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_noise_atmospheric_conditions a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_noise_measurement_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_noise_measurement_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_pto_perf_results_details',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_pto_perf_results_details a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_pto_perf_results_summary',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_pto_perf_results_summary a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_test_observations',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_test_observations a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'budni_vibration_measurement',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.budni_vibration_measurement a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'drawbar_perf_observations',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.drawbar_perf_observations a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'drawbar_perf_oecd_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.drawbar_perf_oecd_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'drawbar_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.drawbar_perf_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'drawbar_perf_results_summary',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.drawbar_perf_results_summary a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'field_perf_summary',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.field_perf_summary a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
--insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'field_perf_summary_implement_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.field_perf_summary_implement_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'field_perf_summary_tractor_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.field_perf_summary_tractor_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
--insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'field_perf_summary_trailer_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.field_perf_summary_trailer_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_brake_pedal_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_brake_pedal_effort a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_brake_perf_test_condition',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_brake_perf_test_condition a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_brake_perf_test_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_brake_perf_test_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_cgm_lifting_angle_load_details',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_cgm_lifting_angle_load_details a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_cgm_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_cgm_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_clutch_pedal_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_clutch_pedal_effort a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_gear_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_gear_effort a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_gear_max_speed',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_gear_max_speed a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_hot_air_mapping_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_hot_air_mapping_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_hyd_lift_sensitivity',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_hyd_lift_sensitivity a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_noise_measurement_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_noise_measurement_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_noise_measurement_test',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_noise_measurement_test a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_pedal_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_pedal_effort a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_speed_lead_lag_measurement',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_speed_lead_lag_measurement a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_steering_effort',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_steering_effort a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'iht_steering_effort_raw_data',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.iht_steering_effort_raw_data a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'pto_engine_oil_consumption',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.pto_engine_oil_consumption a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'pto_key_perf_parameters',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.pto_key_perf_parameters a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'pto_multipoint_mapping',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.pto_multipoint_mapping a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'pto_perf_governing_graph',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.pto_perf_governing_graph a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'pto_perf_results',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.pto_perf_results a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'pto_smoke_test',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.pto_smoke_test a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_atmospheric_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_atmospheric_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_drawbar_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_drawbar_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_engine_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_engine_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_equipment_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_equipment_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_fuel_lubricant_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_fuel_lubricant_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_gear_speed_chart',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_gear_speed_chart a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
--insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_images',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_images a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
--insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_implement_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_implement_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_measurement_uncertainty',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_measurement_uncertainty a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_tractor_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_tractor_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_tractor_info_misc',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_tractor_info_misc a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
--insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_trailer_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_trailer_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_tyre_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_tyre_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_weight_reaction',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_weight_reaction a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
insert into fw_core.check_model_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,tractor_name,row_count) select 'test_instance_wheels_info',file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model,count(*) from transactional.test_instance_wheels_info a where a.create_timestamp::timestamp::date =p_date group by file_syspk,file_mnemonic,file_sheet_mnemonic,tractor_model;
|
||||
|
||||
|
||||
|
||||
insert into fw_core.check_mnemonic_count(table_name,syspks,file_mnemonic,file_sheet_mnemonic,row_count)
|
||||
SELECT table_name, syspks, file_mnemonic, file_sheet_mnemonic,sum(row_count)
|
||||
FROM fw_core.check_model_count
|
||||
where create_timestamp::date=p_date
|
||||
group by table_name, syspks, file_mnemonic, file_sheet_mnemonic;
|
||||
|
||||
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_arc_perf_atmos_meas_test_block',count(*) from staging2.budni_arc_perf_atmos_meas_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_arc_spec_h1_block',count(*) from staging2.budni_arc_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_arc_test_obs_summary_block',count(*) from staging2.budni_arc_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_other_observations_block',count(*) from staging2.budni_brk_other_observations_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_parking_barke_test_block',count(*) from staging2.budni_brk_parking_barke_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_ballasted_25kmph_block',count(*) from staging2.budni_brk_service_cold_ballasted_25kmph_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_ballasted_maximum_block',count(*) from staging2.budni_brk_service_cold_ballasted_maximum_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_standard_25kmph_block',count(*) from staging2.budni_brk_service_cold_standard_25kmph_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_cold_standard_maximum_block',count(*) from staging2.budni_brk_service_cold_standard_maximum_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_fade_ballasted_25kmph_block',count(*) from staging2.budni_brk_service_fade_ballasted_25kmph_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_service_fade_standard_maximum_block',count(*) from staging2.budni_brk_service_fade_standard_maximum_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_spec_h1_block',count(*) from staging2.budni_brk_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_brk_test_obs_summary_block',count(*) from staging2.budni_brk_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_dbp_drawbar_perf_block',count(*) from staging2.budni_dbp_drawbar_perf_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_dbp_spec_h1_block',count(*) from staging2.budni_dbp_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_fld_cage_wheel_block',count(*) from staging2.budni_fld_cage_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_fld_impl_test_block',count(*) from staging2.budni_fld_impl_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_fld_spec_h1_block',count(*) from staging2.budni_fld_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_fld_sum_perf_test_block',count(*) from staging2.budni_fld_sum_perf_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_fld_test_obs_summary_block',count(*) from staging2.budni_fld_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_lifting_capacity_test_block',count(*) from staging2.budni_hdl_lifting_capacity_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_maintenance_of_lift_load_block',count(*) from staging2.budni_hdl_maintenance_of_lift_load_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_power_test_block',count(*) from staging2.budni_hdl_power_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_spec_h1_block',count(*) from staging2.budni_hdl_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hdl_test_obs_summary_block',count(*) from staging2.budni_hdl_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hlg_perf_test_block',count(*) from staging2.budni_hlg_perf_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hlg_spec_h1_block',count(*) from staging2.budni_hlg_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_hlg_test_obs_summary_block',count(*) from staging2.budni_hlg_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_lcg_gravity_test_block',count(*) from staging2.budni_lcg_gravity_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_lcg_spec_h1_block',count(*) from staging2.budni_lcg_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_atmos_cond_2_block',count(*) from staging2.budni_nmt_atmos_cond_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_meas_results_1_block',count(*) from staging2.budni_nmt_meas_results_1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_meas_results_2_block',count(*) from staging2.budni_nmt_meas_results_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_noise_at_bystander_position_block',count(*) from staging2.budni_nmt_noise_at_bystander_position_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_noise_at_operator_ear_level_block',count(*) from staging2.budni_nmt_noise_at_operator_ear_level_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_spec_h1_block',count(*) from staging2.budni_nmt_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_nmt_test_obs_summary_block',count(*) from staging2.budni_nmt_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_pto_mmtkeyword1_block',count(*) from staging2.budni_pto_mmtkeyword1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_pto_mmtkeyword2_block',count(*) from staging2.budni_pto_mmtkeyword2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_pto_perf_report_block',count(*) from staging2.budni_pto_perf_report_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_pto_spec_h1_block',count(*) from staging2.budni_pto_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_pto_summary_block',count(*) from staging2.budni_pto_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_vmt_perf_meas_test_block',count(*) from staging2.budni_vmt_perf_meas_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_vmt_spec_h1_block',count(*) from staging2.budni_vmt_spec_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','budni_vmt_test_obs_summary_block',count(*) from staging2.budni_vmt_test_obs_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_drawbar_performance_fuel_consumption_block',count(*) from staging2.dboecd_test_drawbar_performance_fuel_consumption_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_drawbar_performance_gear_performance_block',count(*) from staging2.dboecd_test_drawbar_performance_gear_performance_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_drawbar_performance_selected_summary_block',count(*) from staging2.dboecd_test_drawbar_performance_selected_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_engine_to_pto_block',count(*) from staging2.dboecd_test_engine_rpm_engine_to_pto_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_required_pull_block',count(*) from staging2.dboecd_test_engine_rpm_required_pull_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_rpm_block',count(*) from staging2.dboecd_test_engine_rpm_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_tyre_details_block',count(*) from staging2.dboecd_test_engine_rpm_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_engine_rpm_weight_block',count(*) from staging2.dboecd_test_engine_rpm_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_h1_block',count(*) from staging2.dboecd_test_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_measurement_uncertainty_block',count(*) from staging2.dboecd_test_measurement_uncertainty_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_remarks_block',count(*) from staging2.dboecd_test_remarks_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_remarks_footer_block',count(*) from staging2.dboecd_test_remarks_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_test_condition_block',count(*) from staging2.dboecd_test_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_test_equipment_used_block',count(*) from staging2.dboecd_test_test_equipment_used_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_cleaner_block',count(*) from staging2.dboecd_test_tractor_specifications_cleaner_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_cylinders_block',count(*) from staging2.dboecd_test_tractor_specifications_cylinders_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_engine_details_block',count(*) from staging2.dboecd_test_tractor_specifications_engine_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_tractor_specifications_fuel_and_injection_block',count(*) from staging2.dboecd_test_tractor_specifications_fuel_and_injection_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_clutch_block',count(*) from staging2.dboecd_test_transmission_clutch_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_drawbar_block',count(*) from staging2.dboecd_test_transmission_drawbar_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_fuel_lubricant_block',count(*) from staging2.dboecd_test_transmission_fuel_lubricant_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_speed_chart_block',count(*) from staging2.dboecd_test_transmission_speed_chart_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_speed_chart_desc_block',count(*) from staging2.dboecd_test_transmission_speed_chart_desc_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dboecd_test_transmission_wheels_block',count(*) from staging2.dboecd_test_transmission_wheels_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_drawbar_performance_gear_performance_block',count(*) from staging2.dbstd_test_drawbar_performance_gear_performance_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_drawbar_performance_selected_summary_block',count(*) from staging2.dbstd_test_drawbar_performance_selected_summary_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_engine_to_pto_block',count(*) from staging2.dbstd_test_engine_rpm_engine_to_pto_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_required_pull_block',count(*) from staging2.dbstd_test_engine_rpm_required_pull_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_rpm_block',count(*) from staging2.dbstd_test_engine_rpm_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_tyre_details_block',count(*) from staging2.dbstd_test_engine_rpm_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_engine_rpm_weight_block',count(*) from staging2.dbstd_test_engine_rpm_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_h1_block',count(*) from staging2.dbstd_test_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_measurement_uncertainty_block',count(*) from staging2.dbstd_test_measurement_uncertainty_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_remarks_block',count(*) from staging2.dbstd_test_remarks_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_remarks_footer_block',count(*) from staging2.dbstd_test_remarks_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_test_condition_block',count(*) from staging2.dbstd_test_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_test_equipment_used_block',count(*) from staging2.dbstd_test_test_equipment_used_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_cleaner_block',count(*) from staging2.dbstd_test_tractor_specifications_cleaner_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_cylinders_block',count(*) from staging2.dbstd_test_tractor_specifications_cylinders_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_engine_details_block',count(*) from staging2.dbstd_test_tractor_specifications_engine_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_tractor_specifications_fuel_and_injection_block',count(*) from staging2.dbstd_test_tractor_specifications_fuel_and_injection_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_clutch_block',count(*) from staging2.dbstd_test_transmission_clutch_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_drawbar_block',count(*) from staging2.dbstd_test_transmission_drawbar_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_fuel_lubricant_block',count(*) from staging2.dbstd_test_transmission_fuel_lubricant_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_speed_chart_block',count(*) from staging2.dbstd_test_transmission_speed_chart_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_speed_chart_desc_block',count(*) from staging2.dbstd_test_transmission_speed_chart_desc_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','dbstd_test_transmission_wheels_block',count(*) from staging2.dbstd_test_transmission_wheels_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_comments_by_block',count(*) from staging2.ftdry_sum_comments_by_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_implement_block',count(*) from staging2.ftdry_sum_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_test_condition_1_block',count(*) from staging2.ftdry_sum_test_condition_1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_test_condition_2_block',count(*) from staging2.ftdry_sum_test_condition_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_sum_trac_h1_block',count(*) from staging2.ftdry_sum_trac_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_engine_rpm_block',count(*) from staging2.ftdry_trs_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_h1_block',count(*) from staging2.ftdry_trs_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_implement_block',count(*) from staging2.ftdry_trs_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftdry_trs_spec_block',count(*) from staging2.ftdry_trs_spec_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_comments_by_block',count(*) from staging2.fthlg_sum_comments_by_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_test_condition_1_block',count(*) from staging2.fthlg_sum_test_condition_1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_test_condition_2_block',count(*) from staging2.fthlg_sum_test_condition_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_trac_h1_block',count(*) from staging2.fthlg_sum_trac_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_sum_trail_type_block',count(*) from staging2.fthlg_sum_trail_type_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_engine_rpm_block',count(*) from staging2.fthlg_trs_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_h1_block',count(*) from staging2.fthlg_trs_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_spec_block',count(*) from staging2.fthlg_trs_spec_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','fthlg_trs_trailer_block',count(*) from staging2.fthlg_trs_trailer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_cage_wheel_block',count(*) from staging2.ftwet_sum_cage_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_comments_by_block',count(*) from staging2.ftwet_sum_comments_by_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_implement_block',count(*) from staging2.ftwet_sum_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_test_condition_block',count(*) from staging2.ftwet_sum_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_sum_trac_h1_block',count(*) from staging2.ftwet_sum_trac_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_engine_rpm_block',count(*) from staging2.ftwet_trs_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_h1_block',count(*) from staging2.ftwet_trs_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_implement_block',count(*) from staging2.ftwet_trs_implement_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ftwet_trs_spec_block',count(*) from staging2.ftwet_trs_spec_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_footer_block',count(*) from staging2.ihtbt30_bt30_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_h1_block',count(*) from staging2.ihtbt30_bt30_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_condition_block',count(*) from staging2.ihtbt30_bt30_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_1_block',count(*) from staging2.ihtbt30_bt30_test_res_1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_2_block',count(*) from staging2.ihtbt30_bt30_test_res_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_3_block',count(*) from staging2.ihtbt30_bt30_test_res_3_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_test_res_4_block',count(*) from staging2.ihtbt30_bt30_test_res_4_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_tyre_details_block',count(*) from staging2.ihtbt30_bt30_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt30_bt30_weight_block',count(*) from staging2.ihtbt30_bt30_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_footer_block',count(*) from staging2.ihtbt50_bt50_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_h1_block',count(*) from staging2.ihtbt50_bt50_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_condition_block',count(*) from staging2.ihtbt50_bt50_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_1_block',count(*) from staging2.ihtbt50_bt50_test_res_1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_2_block',count(*) from staging2.ihtbt50_bt50_test_res_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_3_block',count(*) from staging2.ihtbt50_bt50_test_res_3_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_test_res_4_block',count(*) from staging2.ihtbt50_bt50_test_res_4_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_tyre_details_block',count(*) from staging2.ihtbt50_bt50_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbt50_bt50_weight_block',count(*) from staging2.ihtbt50_bt50_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_footer_block',count(*) from staging2.ihtbtd_btd_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_h1_block',count(*) from staging2.ihtbtd_btd_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_condition_block',count(*) from staging2.ihtbtd_btd_test_condition_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_1_block',count(*) from staging2.ihtbtd_btd_test_res_1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_2_block',count(*) from staging2.ihtbtd_btd_test_res_2_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_3_block',count(*) from staging2.ihtbtd_btd_test_res_3_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_4_block',count(*) from staging2.ihtbtd_btd_test_res_4_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_5_block',count(*) from staging2.ihtbtd_btd_test_res_5_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_test_res_6_block',count(*) from staging2.ihtbtd_btd_test_res_6_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_tyre_details_block',count(*) from staging2.ihtbtd_btd_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtbtd_btd_weight_block',count(*) from staging2.ihtbtd_btd_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_footer_block',count(*) from staging2.ihtcgm_cgm_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_h1_block',count(*) from staging2.ihtcgm_cgm_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_lifting_block',count(*) from staging2.ihtcgm_cgm_lifting_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_results_block',count(*) from staging2.ihtcgm_cgm_results_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_tyre_details_block',count(*) from staging2.ihtcgm_cgm_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_weight_block',count(*) from staging2.ihtcgm_cgm_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtcgm_cgm_wheel_block',count(*) from staging2.ihtcgm_cgm_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_brake_pedal_block',count(*) from staging2.ihtemt_emt_brake_pedal_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_footer_block',count(*) from staging2.ihtemt_emt_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_h1_block',count(*) from staging2.ihtemt_emt_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_pedal_block',count(*) from staging2.ihtemt_emt_pedal_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_steering_block',count(*) from staging2.ihtemt_emt_steering_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_tyre_details_block',count(*) from staging2.ihtemt_emt_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_weight_block',count(*) from staging2.ihtemt_emt_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_emt_wheel_block',count(*) from staging2.ihtemt_emt_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtemt_std_raw_data_block',count(*) from staging2.ihtemt_std_raw_data_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_atmos_cond_block',count(*) from staging2.ihtham_ham_atmos_cond_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_drawbar_block',count(*) from staging2.ihtham_ham_drawbar_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_engine_rpm_block',count(*) from staging2.ihtham_ham_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_footer_block',count(*) from staging2.ihtham_ham_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_h1_block',count(*) from staging2.ihtham_ham_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_results_block',count(*) from staging2.ihtham_ham_results_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_tractor_block',count(*) from staging2.ihtham_ham_tractor_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_tyre_details_block',count(*) from staging2.ihtham_ham_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtham_ham_weight_block',count(*) from staging2.ihtham_ham_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_footer_block',count(*) from staging2.ihthls_hls_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_h1_block',count(*) from staging2.ihthls_hls_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_numeric_block',count(*) from staging2.ihthls_hls_numeric_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_tyre_details_block',count(*) from staging2.ihthls_hls_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_weight_block',count(*) from staging2.ihthls_hls_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihthls_hls_wheel_block',count(*) from staging2.ihthls_hls_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_atmos_cond_block',count(*) from staging2.ihtnst_nst_atmos_cond_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_engine_rpm_block',count(*) from staging2.ihtnst_nst_engine_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_footer_block',count(*) from staging2.ihtnst_nst_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_h1_block',count(*) from staging2.ihtnst_nst_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_oel_noise_block',count(*) from staging2.ihtnst_nst_oel_noise_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_oel_noise_load_block',count(*) from staging2.ihtnst_nst_oel_noise_load_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_stand_noise_block',count(*) from staging2.ihtnst_nst_stand_noise_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_tyre_details_block',count(*) from staging2.ihtnst_nst_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtnst_nst_weight_block',count(*) from staging2.ihtnst_nst_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_footer_block',count(*) from staging2.ihtsll_sll_footer_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_forward_block',count(*) from staging2.ihtsll_sll_forward_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_h1_block',count(*) from staging2.ihtsll_sll_h1_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_lead_lag_block',count(*) from staging2.ihtsll_sll_lead_lag_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_reverse_block',count(*) from staging2.ihtsll_sll_reverse_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_tyre_details_block',count(*) from staging2.ihtsll_sll_tyre_details_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_weight_block',count(*) from staging2.ihtsll_sll_weight_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ihtsll_sll_wheel_block',count(*) from staging2.ihtsll_sll_wheel_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_gvg_performance_governing_trails_block',count(*) from staging2.ptoben_gvg_performance_governing_trails_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_mpm_performance_boost_natural_block',count(*) from staging2.ptoben_mpm_performance_boost_natural_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_2hrs_max_power_natural_ambient_block',count(*) from staging2.ptoben_prf_2hrs_max_power_natural_ambient_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_2hrs_max_power_test_high_ambient_block',count(*) from staging2.ptoben_prf_2hrs_max_power_test_high_ambient_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_engine_oil_consumption_block',count(*) from staging2.ptoben_prf_engine_oil_consumption_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_key_performance_parameters_block',count(*) from staging2.ptoben_prf_key_performance_parameters_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_smoke_test_block',count(*) from staging2.ptoben_prf_smoke_test_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_tractor_specs_block',count(*) from staging2.ptoben_prf_tractor_specs_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_load_rated_rpm_block',count(*) from staging2.ptoben_prf_varying_load_rated_rpm_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_load_std_pto_block',count(*) from staging2.ptoben_prf_varying_load_std_pto_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_speed_natural_ambient_block',count(*) from staging2.ptoben_prf_varying_speed_natural_ambient_block where create_time::date =p_date;
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count) select 'staging2','ptoben_prf_varying_speed_test_high_ambient_block',count(*) from staging2.ptoben_prf_varying_speed_test_high_ambient_block where create_time::date =p_date;
|
||||
|
||||
insert into fw_core.check_table_stg_trx_count(schema_name,table_name,row_count)
|
||||
select 'transactional',table_name, sum(row_count)
|
||||
from fw_core.check_model_count
|
||||
where create_timestamp::date =p_date
|
||||
group by table_name;
|
||||
|
||||
|
||||
|
||||
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'check count success', end_status='success',end_time= now() where job_id=7 and step_id=1 and latest_runschedule_flag='1';
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'Check_Count', 'fn_check_count', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
EXCEPTION when OTHERS then
|
||||
|
||||
err_state = returned_sqlstate, /* P0002 */
|
||||
err_msg = message_text, /* No Data in FTDRY */
|
||||
err_detail = pg_exception_detail, /* No data in table t_test_new */
|
||||
err_hint = pg_exception_hint, /* No data error capture */
|
||||
err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE*/
|
||||
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'check count failed', end_status='error' ,end_time= now() where job_id=7 and step_id=1 and latest_runschedule_flag='1';
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'Check_Count', 'fn_check_count', err_state, err_msg, err_detail, err_hint, err_context,'error');
|
||||
|
||||
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
drop function if exists fw_core.fn_get_function_exception;
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_get_function_exception(p_function_name text)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
|
||||
declare __client_id int ;
|
||||
declare __function_id int ;
|
||||
declare __file_mnemonic text ;
|
||||
declare __file_sheet_mnemonic text ;
|
||||
declare __file_syspk int ;
|
||||
declare __fname text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare function_query text;
|
||||
declare err_function text;
|
||||
declare v_function_parameter text;
|
||||
declare v_function_name text;
|
||||
declare v_function_name_len int;
|
||||
declare v_pos_ind int;
|
||||
|
||||
begin
|
||||
|
||||
function_query := 'select ' || p_function_name;
|
||||
select length(p_function_name) into v_function_name_len;
|
||||
select position('(' in p_function_name) into v_pos_ind;
|
||||
select substring(p_function_name,0, v_pos_ind) into v_function_name;
|
||||
select substring(p_function_name, v_pos_ind + 1, v_function_name_len - v_pos_ind - 1) into v_function_parameter;
|
||||
|
||||
select SPLIT_PART(v_function_parameter,',',1) into __client_id;
|
||||
select SPLIT_PART(v_function_parameter,',',2) into __function_id;
|
||||
select SPLIT_PART(v_function_parameter,',',3) into __file_mnemonic;
|
||||
select SPLIT_PART(v_function_parameter,',',4) into __file_sheet_mnemonic;
|
||||
select SPLIT_PART(v_function_parameter,',',5) into __file_syspk;
|
||||
select trim('''' from __file_mnemonic) into __file_mnemonic;
|
||||
select trim('''' from __file_sheet_mnemonic) into __file_sheet_mnemonic;
|
||||
|
||||
execute function_query;
|
||||
/* staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',100) */
|
||||
|
||||
EXCEPTION when OTHERS then
|
||||
|
||||
GET STACKED DIAGNOSTICS
|
||||
err_state = returned_sqlstate, /* P0002 */
|
||||
err_msg = message_text, /* No Data in FTDRY */
|
||||
err_detail = pg_exception_detail, /* No data in table t_test_new */
|
||||
err_hint = pg_exception_hint, /* No data error capture */
|
||||
err_context = pg_exception_context; /* PL/pgSQL function staging2.fn_ftdry_trs_block(integer,integer,text,text,integer) line 69 at RAISE
|
||||
SQL statement "select staging2.fn_FTDRY_TRS_Block(20,1,'FTDRY','FTDRY_TRS',100)"
|
||||
PL/pgSQL function trx.fn_get_function_exception(character varying) line 36 at EXECUTE */
|
||||
|
||||
if v_function_name like '%Block%' then
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,v_function_name,'stg2', null, err_state, err_msg, err_detail, err_hint, err_context,'error');
|
||||
else
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,v_function_name,'trx', null, err_state, err_msg, err_detail, err_hint, err_context,'error');
|
||||
end if;
|
||||
END;
|
||||
$function$
|
||||
@@ -0,0 +1,25 @@
|
||||
DROP FUNCTION IF EXISTS fw_core.fn_insert_DB_error;
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_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 fw_core.DB_Run_Status ( client_Id, function_id, user_id, user_name, file_syspk, file_mnemonic, file_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;
|
||||
@@ -0,0 +1,69 @@
|
||||
--drop function if exists fn_info_column_dq();
|
||||
|
||||
CREATE OR REPLACE function fn_info_column_dq(schemaname text)
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
statements text;
|
||||
begin
|
||||
/************************************************************
|
||||
Function Name:fn_info_column_dq
|
||||
Function Desc: This function populates data into given schema. This function creates temporary table which stores SQL queires
|
||||
and later through for loop each temporary sql statement is executed.
|
||||
Function concept: uses concat method to create a insert statement, 2 different statements are provided (choose any).
|
||||
Creation Date: 06-June-2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select fn_info_column_dq('transactional');
|
||||
Data Access: select * from info_column_dq;
|
||||
***************************************************************/
|
||||
-- Accessing information from information_schema and computing the required data
|
||||
-- Storing the data in config db table
|
||||
-- Execute this if the table does not exits or when the db is new
|
||||
execute 'SET search_path to '''||schemaname||'''';
|
||||
|
||||
DROP table if exists info_column_dq;
|
||||
create table info_column_dq (
|
||||
table_schema text null,
|
||||
table_name text NULL,
|
||||
column_name text NULL,
|
||||
column_data_type text NULL,
|
||||
column_unique_count int null,
|
||||
column_min_value text null,
|
||||
column_max_value text null,
|
||||
column_null_count int null,
|
||||
create_timestamp timestamp not NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
-- Temporary table to store queries : create
|
||||
--drop table if exists queries;
|
||||
create temp table queries (sqlquery text null);
|
||||
-- Temporary table to store queries : insert data
|
||||
insert into queries(sqlquery)
|
||||
select
|
||||
-- without using time-stamp::Date:
|
||||
concat('insert into info_column_dq(table_schema,table_name,column_name,column_data_type,column_unique_count,column_min_value,column_max_value,column_null_count) select ''',c.table_schema,''',''',c.table_name,''',''', c.column_name,''',''', c.data_type,''',','count(distinct ',c.column_name,'),','min(',c.column_name,'),','max(',c.column_name,'),','SUM(CASE WHEN ',c.column_name ,' IS NULL THEN 1 ELSE 0 END) from ',c.table_schema,'.',c.table_name,';')
|
||||
-- with using time-stamp::Date:
|
||||
--concat('insert into info_column_dq(table_schema,table_name,column_name,column_data_type,column_unique_count,column_min_value,column_max_value,column_null_count) select ''',c.table_schema,''',''',c.table_name,''',''', c.column_name,''',''', c.data_type,''',','count(distinct ',c.column_name,'),','min(',c.column_name,'),','max(',c.column_name,'),','SUM(CASE WHEN ',c.column_name ,' IS NULL THEN 1 ELSE 0 END) from ',c.table_schema,'.',c.table_name,' where create_timestamp :: date >= now() ::Date;')
|
||||
from information_schema."columns" c
|
||||
where c.table_schema in (''||schemaname||'')
|
||||
and c.table_name != 'info_column_dq'
|
||||
and not c.data_type in ('bytea','boolean');
|
||||
--and c.table_name !='test_instance_images'
|
||||
--and not c.column_name in ('create_timestamp','update_timestamp');
|
||||
-- executing the stored queries from temporary queries table: Loop the column data and execute each statement
|
||||
for statements in select sqlquery from queries
|
||||
loop
|
||||
execute(statements);
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
select fn_info_column_dq('transactional');
|
||||
select * from info_column_dq;
|
||||
--gives error
|
||||
--insert into fw_core.info_column_dq(table_schema,table_name,column_name,column_data_type,column_unique_count,column_min_value,column_max_value) select 'transactional','test_instance_images','image','bytea',count(distinct image),min(image),max(image) from transactional.test_instance_images;
|
||||
*/
|
||||
@@ -0,0 +1,14 @@
|
||||
drop function if exists fw_core.fn_jobctl_block_begin;
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_jobctl_block_begin(p_client_id int,p_function_id int,p_file_syspk int,p_block_table_name text,p_file_mnemonic text,p_file_sheet_mnemonic text,p_block_seq int)
|
||||
RETURNS void AS $$
|
||||
begin
|
||||
|
||||
/*************************
|
||||
select staging2.fn_jobctrl_block_begin(1,2,255,'block1','file','sheet',1)
|
||||
***********************/
|
||||
|
||||
execute 'insert into fw_core.fw_jobctl_file_sheet_block_run_schedule
|
||||
(client_id,function_id,file_syspk,block_table_name,file_mnemonic,file_sheet_mnemonic,begin_status,block_table_load_seq,start_time)
|
||||
select '||p_client_id||', '||p_function_id||', '''||p_file_syspk||''','''||p_block_table_name||''','''||p_file_mnemonic||''','''||p_file_sheet_mnemonic||''',1,'||p_block_seq||',current_timestamp';
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
@@ -0,0 +1,14 @@
|
||||
drop function if exists fw_core.fn_jobctl_block_end;
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_jobctl_block_end(p_file_syspk int,p_block_table_name text)
|
||||
RETURNS void AS $$
|
||||
begin
|
||||
|
||||
/*********************************
|
||||
select staging2.fn_jobctrl_block_end(255,'block1')
|
||||
*********************************/
|
||||
|
||||
execute 'update fw_core.fw_jobctl_file_sheet_block_run_schedule set end_status=1 , end_time=now(), end_status_note=''completed''
|
||||
where file_syspk='''||p_file_syspk||'''and block_table_name='''||p_block_table_name||'''';
|
||||
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
@@ -0,0 +1,114 @@
|
||||
drop function if exists staging2.fn_run_post_generic_validation;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_run_post_generic_validation()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
trx_record_count int;
|
||||
keyword_match_count int;
|
||||
missing_sheet_count int;
|
||||
error_sum int;
|
||||
|
||||
-- validate file already loaded in the Transactional DB :
|
||||
|
||||
begin
|
||||
for f in select distinct file_syspk from fw_core.fw_jobctl_file_runschedule
|
||||
where latest_runschedule_flag = '1' and end_status != 'error' --and end_status_note = 'stg1_completed'
|
||||
loop
|
||||
select count(*) from transactional.test_instance where file_syspk = f.file_syspk into trx_record_count;
|
||||
if trx_record_count > 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'generic_post_validation_failed', end_status='error', end_time= now() where job_id = 1 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
return;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'generic_post_validation_success', end_status='success' , end_time= now() where job_id = 1 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
|
||||
|
||||
|
||||
-- validate sheet names for a given file:
|
||||
|
||||
for f in select distinct file_syspk,file_mnemonic,file_sheet_mnemonic from fw_core.fw_jobctl_file_sheet_runschedule
|
||||
where file_sheet_mnemonic is not null
|
||||
and end_status != 'error' and end_status_note = 'stg1_completed' and latest_runschedule_flag = '1'
|
||||
loop
|
||||
select count(distinct sheet_name) from fw_core.test_file_sheet_format_master
|
||||
where sheet_name not in
|
||||
(select distinct sheet_name from fw_core.fw_jobctl_file_sheet_runschedule where file_mnemonic in (f.file_mnemonic) and file_sheet_mnemonic is not null)
|
||||
and file_mnemonic in (f.file_mnemonic)
|
||||
into missing_sheet_count;
|
||||
|
||||
if missing_sheet_count!=0 then
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg1_sheet_missing', end_status='error', staging_type = 'stg1',end_time = now() where
|
||||
file_syspk = f.file_syspk and file_sheet_mnemonic=f.file_sheet_mnemonic;
|
||||
else
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg1_completed', end_status='success', staging_type = 'stg1',end_time = now() where
|
||||
file_syspk = f.file_syspk and file_sheet_mnemonic=f.file_sheet_mnemonic;
|
||||
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
SELECT SUM (case WHEN end_status = 'success' THEN 0
|
||||
ELSE 1 END) AS "Error Sum" FROM fw_core.fw_jobctl_file_sheet_runschedule where latest_runschedule_flag = '1' INTO error_sum;
|
||||
if error_sum = 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'stg1_completed', end_status='success', end_time=now() where job_id = 1 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
else
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'stg1_sheet_missing', end_status='error', end_time=now() where job_id = 1 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
return ;
|
||||
end if;
|
||||
|
||||
|
||||
|
||||
-- validate keywords for a given file:
|
||||
|
||||
for f in select distinct file_syspk,file_mnemonic,file_sheet_mnemonic
|
||||
from fw_core.fw_jobctl_file_sheet_runschedule where file_sheet_mnemonic !=''
|
||||
and end_status != 'error' and end_status_note = 'stg1_completed'
|
||||
order by file_syspk
|
||||
loop
|
||||
select case when file_sheet_mnemonic in ('FTDRY_SUM','FTHLG_SUM')then count(column2)-2 else count(column2) end
|
||||
from staging1.staging_generic_table where column2
|
||||
in (select f1_keyword from transactional.source_config a
|
||||
where a.file_mnemonic=f.file_mnemonic and a.file_sheet_mnemonic=f.file_sheet_mnemonic )
|
||||
and file_mnemonic=f.file_mnemonic and file_sheet_mnemonic=f.file_sheet_mnemonic and file_syspk = f.file_syspk group by file_sheet_mnemonic into keyword_match_count;
|
||||
|
||||
if keyword_match_count != (select count(f1_keyword) from transactional.source_config a
|
||||
where a.file_mnemonic=f.file_mnemonic and a.file_sheet_mnemonic=f.file_sheet_mnemonic) then
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg1_keyword_validation_failed', end_status='error', staging_type = 'stg1',end_time = now() where
|
||||
file_syspk = f.file_syspk and file_sheet_mnemonic=f.file_sheet_mnemonic;
|
||||
else
|
||||
update fw_core.fw_jobctl_file_sheet_runschedule set end_status_note = 'stg1_completed', end_status='success', staging_type = 'stg1',end_time = now() where
|
||||
file_syspk = f.file_syspk and file_sheet_mnemonic=f.file_sheet_mnemonic;
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
SELECT SUM (case WHEN end_status = 'success' THEN 0
|
||||
ELSE 1 END) AS "Error Sum" FROM fw_core.fw_jobctl_file_sheet_runschedule where latest_runschedule_flag = '1' INTO error_sum;
|
||||
if error_sum = 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'stg1_keyword_validation_success', end_status='success', end_time=now() where job_id = 1 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
else
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'stg1_keyword_validation_failed', end_status='error', end_time=now() where job_id = 1 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
end if;
|
||||
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
drop function if exists staging2.fn_run_trx_post_validation;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_run_trx_post_validation()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
trx_record_count int;
|
||||
-- validate Trx data record loading:
|
||||
begin
|
||||
for f in select distinct file_syspk from fw_core.fw_jobctl_file_runschedule
|
||||
where latest_runschedule_flag = '1' and end_status != 'error' and end_status_note = 'trx_completed'
|
||||
loop
|
||||
select count(*) from transactional.test_instance where file_syspk = f.file_syspk into trx_record_count;
|
||||
if trx_record_count = 0 then
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'trx_post_validation_failed', end_status='error', end_time= now() where job_id = 2 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
update fw_core.fw_jobctl_runschedule_jobstep set end_status_note = 'trx_post_validation_success', end_status='success' , end_time= now() where job_id = 2 and step_id = 2 and latest_runschedule_flag = '1';
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
@@ -0,0 +1,67 @@
|
||||
CREATE OR REPLACE FUNCTION fw_core.fn_update_NA(filesyspk integer)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
/***********
|
||||
select fw_core.fn_update_NA()
|
||||
********/
|
||||
declare
|
||||
__n integer:=0;
|
||||
__na_sql text;
|
||||
__space_sql text;
|
||||
__div_sql text;
|
||||
__ref_sql text;
|
||||
__hyphen_sql text;
|
||||
__hyphen_3_sql text;
|
||||
__not_applicable text;
|
||||
__NR text;
|
||||
__Dots_1 text;
|
||||
__Dots_2 text;
|
||||
__trail_trim_columns text;
|
||||
__lead_trim_columns text;
|
||||
__Dots_3 text;
|
||||
__inverted_comma text;
|
||||
begin
|
||||
loop
|
||||
exit when __n=53;
|
||||
__n := __n+1;
|
||||
__na_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''NA'' and file_syspk=' ||filesyspk;
|
||||
__space_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'='''' and file_syspk=' ||filesyspk;
|
||||
__div_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''#REF!'' and file_syspk=' ||filesyspk;
|
||||
__ref_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''#DIV/0!'' and file_syspk=' ||filesyspk;
|
||||
__hyphen_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''-'' and file_syspk=' ||filesyspk;
|
||||
__hyphen_3_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''---'' and file_syspk=' ||filesyspk;
|
||||
__not_applicable := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''Not Applicable '' and file_syspk=' ||filesyspk;
|
||||
__NR := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''NR'' and file_syspk=' ||filesyspk;
|
||||
__Dots_1 := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''u..'' and file_syspk=' ||filesyspk;
|
||||
__Dots_2 := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''u.'' and file_syspk=' ||filesyspk;
|
||||
__Dots_3 := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''.'' and file_syspk=' ||filesyspk;
|
||||
__inverted_comma := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''`'' and file_syspk=' ||filesyspk;
|
||||
__trail_trim_columns:='update staging1.staging_generic_table set '|| concat('column',__n)||' = trim(trailing from '|| concat('column',__n)||')';
|
||||
__lead_trim_columns:='update staging1.staging_generic_table set '|| concat('column',__n)||' = trim(leading from '|| concat('column',__n)||')';
|
||||
execute __na_sql;
|
||||
execute __space_sql;
|
||||
execute __div_sql;
|
||||
execute __ref_sql;
|
||||
execute __hyphen_sql;
|
||||
execute __not_applicable;
|
||||
execute __NR;
|
||||
execute __Dots_1;
|
||||
execute __Dots_2;
|
||||
execute __trail_trim_columns;
|
||||
execute __lead_trim_columns;
|
||||
end loop;
|
||||
end;
|
||||
$function$
|
||||
@@ -0,0 +1,164 @@
|
||||
drop function if exists staging2.run_trx_rollback;
|
||||
CREATE OR REPLACE FUNCTION staging2.run_trx_rollback()
|
||||
RETURNS void AS $$
|
||||
declare
|
||||
f record;
|
||||
begin
|
||||
for f in select file_syspk,file_mnemonic
|
||||
from fw_core.fw_jobctl_file_runschedule where latest_runschedule_flag = '1' and end_status = 'error'
|
||||
and end_status_note in ('stg2_failed','TRX_failed')
|
||||
order by file_syspk
|
||||
loop
|
||||
if f.file_mnemonic = 'FTDRY' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_trailer_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_tractor_info where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'FTWET' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_trailer_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_tractor_info where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'FTHLG' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_trailer_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.field_perf_summary_trailer_info where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'DBSTD' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_drawbar_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_results_summary where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_equipment_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_measurement_uncertainty where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info_misc where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_gear_speed_chart where file_syspk = f.file_syspk;
|
||||
delete from transactional.Test_instance_wheels_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.Test_instance_fuel_lubricant_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_observations where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'DBOECD' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_drawbar_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_results_summary where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_oecd_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_equipment_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_measurement_uncertainty where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info_misc where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_gear_speed_chart where file_syspk = f.file_syspk;
|
||||
delete from transactional.Test_instance_wheels_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.Test_instance_fuel_lubricant_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.drawbar_perf_observations where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'PTOBEN' then
|
||||
delete from transactional.pto_engine_oil_consumption where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_key_perf_parameters where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_multipoint_mapping where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_perf_governing_graph where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_smoke_test where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'PTOSTD' then
|
||||
delete from transactional.pto_engine_oil_consumption where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_key_perf_parameters where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_multipoint_mapping where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_perf_governing_graph where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.pto_smoke_test where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'BUDNI' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_air_cleaner_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_test_observations where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_brake_perf_parking_brake_test_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_brake_perf_service_brake_test_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_drawbar_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_implement_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_field_perf_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info_misc where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_hydraulic_maint_of_lift_load_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_hydraulic_power_test_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_hydraulic_lifting_capacity_test_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_centre_of_gravity_location where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_noise_atmospheric_conditions where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_noise_measurement_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_pto_perf_results_summary where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_pto_perf_results_details where file_syspk = f.file_syspk;
|
||||
delete from transactional.budni_vibration_measurement where file_syspk = f.file_syspk;
|
||||
elsif f.file_mnemonic = 'IHT' then
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_atmospheric_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_noise_measurement_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_drawbar_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_weight_reaction where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_brake_perf_test_condition where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_brake_perf_test_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_cgm_lifting_angle_load_details where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_cgm_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_steering_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_pedal_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_clutch_pedal_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_brake_pedal_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_gear_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_hyd_lift_sensitivity where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_noise_measurement_test where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_gear_max_speed where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_speed_lead_lag_measurement where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_steering_effort_raw_data where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_hot_air_mapping_results where file_syspk = f.file_syspk;
|
||||
else
|
||||
delete from transactional.test_instance where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_engine_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tyre_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_atmospheric_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_noise_measurement_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_tractor_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_drawbar_info where file_syspk = f.file_syspk;
|
||||
delete from transactional.test_instance_weight_reaction where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_brake_perf_test_condition where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_brake_perf_test_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_cgm_lifting_angle_load_details where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_cgm_results where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_steering_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_pedal_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_clutch_pedal_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_brake_pedal_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_gear_effort where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_hyd_lift_sensitivity where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_noise_measurement_test where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_gear_max_speed where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_speed_lead_lag_measurement where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_steering_effort_raw_data where file_syspk = f.file_syspk;
|
||||
delete from transactional.iht_hot_air_mapping_results where file_syspk = f.file_syspk;
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
100
MMT_latest_version/sql/onetime/configentries/BUDNI_config.sql
Normal file
100
MMT_latest_version/sql/onetime/configentries/BUDNI_config.sql
Normal file
@@ -0,0 +1,100 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_DBP','BUDNI_DBP_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_DBP','BUDNI_DBP_Drawbar_Perf','Tractor Drawbar Performance Report.','Tractor Drawbar Performance Report.');
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_NMT','BUDNI_NMT_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_NMT','BUDNI_NMT_ Noise at bystander’s position', 'Noise at bystander''’s position: Noise Measurement Test', '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','Noise at operator''’s ear level: Noise Measurement Test'),
|
||||
('BUDNI','BUDNI_NMT','BUDNI_NMT_Test_Obs_Summary','Noise Measurement Test Observations Summary','Noise Measurement Test Observations Summary');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_LCG','BUDNI_LCG_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_LCG','BUDNI_LCG_Gravity_Test','Location of centre of Gravity Test','Location of centre of Gravity Test');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_PTO','BUDNI_PTO_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_PTO','BUDNI_PTO_Report','PTO Performance Report','PTO Performance Report'),
|
||||
('BUDNI','BUDNI_PTO','BUDNI_PTO_MMTKeyword1','MMTKeyword1','MMTKeyword1'),
|
||||
('BUDNI','BUDNI_PTO','BUDNI_PTO_MMTKeyword2','MMTKeyword2','MMTKeyword2'),
|
||||
('BUDNI','BUDNI_PTO','BUDNI_PTO_Summary','PTO Performance Test Observations Summary','PTO Performance Test Observations Summary');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_HDL','BUDNI_HDL_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_HDL','BUDNI_HDL_Power_Test','A) Hydraulic power test:','A) Hydraulic power test:'),
|
||||
('BUDNI','BUDNI_HDL','BUDNI_HDL_Lifting_Capacity_Test','B) Lifting Capacity Test','B) Lifting Capacity Test'),
|
||||
('BUDNI','BUDNI_HDL','BUDNI_HDL_Maintenance_Of_Lift_Load','C) 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','Power Lift and Hydraulic Pump Performance Test Observations Summary');
|
||||
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_HLG','BUDNI_HLG_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_HLG','BUDNI_HLG_Perf_Test','Haulage performance Test','Haulage performance Test'),
|
||||
('BUDNI','BUDNI_HLG','BUDNI_HLG_Test_Obs_Summary','Haulage Performance Test Observations Summary','Haulage Performance Test Observations Summary');
|
||||
|
||||
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_FLD','BUDNI_FLD_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_FLD','BUDNI_FLD_Impl_Test','BRIEF SPECIFICATION OF IMPLEMENTS USED DURING FIELD TEST','BRIEF SPECIFICATION OF IMPLEMENTS USED DURING FIELD TEST'),
|
||||
('BUDNI','BUDNI_FLD','BUDNI_FLD_Sum_Perf_Test','SUMMARY OF FIELD PERFORMANCE TEST','SUMMARY OF FIELD PERFORMANCE TEST'),
|
||||
('BUDNI','BUDNI_FLD','BUDNI_FLD_Test_Obs_Summary','Field Performance Test Observations Summary','Field Performance Test Observations Summary');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_ARC','BUDNI_ARC_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_ARC','BUDNI_ARC_Perf_Atmos_Meas_Test','Atmospheric conditions:','Atmospheric conditions:'),
|
||||
('BUDNI','BUDNI_ARC','BUDNI_ARC_Test_Obs_Summary','AIR CLEANER OIL PULL OVER TEST Observations Summary','AIR CLEANER OIL PULL OVER TEST Observations Summary');
|
||||
|
||||
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_VMT','BUDNI_VMT_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_VMT','BUDNI_VMT_Perf_Meas_Test','Machanical Vibration Measurement Test','Machanical Vibration Measurement Test'),
|
||||
('BUDNI','BUDNI_VMT','BUDNI_VMT_Test_Obs_Summary','Noise Measurement Test Observations Summary','Noise Measurement Test Observations Summary');
|
||||
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('BUDNI','BUDNI_BRK','BUDNI_BRK_Spec_H1','Test Tractor Specifiactions','Test Tractor Specifiactions'),
|
||||
('BUDNI','BUDNI_BRK','BUDNI_BRK_Service_Barke_Test','1) Service Barke Testing','1) Service Barke Testing'),
|
||||
('BUDNI','BUDNI_BRK','BUDNI_BRK_Parking_Brake_Test','2) Parking Brake Test','2) Parking Brake Test'),
|
||||
('BUDNI','BUDNI_BRK','BUDNI_BRK_Test_Obs_Summary','Brake Performance Test Observations Summary','Brake Performance Test Observations Summary');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values ('DBOECD','DBOECD_TEST','DBOECD_Test_H1','Test Request no.','Test Request no.'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_engine_RPM','Engine (RPM)','Engine (RPM)'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_test_condition','Test condition','Test condition'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_drawbar_performance_selected_summary','Drawbar Performance Test Results (Selected Summary)','Drawbar Performance Test Results (Selected Summary)'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_drawbar_performance_gear_performance','Drawbar Performance Test Results (Gear Performance Test)','Drawbar Performance Test Results (Gear Performance Test)'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_fuel_consumption','3.3.2','3.3.2'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_test_equipment','Test equipment’s used','Test equipment’s used'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_tractor_specifications','Tractor specification','Tractor specification'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_transmission','Transmission','Transmission'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_graphical_data','GRAPHICAL DATA','GRAPHICAL DATA'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_photos','PHOTOS','PHOTOS'),
|
||||
('DBOECD','DBOECD_TEST','DBOECD_test_remarks','Remarks:','Remarks:');
|
||||
@@ -0,0 +1,13 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values ('DBSTD','DBSTD_TEST','DBSTD_Test_H1','Test Request no.','Test Request no.'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_engine_RPM','Engine (RPM)','Engine (RPM)'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_test_condition','Test condition','Test condition'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_drawbar_performance_selected_summary','Drawbar Performance Test Results (Selected Summary)','Drawbar Performance Test Results (Selected Summary)'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_drawbar_performance_gear_performance','Drawbar Performance Test Results (Gear Performance Test)','Drawbar Performance Test Results (Gear Performance Test)'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_test_equipment','Test equipment’s used','Test equipment’s used'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_tractor_specifications','Tractor specification','Tractor specification'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_transmission','Transmission','Transmission'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_graphical_data','GRAPHICAL DATA','GRAPHICAL DATA'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_photos','PHOTOS','PHOTOS'),
|
||||
('DBSTD','DBSTD_TEST','DBSTD_test_remarks','Remarks','Remarks');
|
||||
@@ -0,0 +1,21 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('FTDRY','FTDRY_TRS','FTDRY_TRS_H1','Tractor Specifications Sheet','Tractor Specifications Sheet'),
|
||||
('FTDRY','FTDRY_TRS','FTDRY_TRS_SPEC','Tractor Specifications','Tractor Specifications'),
|
||||
('FTDRY','FTDRY_TRS','FTDRY_TRS_Engine_RPM','Engine RPM Data:','Engine RPM Data:'),
|
||||
('FTDRY','FTDRY_TRS','FTDRY_TRS_Implement','Implement Details','Implement Details')
|
||||
;
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Trac_H1','Tractor Model','Tractor Model'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Implement','Make of Implement','Make of Implement'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Test_Condition_1','Test Condition_1:','Test Condition:'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Engineer_Comments_1','Test Engineer Comments_1','Test Engineer Comments'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Manager_Comments_1','Test Manager Comments_1','Test Manager Comments'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Test_Condition_2','Test Condition_2:','Test Condition:'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Engineer_Comments_2','Test Engineer Comments_2','Test Engineer Comments'),
|
||||
('FTDRY','FTDRY_SUM','FTDRY_SUM_Manager_Comments_2','Test Manager Comments_2','Test Manager Comments')
|
||||
;
|
||||
@@ -0,0 +1,21 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('FTHLG','FTHLG_TRS','FTHLG_TRS_H1','Tractor specifications sheet','Tractor specifications sheet'),
|
||||
('FTHLG','FTHLG_TRS','FTHLG_TRS_SPEC','Tractor Specifications','Tractor Specifications'),
|
||||
('FTHLG','FTHLG_TRS','FTHLG_TRS_Engine_RPM','Engine RPM Data:','Engine RPM Data:'),
|
||||
('FTHLG','FTHLG_TRS','FTHLG_TRS_Trailer','Trailer Details','Trailer Details')
|
||||
;
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Trac_H1','Tractor Model','Tractor Model'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Trail_Type','Trailer Type','Trailer Type'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Test_Condition_1','Test Condition_1:','Test Condition:'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Engineer_Comments_1','Test Engineer Comments_1','Test Engineer Comments'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Manager_Comments_1','Test Manager Comments_1','Test Manager Comments'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Test_Condition_2','Test Condition_2:','Test Condition:'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Engineer_Comments_2','Test Engineer Comments_2','Test Engineer Comments'),
|
||||
('FTHLG','FTHLG_SUM','FTHLG_SUM_Manager_Comments_2','Test Manager Comments_2','Test Manager Comments')
|
||||
;
|
||||
@@ -0,0 +1,18 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('FTWET','FTWET_TRS','FTWET_TRS_H1','Tractor Specifications Sheet','Tractor Specifications Sheet'),
|
||||
('FTWET','FTWET_TRS','FTWET_TRS_SPEC','Tractor Specifications','Tractor Specifications'),
|
||||
('FTWET','FTWET_TRS','FTWET_TRS_Engine_RPM','Engine RPM Data:','Engine RPM Data:'),
|
||||
('FTWET','FTWET_TRS','FTWET_TRS_Implement','Implement Details','Implement Details')
|
||||
;
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('FTWET','FTWET_SUM','FTWET_SUM_Trac_H1','Tractor Model','Tractor Model'),
|
||||
('FTWET','FTWET_SUM','FTWET_SUM_Impement','Make of Implement','Make of Implement'),
|
||||
('FTWET','FTWET_SUM','FTWET_SUM_Cage_Wheel','Type of Cage Wheel','Type of Cage Wheel'),
|
||||
('FTWET','FTWET_SUM','FTWET_SUM_Test_Condition','Test Condition:','Test Condition:'),
|
||||
('FTWET','FTWET_SUM','FTWET_SUM_Manager_Comment','Test Manager Comments','Test Manager Comments')
|
||||
;
|
||||
101
MMT_latest_version/sql/onetime/configentries/IHT_config.sql
Normal file
101
MMT_latest_version/sql/onetime/configentries/IHT_config.sql
Normal file
@@ -0,0 +1,101 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_H1','Test Request No','Test Request No'),
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_Tyre_Details','Tyre Details','Tyre Details'),
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_Engine_RPM_Atmos','Engine RPM','Engine RPM'),
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_STAND_Noise','BY STANDER’S NOISE','BY STANDER’S NOISE'),
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_OEL_Noise','OEL Noise without Load','OEL Noise without Load'),
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_OEL_Noise_Load','OEL Noise with Load','OEL Noise with Load'),
|
||||
('IHTNST','IHTNST_NST','IHTNST_NST_Footer','Prepared by','Prepared by');
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTHLS','IHTHLS_HLS','IHTHLS_HLS_H1','Test Request no.','Test Request no.'),
|
||||
('IHTHLS','IHTHLS_HLS','IHTHLS_HLS_Weight_Tyre','Weight Reaction','Weight Reaction'),
|
||||
('IHTHLS','IHTHLS_HLS','IHTHLS_HLS_Numeric','Numerical data','Numerical data'),
|
||||
('IHTHLS','IHTHLS_HLS','IHTHLS_HLS_Footer','Prepared By','Prepared By');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_H1','Test Request No','Test Request No'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Test_Res_1','Un-Ballast cold','Un-Ballast cold'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Test_Res_2','Road Ballast cold','Road Ballast cold'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Test_Res_3','Road Ballast Hot','Road Ballast Hot'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Test_Res_4','Max Ballast cold','Max Ballast cold'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Test_Res_5','Max Ballast Hot','Max Ballast Hot'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Test_Res_6','Date- 04-July-2019','Date- 04-July-2019'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Weight_Tyre','Weight (kg)','Weight (kg)'),
|
||||
('IHTBTD','IHTBTD_BTD','IHTBTD_BTD_Footer','Prepared by','Prepared by');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_H1','Test Request No','Test Request No'),
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_Test_Res_1','Un-Ballast cold','Un-Ballast cold'),
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_Test_Res_2','Ballast cold','Ballast cold'),
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_Test_Res_3','Fade Performance','Fade Performance'),
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_Test_Res_4','Recovery Performance','Recovery Performance'),
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_Weight_Tyre','Weight (kg)','Weight (kg)'),
|
||||
('IHTBT50','IHTBT50_BT50','IHTBT50_BT50_Footer','Prepared by','Prepared by');
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_H1','Test Request No','Test Request No'),
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_Test_Res_1','Un-Ballast cold','Un-Ballast cold'),
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_Test_Res_2','Ballast cold','Ballast cold'),
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_Test_Res_3','Fade Performance','Fade Performance'),
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_Test_Res_4','Recovery Performance','Recovery Performance'),
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_Weight_Tyre','Weight (kg)','Weight (kg)'),
|
||||
('IHTBT30','IHTBT30_BT30','IHTBT30_BT30_Footer','Prepared by','Prepared by');
|
||||
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTSLL','IHTSLL_SLL','IHTSLL_SLL_H1','Test Request No','Test Request No'),
|
||||
('IHTSLL','IHTSLL_SLL','IHTSLL_SLL_Weight_Tyre','Weight Reaction','Weight Reaction'),
|
||||
('IHTSLL','IHTSLL_SLL','IHTSLL_SLL_Forward','K2-4WD HST EACH GEAR MAX SPEED - FORWARD','K2-4WD HST EACH GEAR MAX SPEED - FORWARD'),
|
||||
('IHTSLL','IHTSLL_SLL','IHTSLL_SLL_Reverse','K2- 4WD HST EACH GEAR MAX SPEED REVERSE','K2- 4WD HST EACH GEAR MAX SPEED REVERSE'),
|
||||
('IHTSLL','IHTSLL_SLL','IHTSLL_SLL_Lead_Lag','Lead / Lag Measurement on K2 4WD HST','Lead / Lag Measurement on K2 4WD HST'),
|
||||
('IHTSLL','IHTSLL_SLL','IHTSLL_SLL_Footer','Prepared by','Prepared by');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTEMT','IHTEMT_EMT','IHTEMT_EMT_H1','Test Request no.','Test Request no.'),
|
||||
('IHTEMT','IHTEMT_EMT','IHTEMT_EMT_Weight_Tyre','Weight Reaction','Weight Reaction'),
|
||||
('IHTEMT','IHTEMT_EMT','IHTEMT_EMT_Steering','Steering effort','Steering effort'),
|
||||
('IHTEMT','IHTEMT_EMT','IHTEMT_EMT_Pedal','Pedal Effort','Pedal Effort'),
|
||||
('IHTEMT','IHTEMT_EMT','IHTEMT_EMT_Brake_Pedal','Brake Pedal Effort','Brake Pedal Effort'),
|
||||
('IHTEMT','IHTEMT_EMT','IHTEMT_EMT_Footer','Prepared by','Prepared by');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTEMT','IHTEMT_STD','IHTEMT_STD_RAW_Data','Steering effort RAW data','Steering effort RAW data');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTCGM','IHTCGM_CGM','IHTCGM_CGM_H1','Test Request no.','Test Request no.'),
|
||||
('IHTCGM','IHTCGM_CGM','IHTCGM_CGM_Weight_Tyre','Weight Reaction','Weight Reaction'),
|
||||
('IHTCGM','IHTCGM_CGM','IHTCGM_CGM_Lifting','Lifting Angle & Load','Lifting Angle & Load'),
|
||||
('IHTCGM','IHTCGM_CGM','IHTCGM_CGM_Footer','Prepared by','Prepared by');
|
||||
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values
|
||||
('IHTHAM','IHTHAM_HAM','IHTHAM_HAM_H1','Test Request no.','Test Request no.'),
|
||||
('IHTHAM','IHTHAM_HAM','IHTHAM_HAM_Engine_Tyre_Weight','Engine (RPM)','Engine (RPM)'),
|
||||
('IHTHAM','IHTHAM_HAM','IHTHAM_HAM_Atmos_Cond','Atmospheric condition','Atmospheric condition'),
|
||||
('IHTHAM','IHTHAM_HAM','IHTHAM_HAM_Results','Gear','Gear'),
|
||||
('IHTHAM','IHTHAM_HAM','IHTHAM_HAM_Footer','Prepared By','Prepared By');
|
||||
|
||||
|
||||
|
||||
51
MMT_latest_version/sql/onetime/configentries/PTO_config.sql
Normal file
51
MMT_latest_version/sql/onetime/configentries/PTO_config.sql
Normal file
@@ -0,0 +1,51 @@
|
||||
insert into transactional.source_config
|
||||
(file_mnemonic,file_sheet_mnemonic,block_tag,f1_modified,f1_keyword)
|
||||
values ('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_Key_Performance_Parameters','Key Performance Parameters','Key Performance Parameters'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_varying_speed_test_natural_ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_2hrs_max_power_natural_ambient','2Hrs Max Power Test @ Natural Ambient','2Hrs Max Power Test @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_varying_load_rated_rpm',' Varying loads @ Rated RPM @ Natural Ambient',' Varying loads @ Rated RPM @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_varying_load_std_pto','Varying load @ STD. PTO @ Natural Ambient','Varying load @ STD. PTO @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_smoke_test','Smoke Test @ Natural Ambient','Smoke Test @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_varying_speed_test_high_ambient','Varying Speed Test / Full Throttle Performance @ High Ambient','Varying Speed Test / Full Throttle Performance @ High Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_2hrs_max_power_high_ambient','2Hrs Max Power Test @ High Ambient','2Hrs Max Power Test @ High Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFN','PTOBEN_PRF_engine_oil_consumption','Engine Oil Consumption @ High Ambient','Engine Oil Consumption @ High Ambient'),
|
||||
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_Key_Performance_Parameters','Key Performance Parameters','Key Performance Parameters'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_varying_speed_test_natural_ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_2hrs_max_power_natural_ambient','2Hrs Max Power Test @ Natural Ambient','2Hrs Max Power Test @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_varying_load_rated_rpm',' Varying loads @ Rated RPM @ Natural Ambient',' Varying loads @ Rated RPM @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_varying_load_std_pto','Varying load @ STD. PTO @ Natural Ambient','Varying load @ STD. PTO @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_smoke_test','Smoke Test @ Natural Ambient','Smoke Test @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_varying_speed_test_high_ambient','Varying Speed Test / Full Throttle Performance @ High Ambient','Varying Speed Test / Full Throttle Performance @ High Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_2hrs_max_power_high_ambient','2Hrs Max Power Test @ High Ambient','2Hrs Max Power Test @ High Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFB','PTOBEN_PRF_engine_oil_consumption','Engine Oil Consumption @ High Ambient','Engine Oil Consumption @ High Ambient'),
|
||||
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_Key_Performance_Parameters','Key Performance Parameters','Key Performance Parameters'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_varying_speed_test_natural_ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_2hrs_max_power_natural_ambient','2Hrs Max Power Test @ Natural Ambient','2Hrs Max Power Test @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_varying_load_rated_rpm',' Varying loads @ Rated RPM @ Natural Ambient',' Varying loads @ Rated RPM @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_varying_load_std_pto','Varying load @ STD. PTO @ Natural Ambient','Varying load @ STD. PTO @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_smoke_test','Smoke Test @ Natural Ambient','Smoke Test @ Natural Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_varying_speed_test_high_ambient','Varying Speed Test / Full Throttle Performance @ High Ambient','Varying Speed Test / Full Throttle Performance @ High Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_2hrs_max_power_high_ambient','2Hrs Max Power Test @ High Ambient','2Hrs Max Power Test @ High Ambient'),
|
||||
('PTOBEN','PTOBEN_PRFE','PTOBEN_PRF_engine_oil_consumption','Engine Oil Consumption @ High Ambient','Engine Oil Consumption @ High Ambient'),
|
||||
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_Key_Performance_Parameters','Key Performance Parameters','Key Performance Parameters'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_varying_speed_test_natural_ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient','Varying Speed Test / Full Throttle Performance @ Natural Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_2hrs_max_power_natural_ambient','2Hrs Max Power Test @ Natural Ambient','2Hrs Max Power Test @ Natural Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_varying_load_rated_rpm',' Varying loads @ Rated RPM @ Natural Ambient',' Varying loads @ Rated RPM @ Natural Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_varying_load_std_pto','Varying load @ STD. PTO @ Natural Ambient','Varying load @ STD. PTO @ Natural Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_smoke_test','Smoke Test @ Natural Ambient','Smoke Test @ Natural Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_varying_speed_test_high_ambient','Varying Speed Test / Full Throttle Performance @ High Ambient','Varying Speed Test / Full Throttle Performance @ High Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_2hrs_max_power_high_ambient','2Hrs Max Power Test @ High Ambient','2Hrs Max Power Test @ High Ambient'),
|
||||
('PTOSTD','PTOSTD_PRF','PTOBEN_PRF_engine_oil_consumption','Engine Oil Consumption @ High Ambient','Engine Oil Consumption @ High Ambient'),
|
||||
|
||||
('PTOBEN','PTOBEN_MPM','PTOBEN_MPM_data_inputs','Data Inputs','Data Inputs'),
|
||||
('PTOSTD','PTOSTD_MPM','PTOBEN_MPM_data_inputs','Data Inputs','Data Inputs'),
|
||||
|
||||
('PTOBEN','PTOBEN_GVG','PTOBEN_GVG_data_inputs','Data Inputs','Data Inputs'),
|
||||
('PTOBEN','PTOBEN_GVG','PTOBEN_GVG_graphs','Graphs - for Example','Graphs - for Example'),
|
||||
|
||||
|
||||
('PTOSTD','PTOSTD_GVG','PTOBEN_GVG_data_inputs','Data Inputs','Data Inputs'),
|
||||
('PTOSTD','PTOSTD_GVG','PTOBEN_GVG_graphs','Graphs - for Example','Graphs - for Example')
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
INSERT INTO fw_core.fw_jobctl_jobstep_master
|
||||
(client_id, function_id, run_frequency, job_scheduling_day, sch_day_of_month, sch_day_of_week, sch_hour_of_day, sch_minute_of_hour, job_id, step_id, job_step_run_dependency_seuqence, active_flag,
|
||||
job_name, step_name, job_script_type, job_step_script_name, job_fun_param_array, job_scope, job_scope_qualifier_array, sme_entering, extract_field_name, job_step_description, job_step_objective, created_by, updated_by, create_timestamp, update_timestamp)
|
||||
VALUES(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 1, 1, 9001, true, 'stg1_load', 'stg1_load_to_generic_table', 'java', '/home/compegence/customer/MMT/java/generic_table/target/ex1-1.0-SNAPSHOT-shaded.jar', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 1, 2, 9002, true, 'stg1_load', 'post_stg1_load_validation', 'sql_fn', 'staging2.fn_run_post_generic_validation()', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 2, 1, 9003, true, 'txn_load', 'run_wrapper_txn', 'sql_fn', 'staging2.fn_run_master_wrapper()', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 2, 2, 9004, true, 'txn_load', 'txn_load_validations', 'sql_fn', 'staging2.fn_run_trx_post_validation()', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
--,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 1, 9005, true, 'reporting_ods_load', 'reporting_ods_load', 'sql', 'ex2.sql', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 3, 1, 9005, true, 'file_cleanup', 'move_the_files', 'shell_script', '/home/compegence/customer/MMT/sql/scripts/file_move.sh', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
--,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 5, 1, 9007, true, 'final_checks', 'final checks before marking runschedule status as success', 'sql', 'ex2.sql', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 6, 1, 9006, true, 'archival', 'Archival of satging2 block tables', 'sql_fn', 'archive.fn_block_archive()', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
,(21, 1, 'daily', '', '', '', '00:00:00', '00:00:00', 7, 1, 9007, true, 'check counts', 'chech count in fw_core schema', 'sql_fn', 'fw_core.fn_check_count(current_date)', '{}', '', '{}', '', '', '', '', 'Admin', 'Admin', now(), now())
|
||||
;
|
||||
@@ -0,0 +1,45 @@
|
||||
SET search_path TO fw_code;
|
||||
INSERT INTO fw_core.test_file_sheet_format_master (client_id,function_id,test_type,test_name,file_mnemonic,sheet_name,sheet_format,file_sheet_mnemonic,sheet_format_mnemonic,stg2_function,trx_function,created_by,create_timestamp,updated_by,update_timestamp) VALUES
|
||||
(20,1,'Field','Field Dry Performance','FTDRY','Tractor specifications','Field_Dry_TractorSpecs','FTDRY_TRS','FTDRY_TRS',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Field','Field Dry Performance','FTDRY','Summary','Field_Dry_Summary','FTDRY_SUM','FTDRY_SUM',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Field','Field wet Performance','FTWET','Tractor specifications','Field_Wet_TractorSpecs','FTWET_TRS','FTWET_TRS',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Field','Field wet Performance','FTWET','Summary','Field_Wet_Summary','FTWET_TRS','FTWET_TRS',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Field','Field Haulage Performance','FTHLG','Tractor specifications','Field_Haulage_TractorSpecs','FTHLG_TRS','FTHLG_TRS',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Field','Field Haulage Performance','FTHLG','Summary','Field_Haulage_Summary','FTHLG_SUM','FTHLG_SUM',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Drawbar','Drawbar Standard Performance','DBSTD','Test Results','Drawbar_Test_Results','DBSTD_TEST','DBSTD_TEST',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Drawbar','Drawbar OECD Performance','DBOECD','Test Results','Drawbar_Test_Results','DBOECD_TEST','DBOECD_TEST',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','PTO Performance','BUDNI','PTO Perf','Budni_PTO_Perf','BUDNI_PTO','BUDNI_PTO',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Drawbar performance','BUDNI','Drawbar perf','Budni_Drawbar_Perf','BUDNI_DBP','BUDNI_DBP',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
;
|
||||
INSERT INTO fw_core.test_file_sheet_format_master (client_id,function_id,test_type,test_name,file_mnemonic,sheet_name,sheet_format,file_sheet_mnemonic,sheet_format_mnemonic,stg2_function,trx_function,created_by,create_timestamp,updated_by,update_timestamp) VALUES
|
||||
(20,1,'Budni','Hydraulic test','BUDNI','Hydraulic test','Budni_Hydraulic_Test','BUDNI_HDL','BUDNI_HDL',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Vibration measurement','BUDNI','Vibration measurement','Budni_Vibration_Measurement','BUDNI_VMT','BUDNI_VMT',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Location Of CG','BUDNI','Location Of CG','Budni_Location_of_CG','BUDNI_LCG','BUDNI_LCG',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Field Performance Test','BUDNI','Field Perf. Test','Budni_Field_Perf','BUDNI_FLD','BUDNI_FLD',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Haulage Performance Test','BUDNI','Haulage Perf. Test','Budni_Haulage_Perf','BUDNI_HLG','BUDNI_HLG',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Noise Measurement','BUDNI','Noise Measurement','Budni_Noise_Measurement','BUDNI_NMT','BUDNI_NMT',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Noise Test','IHTNST','Noise Test','InHouse_NoiseTest','IHTNST_NST','IHTNST_NST',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Brake Test ASEBA 30','IHTBT30','Brake Test','inHouse_BrakeTest30','IHTBT30_BT30','IHTBT30_BT30',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Brake Test ASEBA 50 ','IHTBT50','Brake Test','inHouse_BrakeTest50','IHTBT50_BT50','IHTBT50_BT50',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Hot Air Mapping','IHTHAM','Hot Air Mapping','inHouse_HotAirMap','IHTHAM_HAM','IHTHAM_HAM',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
;
|
||||
INSERT INTO fw_core.test_file_sheet_format_master (client_id,function_id,test_type,test_name,file_mnemonic,sheet_name,sheet_format,file_sheet_mnemonic,sheet_format_mnemonic,stg2_function,trx_function,created_by,create_timestamp,updated_by,update_timestamp) VALUES
|
||||
(20,1,'In house','Speed and Lead Lag Measurement','IHTSLL','Speed and lead lag measurement','inHouse_SpeedandLeadLagMeasurement','IHTSLL_SLL','IHTSLL_SLL',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Effort Measurement','IHTEMT','Effort measurement','inHouse_EffortMeasurement','IHTEMT_EMT','IHTEMT_EMT',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Effort Measurement','IHTEMT','Steering data','inHouse_SteeringData','IHTEMT_STD','IHTEMT_STD',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','CG Measurement','IHTCGM','CG Measurement','inHouse_CGMeasurement','IHTCGM_CGM','IHTCGM_CGM',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Brake Test Domestic','IHTBTD','Brake Test domestic','inHouse_BrakeTestDomestic','IHTBTD_BTD','IHTBTD_BTD',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'In house','Hyd lift sensitivity','IHTHLS','Hyd lift sensitivity','inHouse_HydLiftSensitivity','IHTHLS_HLS','IHTHLS_HLS',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO BEN Performance','PTOBEN','Performance -BOOST MODE','PTO_Performance_Boost','PTOBEN_PRFB','PTO_PRF',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO BEN Performance','PTOBEN','Performance -ECO MODE','PTO_Performance_Eco','PTOBEN_PRFE','PTO_PRF',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO BEN Performance','PTOBEN','Multipoint Mapping','PTO_MultipointMap_BEN','PTOBEN_MPM','PTO_MPM',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO BEN Performance','PTOBEN','Governing Graph','PTO_GoverningGraph_BEN','PTOBEN_GVG','PTO_GVG',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
;
|
||||
INSERT INTO fw_core.test_file_sheet_format_master (client_id,function_id,test_type,test_name,file_mnemonic,sheet_name,sheet_format,file_sheet_mnemonic,sheet_format_mnemonic,stg2_function,trx_function,created_by,create_timestamp,updated_by,update_timestamp) VALUES
|
||||
(20,1,'PTO','PTO Standard Peformance','PTOSTD','Performance -STANDARD MODE','PTO_Performance_Standard','PTOSTD_PRF','PTO_PRF',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Brake Performance Test','BUDNI','Brake Perf Test','Budni_Brake_Perf','BUDNI_BRK','BUDNI_BRK',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'Budni','Air Cleaner Performance Test','BUDNI','Air Cleaner Perf Test','Budni_Air_Cleaner_Perf','BUDNI_ARC','BUDNI_ARC',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO Standard Peformance','PTOSTD','Multipoint Mapping','PTO_MultipointMap_Standard','PTOSTD_MPM','PTO_MPM',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO Standard Peformance','PTOSTD','Governing Graph','PTO_GoverningGraph_Standard','PTOSTD_GVG','PTO_GVG',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
,(20,1,'PTO','PTO BEN Performance','PTOBEN','Performance -NORMAL MODE','PTO_Performance_Normal','PTOBEN_PRFN','PTO_PRF',NULL,NULL,CURRENT_USER,NOW(),NULL,NULL)
|
||||
;
|
||||
@@ -0,0 +1,30 @@
|
||||
--select * from test_master
|
||||
|
||||
SET search_path TO transactional;
|
||||
INSERT INTO transactional.test_master (client_id,function_id,test_name,test_type,test_description,created_by,create_timestamp) VALUES
|
||||
(20,1,'Field Performance','Field','Field Performance Test', current_user,now())
|
||||
,(20,1,'Drawbar Performance','Drawbar','Drawbar Performance Test', current_user,now())
|
||||
,(20,1,'PTO Performance','PTO','PTO Performance Test', current_user,now())
|
||||
,(20,1,'In House Performance','In House','In House Performance Test', current_user , now())
|
||||
,(20,1,'Budni Performance','Budni','Budni Performance Test', current_user,now())
|
||||
;
|
||||
|
||||
--select * from test_lab_location_master tllm
|
||||
|
||||
INSERT INTO transactional.test_lab_location_master (client_id,function_id,location_name,soil_type,created_by,create_timestamp) VALUES
|
||||
(20,1,'Jetsar',NULL,current_user,now())
|
||||
,(20,1,'Shivpuri',NULL,current_user,now())
|
||||
,(20,1,'Akola',NULL,current_user,now())
|
||||
,(20,1,'Sindhnoor',NULL,current_user,now())
|
||||
,(20,1,'Tindivanam',NULL,current_user,now())
|
||||
,(20,1,'Kumbakonam',NULL,current_user,now())
|
||||
,(20,1,'Tadepalligudem',NULL,current_user,now())
|
||||
,(20,1,'Punjab',NULL,current_user,now())
|
||||
,(20,1,'Other',NULL,current_user,now())
|
||||
,(20,1,'Suratgarh (Jetsar)',NULL,current_user,now())
|
||||
;
|
||||
INSERT INTO transactional.test_lab_location_master (client_id,function_id,location_name,soil_type,created_by,create_timestamp) VALUES
|
||||
(20,1,'Sardargarh (Jetsar)',NULL,current_user,now())
|
||||
,(20,1,'Budni',NULL,current_user,now())
|
||||
,(20,1,'MRV FD Test Track',NULL,current_user,now())
|
||||
;
|
||||
@@ -0,0 +1,80 @@
|
||||
drop table if exists fw_core.db_run_status;
|
||||
|
||||
drop table if exists fw_core.Test_file_sheet_format_master;
|
||||
|
||||
CREATE TABLE fw_core.test_file_sheet_format_master (
|
||||
syspk serial NOT NULL, -- PK
|
||||
client_id int4 NOT NULL, -- UKA1
|
||||
function_id int4 NOT NULL, -- UKA2
|
||||
test_type text NOT NULL, -- UKA3
|
||||
test_name text NOT NULL, -- UKA4
|
||||
file_mnemonic text NOT NULL, -- UKA5
|
||||
sheet_name text NOT NULL,
|
||||
sheet_format text NOT NULL,
|
||||
file_sheet_mnemonic text NOT NULL, -- UKA6
|
||||
sheet_format_mnemonic text NULL,
|
||||
stg2_function text NULL,
|
||||
trx_function text NULL,
|
||||
Created_By TEXT NULL DEFAULT current_user,
|
||||
Updated_by text NULL,
|
||||
Create_timestamp TIMESTAMP NULL DEFAULT now(),
|
||||
update_timestamp TIMESTAMP NULL
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE fw_core.db_run_status
|
||||
( syspk bigserial NOT NULL,
|
||||
client_id int,
|
||||
function_id int,
|
||||
user_id int,
|
||||
user_name text,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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 if exists fw_core.check_table_stg_trx_count;
|
||||
create table fw_core.check_table_stg_trx_count
|
||||
(
|
||||
schema_name text,
|
||||
table_name text,
|
||||
row_count int,
|
||||
create_time timestamp DEFAULT CURRENT_TIMESTAMP
|
||||
|
||||
);
|
||||
|
||||
drop table if exists fw_core.check_mnemonic_count;
|
||||
create table fw_core.check_mnemonic_count
|
||||
(
|
||||
table_name text,
|
||||
syspks text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
row_count int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
DROP TABLE if exists fw_core.check_model_count;
|
||||
CREATE TABLE fw_core.check_model_count(
|
||||
table_name text NULL,
|
||||
syspks text NULL,
|
||||
file_mnemonic text NULL,
|
||||
file_sheet_mnemonic text NULL,
|
||||
tractor_name text NULL,
|
||||
row_count int4 NULL,
|
||||
create_timestamp timestamp DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
drop table if exists transactional.source_config;
|
||||
CREATE TABLE transactional.source_config (
|
||||
syspk serial NOT NULL,
|
||||
file_mnemonic varchar(100) NULL,
|
||||
file_sheet_mnemonic varchar(100) NULL,
|
||||
block_tag varchar(100) NULL,
|
||||
f1_source varchar(100) NULL,
|
||||
f1_modified varchar(100) NULL,
|
||||
f1_keyword varchar(100) NULL,
|
||||
row_number_start int4 NULL,
|
||||
row_previous_number int4 NULL,
|
||||
row_read_end int4 NULL,
|
||||
run_time timestamp NULL,
|
||||
action varchar(50) NULL,
|
||||
run_date date NULL,
|
||||
keyword_status int4 NULL DEFAULT 0,
|
||||
CONSTRAINT source_config_pkey PRIMARY KEY (syspk)
|
||||
);
|
||||
CREATE UNIQUE INDEX i_file_mnemonic_source_config ON transactional.source_config (file_mnemonic, file_sheet_mnemonic, f1_modified);
|
||||
@@ -0,0 +1,3 @@
|
||||
SET search_path To staging2;
|
||||
drop extension tablefunc;
|
||||
create extension tablefunc;
|
||||
@@ -0,0 +1,314 @@
|
||||
SET search_path To fw_core;
|
||||
|
||||
CREATE DOMAIN fw_flag_bool AS BOOL;
|
||||
|
||||
CREATE DOMAIN fw_flag_YN AS BPCHAR;
|
||||
|
||||
CREATE DOMAIN fw_date AS DATE;
|
||||
|
||||
CREATE DOMAIN fw_num_dimid AS INTEGER;
|
||||
|
||||
CREATE DOMAIN fw_num_bigid AS BIGINT;
|
||||
|
||||
CREATE DOMAIN fw_num_metric AS DECIMAL(12,4);
|
||||
|
||||
CREATE DOMAIN fw_num_array AS INTEGER ARRAY;
|
||||
|
||||
CREATE DOMAIN fw_alphnum AS TEXT;
|
||||
|
||||
CREATE DOMAIN fw_text_array AS TEXT ARRAY;
|
||||
|
||||
CREATE DOMAIN fw_timestamp AS TIMESTAMP;
|
||||
|
||||
CREATE DOMAIN fw_time AS TIME;
|
||||
|
||||
CREATE DOMAIN fw_json AS JSON;
|
||||
|
||||
|
||||
|
||||
-- Drop table
|
||||
|
||||
DROP TABLE if Exists fw_core.fw_jobctl_jobstep_master;
|
||||
|
||||
CREATE TABLE fw_core.fw_jobctl_jobstep_master (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_core.fw_num_dimid NOT NULL,
|
||||
function_id fw_core.fw_num_dimid NOT NULL,
|
||||
run_frequency fw_core.fw_alphnum NOT NULL,
|
||||
job_scheduling_day fw_core.fw_alphnum NOT NULL,
|
||||
sch_day_of_month fw_core.fw_alphnum NOT NULL,
|
||||
sch_day_of_week fw_core.fw_alphnum NOT NULL,
|
||||
sch_hour_of_day fw_core.fw_time NOT NULL,
|
||||
sch_minute_of_hour fw_core.fw_time NOT NULL,
|
||||
job_id fw_core.fw_num_dimid NOT NULL,
|
||||
step_id fw_core.fw_num_dimid NOT NULL,
|
||||
job_step_run_dependency_seuqence fw_core.fw_num_dimid NOT NULL,
|
||||
active_flag fw_core.fw_flag_bool NOT NULL DEFAULT true,
|
||||
job_name fw_core.fw_alphnum NULL,
|
||||
step_name fw_core.fw_alphnum NULL,
|
||||
job_script_type fw_core.fw_alphnum NOT NULL,
|
||||
job_step_script_name fw_core.fw_alphnum NOT NULL,
|
||||
job_fun_param_array fw_core.fw_text_array NULL,
|
||||
job_scope fw_core.fw_alphnum NULL,
|
||||
job_scope_qualifier_array fw_core.fw_text_array NULL,
|
||||
sme_entering fw_core.fw_alphnum NULL,
|
||||
extract_field_name fw_core.fw_alphnum NULL,
|
||||
job_step_description fw_core.fw_alphnum NULL,
|
||||
job_step_objective fw_core.fw_alphnum NULL,
|
||||
created_by fw_core.fw_alphnum NOT NULL,
|
||||
updated_by fw_core.fw_alphnum NOT NULL,
|
||||
create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctl_jobstep_master_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_jobctl_jobstep_master UNIQUE (client_id, function_id, run_frequency, job_id, step_id)
|
||||
);
|
||||
|
||||
-- Drop table
|
||||
|
||||
DROP TABLE if Exists fw_core.fw_jobctl_jobstep_master;
|
||||
|
||||
CREATE TABLE fw_core.fw_jobctl_jobstep_master (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_core.fw_num_dimid NOT NULL,
|
||||
function_id fw_core.fw_num_dimid NOT NULL,
|
||||
run_frequency fw_core.fw_alphnum NOT NULL,
|
||||
job_scheduling_day fw_core.fw_alphnum NOT NULL,
|
||||
sch_day_of_month fw_core.fw_alphnum NOT NULL,
|
||||
sch_day_of_week fw_core.fw_alphnum NOT NULL,
|
||||
sch_hour_of_day fw_core.fw_time NOT NULL,
|
||||
sch_minute_of_hour fw_core.fw_time NOT NULL,
|
||||
job_id fw_core.fw_num_dimid NOT NULL,
|
||||
step_id fw_core.fw_num_dimid NOT NULL,
|
||||
job_step_run_dependency_seuqence fw_core.fw_num_dimid NOT NULL,
|
||||
active_flag fw_core.fw_flag_bool NOT NULL DEFAULT true,
|
||||
job_name fw_core.fw_alphnum NULL,
|
||||
step_name fw_core.fw_alphnum NULL,
|
||||
job_script_type fw_core.fw_alphnum NOT NULL,
|
||||
job_step_script_name fw_core.fw_alphnum NOT NULL,
|
||||
job_fun_param_array fw_core.fw_text_array NULL,
|
||||
job_scope fw_core.fw_alphnum NULL,
|
||||
job_scope_qualifier_array fw_core.fw_text_array NULL,
|
||||
sme_entering fw_core.fw_alphnum NULL,
|
||||
extract_field_name fw_core.fw_alphnum NULL,
|
||||
job_step_description fw_core.fw_alphnum NULL,
|
||||
job_step_objective fw_core.fw_alphnum NULL,
|
||||
created_by fw_core.fw_alphnum NOT NULL,
|
||||
updated_by fw_core.fw_alphnum NOT NULL,
|
||||
create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctl_jobstep_master_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_jobctl_jobstep_master UNIQUE (client_id, function_id, run_frequency, job_id, step_id)
|
||||
);
|
||||
|
||||
drop table if exists fw_core.fw_jobctl_runschedule;
|
||||
|
||||
CREATE table fw_core.fw_jobctl_runschedule (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_num_dimid NOT NULL,
|
||||
function_id fw_num_dimid NOT NULL,
|
||||
latest_runschedule_flag fw_flag_bool NOT NULL DEFAULT '1',
|
||||
run_schedule_id bigserial NOT NULL,
|
||||
run_frequency fw_alphnum NOT NULL,
|
||||
run_schedule_timestamp fw_timestamp NOT NULL ,
|
||||
begin_status fw_alphnum NULL,
|
||||
end_status fw_alphnum NULL DEFAULT NULL,
|
||||
end_status_note fw_alphnum null DEFAULT NULL,
|
||||
object_count fw_num_dimid NULL,
|
||||
start_time fw_timestamp NULL,
|
||||
end_time fw_timestamp NULL,
|
||||
created_by fw_alphnum NOT NULL,
|
||||
updated_by fw_alphnum NOT NULL,
|
||||
create_timestamp fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctl_runschedule_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_jobctl_runschedule UNIQUE (client_id, function_id, run_schedule_id, run_frequency));
|
||||
|
||||
drop table if Exists fw_core.fw_jobctl_runschedule_jobstep ;
|
||||
|
||||
CREATE table fw_core.fw_jobctl_runschedule_jobstep (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_num_dimid NOT NULL,
|
||||
function_id fw_num_dimid NOT NULL,
|
||||
latest_runschedule_flag fw_flag_bool NOT NULL DEFAULT '1',
|
||||
run_schedule_id fw_num_dimid NULL,
|
||||
run_frequency fw_alphnum NOT NULL,
|
||||
run_schedule_timestamp fw_timestamp NOT NULL,
|
||||
job_id fw_num_dimid NOT NULL,
|
||||
step_id fw_num_dimid NOT NULL,
|
||||
job_step_run_dependency_seuqence fw_num_dimid NOT NULL,
|
||||
job_script_type fw_alphnum NOT NULL,
|
||||
job_step_script_name fw_alphnum NOT NULL,
|
||||
job_fun_param_array fw_text_array NULL,
|
||||
job_scope fw_alphnum NULL,
|
||||
job_scope_qualifier_array fw_text_array NULL,
|
||||
job_name fw_alphnum NULL,
|
||||
step_name fw_alphnum NULL,
|
||||
begin_status fw_alphnum null default NULL,
|
||||
end_status fw_alphnum null default NULL,
|
||||
end_status_note fw_alphnum null default NULL,
|
||||
start_time fw_timestamp NULL,
|
||||
end_time fw_timestamp NULL,
|
||||
created_by fw_alphnum NULL,
|
||||
updated_by fw_alphnum NULL,
|
||||
create_timestamp fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctl_runschedule_jobstep_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_jobctl_runschedule_jobstep UNIQUE (client_id, function_id, run_schedule_id, run_frequency, job_id, step_id));
|
||||
|
||||
drop table if exists fw_core.fw_jobctl_file_runschedule;
|
||||
|
||||
CREATE TABLE fw_core.fw_jobctl_file_runschedule (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_num_dimid NOT NULL,
|
||||
function_id fw_num_dimid NOT NULL,
|
||||
latest_runschedule_flag fw_flag_bool NOT NULL DEFAULT '1',
|
||||
run_schedule_id fw_num_dimid NULL,
|
||||
job_id fw_num_dimid NULL,
|
||||
step_id fw_num_dimid NULL,
|
||||
file_syspk fw_num_dimid NOT NULL,
|
||||
file_name fw_alphnum NOT NULL,
|
||||
file_mnemonic fw_alphnum NOT NULL,
|
||||
file_landing_date date NOT NULL,
|
||||
staging_type fw_alphnum NULL,
|
||||
begin_status fw_alphnum null default NULL,
|
||||
end_status fw_alphnum null default NULL,
|
||||
end_status_note fw_alphnum null default NULL,
|
||||
start_time fw_timestamp NULL,
|
||||
end_time fw_timestamp NULL,
|
||||
created_by fw_alphnum NULL,
|
||||
updated_by fw_alphnum NULL,
|
||||
create_timestamp fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctl_file_runschedule_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_fw_jobctl_file_runschedule UNIQUE (client_id, function_id, run_schedule_id,file_syspk));
|
||||
|
||||
-- Drop table
|
||||
|
||||
DROP TABLE if exists fw_core.fw_jobctl_file_sheet_runschedule;
|
||||
|
||||
CREATE TABLE fw_core.fw_jobctl_file_sheet_runschedule (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_core.fw_num_dimid NOT NULL,
|
||||
function_id fw_core.fw_num_dimid NOT NULL,
|
||||
latest_runschedule_flag fw_core.fw_flag_bool NOT NULL DEFAULT true,
|
||||
run_schedule_id fw_core.fw_num_dimid NULL,
|
||||
job_id fw_core.fw_num_dimid NULL,
|
||||
step_id fw_core.fw_num_dimid NULL,
|
||||
file_syspk fw_core.fw_num_dimid NOT NULL,
|
||||
sheet_id fw_core.fw_num_dimid NOT NULL,
|
||||
sheet_name fw_core.fw_alphnum NOT NULL,
|
||||
file_mnemonic fw_core.fw_alphnum NOT NULL,
|
||||
sheet_format_mnemonic fw_core.fw_alphnum NULL,
|
||||
file_sheet_mnemonic fw_core.fw_alphnum NULL,
|
||||
staging_type fw_alphnum NULL,
|
||||
begin_status fw_core.fw_alphnum NULL DEFAULT NULL,
|
||||
end_status fw_core.fw_alphnum NULL DEFAULT NULL,
|
||||
end_status_note fw_core.fw_alphnum NULL DEFAULT NULL,
|
||||
start_time fw_core.fw_timestamp NULL,
|
||||
end_time fw_core.fw_timestamp NULL,
|
||||
created_by fw_core.fw_alphnum NULL,
|
||||
updated_by fw_core.fw_alphnum NULL,
|
||||
create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctrl_file_sheet_runschedule_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_fw_jobctrl_file_sheet_runschedule UNIQUE (client_id, function_id, file_syspk, sheet_id)
|
||||
);
|
||||
-- Drop table
|
||||
|
||||
DROP TABLE if exists fw_core.fw_jobctl_file_sheet_block_run_schedule;
|
||||
|
||||
CREATE TABLE fw_core.fw_jobctl_file_sheet_block_run_schedule (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_core.fw_num_dimid NOT NULL,
|
||||
function_id fw_core.fw_num_dimid NOT NULL,
|
||||
latest_runschedule_flag fw_core.fw_flag_bool NOT NULL DEFAULT true,
|
||||
run_schedule_id fw_core.fw_num_dimid NULL,
|
||||
file_syspk fw_core.fw_num_dimid NULL,
|
||||
sheet_id fw_core.fw_num_dimid NULL,
|
||||
block_table_load_seq fw_core.fw_num_dimid NULL,
|
||||
block_table_name text NULL,
|
||||
file_mnemonic fw_core.fw_alphnum NOT NULL,
|
||||
sheet_format_mnemonic fw_core.fw_alphnum NULL,
|
||||
file_sheet_mnemonic fw_core.fw_alphnum NOT NULL,
|
||||
begin_status fw_core.fw_alphnum NULL DEFAULT NULL,
|
||||
end_status fw_core.fw_alphnum NULL DEFAULT NULL,
|
||||
end_status_note fw_core.fw_alphnum NULL DEFAULT NULL,
|
||||
start_time fw_core.fw_timestamp NULL,
|
||||
end_time fw_core.fw_timestamp NULL,
|
||||
created_by fw_core.fw_alphnum NULL,
|
||||
updated_by fw_core.fw_alphnum NULL,
|
||||
create_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
update_timestamp fw_core.fw_timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT fw_jobctl_file_sheet_block_run_schedule_pkey PRIMARY KEY (syspk),
|
||||
CONSTRAINT unique_fw_jobctrl_file_sheet_block_run_schedule UNIQUE (client_id, function_id, file_syspk, sheet_id, block_table_load_seq)
|
||||
);
|
||||
-- Drop table
|
||||
|
||||
DROP TABLE if exists staging1.staging_generic_table;
|
||||
|
||||
CREATE TABLE staging1.staging_generic_table (
|
||||
syspk int8 NULL,
|
||||
file_syspk int4 NULL,
|
||||
file_name varchar(1024) NULL,
|
||||
file_prefix_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_id int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format_mnemonic varchar(1024) NULL,
|
||||
file_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
|
||||
);
|
||||
180
MMT_latest_version/sql/onetime/createtables/ods/.sql
Normal file
180
MMT_latest_version/sql/onetime/createtables/ods/.sql
Normal file
@@ -0,0 +1,180 @@
|
||||
drop table if exists trx.trx;
|
||||
|
||||
CREATE TABLE trx.trx (
|
||||
syspk serial NOT NULL,
|
||||
client_id int4 NOT NULL,
|
||||
function_id int4 NOT NULL,
|
||||
test_file_mnemonic text NULL,
|
||||
test_file_sheet_mnemonic text NULL,
|
||||
test_file_id int4 NULL,
|
||||
test_file_name text NULL,
|
||||
test_instance_id int4 NULL,
|
||||
tractor_make text NULL,
|
||||
tractor_model text NULL,
|
||||
tractor_engine_hp int4 NULL,
|
||||
wheel_drive_type text NULL,
|
||||
"configuration" text NULL,
|
||||
test_instance_tractor_id int4 NULL,
|
||||
season text NULL,
|
||||
test_date date NULL,
|
||||
test_date_year int4 NULL,
|
||||
test_date_quarter int4 NULL,
|
||||
test_date_month int4 NULL,
|
||||
test_date_dayofmonth int2 NULL,
|
||||
test_date_dayofweek int2 NULL,
|
||||
test_mode text NULL,
|
||||
test_type text NULL,
|
||||
test_sub_type text NULL,
|
||||
test_condition text NULL,
|
||||
test_purpose text NULL,
|
||||
test_iteration_number int4 NULL,
|
||||
test_ambient text NULL,
|
||||
test_tractor_yn text null,
|
||||
mahindra_model_yn text null,
|
||||
location_name text NULL,
|
||||
name_of_implement text NULL,
|
||||
type_of_implement text NULL,
|
||||
implement_weight_kg int4 NULL,
|
||||
tyre_size text NULL,
|
||||
tyre_ply_rating int4 NULL,
|
||||
tyre_pressure_kg_per_cm2 numeric NULL,
|
||||
engine_speed_var int4 NULL,
|
||||
engine_load_pct_var int4 NULL,
|
||||
gear_used text NULL,
|
||||
gear_used_up_slope_1 text NULL,
|
||||
gear_used_up_slope_2 text NULL,
|
||||
gear_used_down_slope text NULL,
|
||||
gear_forward_reverse text NULL,
|
||||
gear_pedal_effort_parameters text NULL,
|
||||
sensor_body_location text NULL,
|
||||
effort_type text NULL,
|
||||
engine_rpm_type text NULL,
|
||||
fuel_consumption_lit_per_hr numeric NULL,
|
||||
fuel_consumption_lit_per_acr numeric NULL,
|
||||
area_covered_acr_per_hr numeric NULL,
|
||||
speed_kmph numeric NULL,
|
||||
wheel_slippage_pct numeric NULL,
|
||||
field_efficiency_pct numeric NULL,
|
||||
productivity numeric NULL,
|
||||
erpmdrop_straight_1stpass_low int4 NULL,
|
||||
erpmdrop_straight_1stpass_high int4 NULL,
|
||||
erpmdrop_straight_2ndpass_low int4 NULL,
|
||||
erpmdrop_straight_2ndpass_high int4 NULL,
|
||||
erpmdrop_straight_3rdpass_low int4 NULL,
|
||||
erpmdrop_straight_3rdpass_high int4 NULL,
|
||||
erpmdrop_turn_1stpass_low int4 NULL,
|
||||
erpmdrop_turn_1stpass_high int4 NULL,
|
||||
erpmdrop_turn_2ndpass_low int4 NULL,
|
||||
erpmdrop_turn_2ndpass_high int4 NULL,
|
||||
erpmdrop_turn_3rdpass_low int4 NULL,
|
||||
erpmdrop_turn_3rdpass_high int4 NULL,
|
||||
no_of_passes int4 NULL,
|
||||
depth_of_cut_cm_low numeric NULL,
|
||||
depth_of_cut_cm_high numeric NULL,
|
||||
total_dist_travelled_km numeric NULL,
|
||||
mileage_kmpl numeric NULL,
|
||||
power_kw numeric NULL,
|
||||
pull_kgf numeric NULL,
|
||||
pull_KN numeric NULL,
|
||||
effort_kg numeric NULL,
|
||||
power_hp numeric NULL,
|
||||
torque_kg_m numeric NULL,
|
||||
torque_Nm numeric NULL,
|
||||
sfc_g_per_kwh numeric NULL,
|
||||
sfc_gms_per_hp_hr numeric NULL,
|
||||
fuelling_mm3_per_stroke_per_cyl numeric NULL,
|
||||
specific_energy_kWh_per_ltr numeric NULL,
|
||||
temp_engine_oil_c int4 NULL,
|
||||
temp_engine_oil_high_c int4 NULL,
|
||||
temp_trans_oil_c int4 NULL,
|
||||
temp_trans_oil_high_c int4 NULL,
|
||||
temp_coolant_c int4 NULL,
|
||||
temp_coolant_high_c int4 NULL,
|
||||
temp_fuel_in_c int4 NULL,
|
||||
temp_fuel_high_c int4 NULL,
|
||||
temp_fuel_out_c int4 NULL,
|
||||
temp_water_outlet_c int4 NULL,
|
||||
temp_exhaust_c int4 NULL,
|
||||
temp_fuel_temp_c int4 NULL,
|
||||
pct_of_backup_torque int4 NULL,
|
||||
equ_cblock_row_number_torque_nm numeric NULL,
|
||||
max_equ_crankshaft_torque_nm numeric NULL,
|
||||
load_pct int4 NULL,
|
||||
load_kg numeric NULL,
|
||||
required_stopping_distance_m numeric NULL,
|
||||
actual_stopping_distance_m numeric NULL,
|
||||
decceleartoin_m_per_s2 numeric NULL,
|
||||
lifting_time_sec int4 NULL,
|
||||
lowering_time_sec int4 NULL,
|
||||
speed_on_high_rpm_kmph numeric NULL,
|
||||
speed_on_low_rpm_kmph numeric NULL,
|
||||
speed_on_rated_rpm_kmph numeric NULL,
|
||||
body_location_temperature int4 NULL,
|
||||
speed_pto_rpm int4 NULL,
|
||||
brake_pedal_travel_lh_in_mm int4 NULL,
|
||||
brake_pedal_travel_rh_in_mm int4 NULL,
|
||||
brake_pedal_travel_latched_in_mm int4 NULL,
|
||||
pedal_travel_in_mm int4 null,
|
||||
noise_dba numeric NULL,
|
||||
test_file_load_date timestamp NULL,
|
||||
updated_by text NULL DEFAULT CURRENT_USER,
|
||||
created_by text NULL DEFAULT CURRENT_USER,
|
||||
update_timestamp timestamp NULL,
|
||||
create_timestamp timestamp NULL DEFAULT now(),
|
||||
CONSTRAINT fw_ads_pkey PRIMARY KEY (syspk)
|
||||
);
|
||||
|
||||
DROP TABLE if exists trx.trx_detailed;
|
||||
CREATE TABLE trx.trx_detailed (
|
||||
syspk serial NOT NULL,
|
||||
client_id int4 NOT NULL,
|
||||
function_id int4 NOT NULL,
|
||||
test_file_mnemonic text NULL,
|
||||
test_file_sheet_mnemonic text NULL,
|
||||
test_file_id int4 NULL,
|
||||
test_file_name text NULL,
|
||||
test_instance_id int4 NULL,
|
||||
tractor_make text NULL,
|
||||
tractor_model text NULL,
|
||||
tractor_engine_hp int4 NULL,
|
||||
wheel_drive_type text NULL,
|
||||
"configuration" text NULL,
|
||||
test_insance_tractor_id int4 NULL,
|
||||
season text NULL,
|
||||
test_date date NULL,
|
||||
test_date_year int4 NULL,
|
||||
test_date_quarter int4 NULL,
|
||||
test_date_month int4 NULL,
|
||||
test_date_dayofmonth int2 NULL,
|
||||
test_date_dayofweek int2 NULL,
|
||||
test_mode text NULL,
|
||||
test_type text NULL,
|
||||
test_sub_type text NULL,
|
||||
test_condition text NULL,
|
||||
location_name text NULL,
|
||||
test_detail_type text NULL,
|
||||
time_sec numeric NULL,
|
||||
steering_angle_degree numeric NULL,
|
||||
effort_kg numeric NULL,
|
||||
test_file_load_date timestamp NULL,
|
||||
updated_by text NULL DEFAULT CURRENT_USER,
|
||||
created_by text NULL DEFAULT CURRENT_USER,
|
||||
update_timestamp timestamp NULL DEFAULT now(),
|
||||
create_timestamp timestamp NULL DEFAULT now()
|
||||
);
|
||||
|
||||
drop table if exists trx.trx_tractor_specifications;
|
||||
create table trx.trx_tractor_specifications (
|
||||
syspk serial NOT NULL, -- PK
|
||||
Client_Id INT NOT NULL,
|
||||
Function_Id INT NOT NULL,
|
||||
Test_file_name text NOT NULL,
|
||||
Tractor_model text,
|
||||
Tractor_Spec_group text,
|
||||
Tractor_spec_parameter text,
|
||||
Tractor_spec_param_value text,
|
||||
Created_By TEXT NULL DEFAULT current_user,
|
||||
Updated_by text NULL,
|
||||
Create_timestamp TIMESTAMP NULL DEFAULT now(),
|
||||
update_timestamp TIMESTAMP NULL
|
||||
);
|
||||
@@ -0,0 +1,259 @@
|
||||
|
||||
/***********************************************************************************
|
||||
Name: Create_table_fw_ods
|
||||
Desc : Script creates the FW Datatypes and the fw_ods tables which store the final dim and measures and creates the following tables
|
||||
fw_ods - Stores all the dim and measures for all the test types
|
||||
fw_ods_detailed - stores the large sets of data such as steering data from IHT.
|
||||
fw_ods_tractor_specifications - tractor specifications which will be loaded manually
|
||||
Version Rev: v0.6
|
||||
Create Date: 15 April 2021
|
||||
Version History:
|
||||
v0.1 - Base Version
|
||||
v0.5 - ADDED FW DATA types
|
||||
v0.6 - Added the fw_ods_detailed and fw_ods_tractor_specifications tables
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
set search_path to fw_ods;
|
||||
-- Create FW DATA TYPEs to ensure there is no data issues.
|
||||
|
||||
-- SERIAL and BIGSERIAL datatypes are used from syspk columns in dim and fact tables.
|
||||
-- AS UDTs can't be defined on SERIAL data type.
|
||||
|
||||
|
||||
CREATE DOMAIN fw_flag_bool AS
|
||||
BOOL;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_flag_YN AS
|
||||
BPCHAR;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_date AS
|
||||
DATE;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_num_dimid AS
|
||||
INTEGER;
|
||||
|
||||
CREATE DOMAIN fw_num_bigid AS
|
||||
BIGINT;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_num_metric AS
|
||||
DECIMAL(15,4);
|
||||
|
||||
|
||||
CREATE DOMAIN fw_num_array AS
|
||||
INTEGER ARRAY;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_text AS
|
||||
TEXT;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_alphanum AS
|
||||
TEXT;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_text_array AS
|
||||
TEXT ARRAY;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_timestamp AS
|
||||
TIMESTAMP;
|
||||
|
||||
|
||||
CREATE DOMAIN fw_json AS
|
||||
JSON;
|
||||
|
||||
-- fw_ods table stores all relevant dim and metric/measures.
|
||||
|
||||
drop table if exists fw_ods.fw_ods;
|
||||
|
||||
CREATE TABLE fw_ods.fw_ods (
|
||||
syspk bigserial NOT NULL,
|
||||
client_id fw_num_dimid NOT NULL,
|
||||
function_id fw_num_dimid NOT NULL,
|
||||
test_file_mnemonic fw_text NULL,
|
||||
test_sheet_mnemonic fw_text NULL,
|
||||
test_name fw_text NULL,
|
||||
test_file_id fw_num_dimid NULL,
|
||||
test_file_name fw_text NULL,
|
||||
test_instance_id fw_num_dimid NULL,
|
||||
tractor_make fw_text NULL,
|
||||
tractor_model fw_text NULL,
|
||||
tractor_engine_hp fw_num_dimid NULL,
|
||||
wheel_drive_type fw_text NULL,
|
||||
"configuration" fw_text NULL,
|
||||
test_instance_tractor_id fw_num_dimid NULL,
|
||||
season fw_text NULL,
|
||||
test_date fw_date NULL,
|
||||
test_date_year fw_num_dimid NULL,
|
||||
test_date_quarter fw_num_dimid NULL,
|
||||
test_date_month fw_num_dimid NULL,
|
||||
test_date_dayofmonth int2 NULL,
|
||||
test_date_dayofweek int2 NULL,
|
||||
test_mode fw_text NULL,
|
||||
test_type fw_text NULL,
|
||||
test_sub_type fw_text NULL,
|
||||
test_condition fw_text NULL,
|
||||
test_purpose fw_text NULL,
|
||||
test_iteration_number fw_num_dimid NULL,
|
||||
test_ambient fw_text NULL,
|
||||
test_tractor_yn fw_text NULL,
|
||||
mahindra_model_yn fw_text NULL,
|
||||
location_name fw_text NULL,
|
||||
type_of_soil fw_text NULL,
|
||||
name_of_implement fw_text NULL,
|
||||
type_of_implement fw_text NULL,
|
||||
implement_weight_kg fw_num_dimid NULL,
|
||||
tyre_size fw_text NULL,
|
||||
tyre_ply_rating fw_num_dimid NULL,
|
||||
tyre_pressure_kg_per_cm2 fw_num_metric NULL,
|
||||
engine_speed_var fw_num_dimid NULL,
|
||||
engine_load_pct_var fw_num_dimid NULL,
|
||||
gear_used fw_text NULL,
|
||||
gear_used_up_slope_1 fw_text NULL,
|
||||
gear_used_up_slope_2 fw_text NULL,
|
||||
gear_used_down_slope fw_text NULL,
|
||||
gear_forward_reverse fw_text NULL,
|
||||
gear_pedal_effort_parameters fw_text NULL,
|
||||
sensor_body_location fw_text NULL,
|
||||
effort_type fw_text NULL,
|
||||
engine_rpm_type fw_text NULL,
|
||||
fuel_consumption_lit_per_hr fw_num_metric NULL,
|
||||
fuel_consumption_lit_per_acr fw_num_metric NULL,
|
||||
area_covered_acr_per_hr fw_num_metric NULL,
|
||||
speed_kmph fw_num_metric NULL,
|
||||
wheel_slippage_pct fw_num_metric NULL,
|
||||
field_efficiency_pct fw_num_metric NULL,
|
||||
productivity fw_num_metric NULL,
|
||||
erpmdrop_straight_1stpass_low fw_num_dimid NULL,
|
||||
erpmdrop_straight_1stpass_high fw_num_dimid NULL,
|
||||
erpmdrop_straight_2ndpass_low fw_num_dimid NULL,
|
||||
erpmdrop_straight_2ndpass_high fw_num_dimid NULL,
|
||||
erpmdrop_straight_3rdpass_low fw_num_dimid NULL,
|
||||
erpmdrop_straight_3rdpass_high fw_num_dimid NULL,
|
||||
erpmdrop_turn_1stpass_low fw_num_dimid NULL,
|
||||
erpmdrop_turn_1stpass_high fw_num_dimid NULL,
|
||||
erpmdrop_turn_2ndpass_low fw_num_dimid NULL,
|
||||
erpmdrop_turn_2ndpass_high fw_num_dimid NULL,
|
||||
erpmdrop_turn_3rdpass_low fw_num_dimid NULL,
|
||||
erpmdrop_turn_3rdpass_high fw_num_dimid NULL,
|
||||
no_of_passes fw_num_dimid NULL,
|
||||
depth_of_cut_cm_low fw_num_metric NULL,
|
||||
depth_of_cut_cm_high fw_num_metric NULL,
|
||||
total_dist_travelled_km fw_num_metric NULL,
|
||||
mileage_kmpl fw_num_metric NULL,
|
||||
power_kw fw_num_metric NULL,
|
||||
power_hp fw_num_metric NULL,
|
||||
pull_kgf fw_num_metric NULL,
|
||||
pull_kn fw_num_metric NULL,
|
||||
effort_kg fw_num_metric NULL,
|
||||
torque_kg_m fw_num_metric NULL,
|
||||
torque_nm fw_num_metric NULL,
|
||||
sfc_gms_per_hp_hr fw_num_metric NULL,
|
||||
sfc_g_per_kwh fw_num_metric NULL,
|
||||
fuelling_mm3_per_stroke_per_cyl fw_num_metric NULL,
|
||||
specific_energy_kwh_per_ltr fw_num_metric NULL,
|
||||
temp_engine_oil_c fw_num_dimid NULL,
|
||||
temp_engine_oil_high_c fw_num_dimid NULL,
|
||||
temp_trans_oil_c fw_num_dimid NULL,
|
||||
temp_trans_oil_high_c fw_num_dimid NULL,
|
||||
temp_coolant_c fw_num_dimid NULL,
|
||||
temp_coolant_high_c fw_num_dimid NULL,
|
||||
temp_fuel_in_c fw_num_dimid NULL,
|
||||
temp_fuel_high_c fw_num_dimid NULL,
|
||||
temp_fuel_out_c fw_num_dimid NULL,
|
||||
temp_water_outlet_c fw_num_dimid NULL,
|
||||
temp_exhaust_c fw_num_dimid NULL,
|
||||
temp_fuel_temp_c fw_num_dimid NULL,
|
||||
pct_of_backup_torque fw_num_dimid NULL,
|
||||
equ_crank_torque_nm fw_num_metric NULL,
|
||||
max_equ_crankshaft_torque_nm fw_num_metric NULL,
|
||||
load_pct fw_num_dimid NULL,
|
||||
load_kg fw_num_metric NULL,
|
||||
required_stopping_distance_m fw_num_metric NULL,
|
||||
actual_stopping_distance_m fw_num_metric NULL,
|
||||
decceleartoin_m_per_s2 fw_num_metric NULL,
|
||||
lifting_time_sec fw_num_dimid NULL,
|
||||
lowering_time_sec fw_num_dimid NULL,
|
||||
speed_on_high_rpm_kmph fw_num_metric NULL,
|
||||
speed_on_low_rpm_kmph fw_num_metric NULL,
|
||||
speed_on_rated_rpm_kmph fw_num_metric NULL,
|
||||
body_location_temperature fw_num_dimid NULL,
|
||||
speed_pto_rpm fw_num_dimid NULL,
|
||||
brake_pedal_travel_lh_in_mm fw_num_dimid NULL,
|
||||
brake_pedal_travel_rh_in_mm fw_num_dimid NULL,
|
||||
brake_pedal_travel_latched_in_mm fw_num_dimid NULL,
|
||||
pedal_travel_in_mm fw_num_dimid NULL,
|
||||
noise_dba fw_num_metric NULL,
|
||||
test_file_load_date fw_timestamp NULL,
|
||||
updated_by fw_text NULL ,
|
||||
created_by fw_text NULL DEFAULT CURRENT_USER,
|
||||
update_timestamp fw_timestamp NULL,
|
||||
create_timestamp fw_timestamp NULL DEFAULT now(),
|
||||
CONSTRAINT fw_ods_pkey PRIMARY KEY (syspk)
|
||||
);
|
||||
|
||||
|
||||
-- fw_ods_detailed table is used to store all big data, for example 6k records of stearing data from sensors.
|
||||
DROP TABLE if exists fw_ods.fw_ods_detailed;
|
||||
CREATE TABLE fw_ods.fw_ods_detailed (
|
||||
syspk serial NOT NULL,
|
||||
client_id fw_num_dimid NOT NULL,
|
||||
function_id fw_num_dimid NOT NULL,
|
||||
test_file_mnemonic fw_num_dimid NULL,
|
||||
test_sheet_mnemonic fw_num_dimid NULL,
|
||||
test_file_id fw_num_dimid NULL,
|
||||
test_file_name fw_text NULL,
|
||||
test_instance_id fw_num_dimid NULL,
|
||||
tractor_make fw_text NULL,
|
||||
tractor_model fw_text NULL,
|
||||
tractor_engine_hp fw_num_dimid NULL,
|
||||
wheel_drive_type fw_text NULL,
|
||||
"configuration" fw_text NULL,
|
||||
test_insance_tractor_id fw_num_dimid NULL,
|
||||
season fw_text NULL,
|
||||
test_date fw_date NULL,
|
||||
test_date_year fw_num_dimid NULL,
|
||||
test_date_quarter fw_num_dimid NULL,
|
||||
test_date_month fw_num_dimid NULL,
|
||||
test_date_dayofmonth fw_num_dimid NULL,
|
||||
test_date_dayofweek fw_num_dimid NULL,
|
||||
test_mode fw_text NULL,
|
||||
test_type fw_text NULL,
|
||||
test_sub_type fw_text NULL,
|
||||
test_condition fw_text NULL,
|
||||
location_name fw_text NULL,
|
||||
test_detail_type fw_text NULL,
|
||||
time_sec fw_num_metric NULL,
|
||||
steering_angle_degree fw_num_metric NULL,
|
||||
effort_kg fw_num_metric NULL,
|
||||
test_file_load_date fw_timestamp NULL,
|
||||
updated_by text NULL ,
|
||||
created_by text NULL DEFAULT CURRENT_USER,
|
||||
update_timestamp timestamp NULL ,
|
||||
create_timestamp timestamp NULL DEFAULT now()
|
||||
);
|
||||
|
||||
|
||||
-- fw_ids_tractor_specifications table is used to store all tractor specifications created before mmt testing project starts.
|
||||
-- the data into table will uploaded by the user manually.
|
||||
|
||||
drop table if exists fw_ods.fw_ods_tractor_specifications;
|
||||
create table fw_ods.fw_ods_tractor_specifications (
|
||||
syspk serial NOT NULL, -- PK
|
||||
Client_Id fw_num_dimid NOT NULL,
|
||||
Function_Id fw_num_dimid NOT NULL,
|
||||
Test_file_name fw_text NOT NULL,
|
||||
Tractor_model fw_text,
|
||||
Tractor_Spec_group fw_text,
|
||||
Tractor_spec_parameter fw_text,
|
||||
Tractor_spec_param_value fw_text,
|
||||
Created_By fw_text NULL DEFAULT current_user,
|
||||
Updated_by fw_text NULL,
|
||||
Create_timestamp fw_timestamp NULL DEFAULT now(),
|
||||
update_timestamp fw_TIMESTAMP NULL
|
||||
);
|
||||
2068
MMT_latest_version/sql/onetime/createtables/ods/ods_tables.sql
Normal file
2068
MMT_latest_version/sql/onetime/createtables/ods/ods_tables.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,342 @@
|
||||
SET search_path TO staging2;
|
||||
|
||||
|
||||
drop table if exists staging2.FTDRY_SUM_Trac_H1_Block;
|
||||
|
||||
drop table if exists staging2.FTDRY_SUM_Implement_Block;
|
||||
|
||||
drop table if exists staging2.FTDRY_SUM_Test_Condition_1_Block;
|
||||
|
||||
drop table if exists staging2.FTDRY_SUM_Test_Condition_2_Block;
|
||||
|
||||
drop table if exists staging2.FTDRY_SUM_Comments_By_Block;
|
||||
|
||||
drop table if exists staging2.stg_process_table_ftdry_sum;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_ftdry_sum;
|
||||
|
||||
create table staging2.FTDRY_SUM_Trac_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
create table staging2.FTDRY_SUM_Implement_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.FTDRY_SUM_Test_Condition_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTDRY_SUM_Test_Condition_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTDRY_SUM_Comments_By_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Engineer_Comments_3 text,
|
||||
Test_Manager_Comments_3 text,
|
||||
Test_Engineer_Comments_4 text,
|
||||
Test_Manager_Comments_4 text,
|
||||
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_ftdry_sum (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_ftdry_sum (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
SET search_path TO staging2;
|
||||
|
||||
drop table if exists staging2.FTDRY_TRS_H1_INT;
|
||||
|
||||
drop table if exists staging2.ftdry_trs_h1_block ;
|
||||
|
||||
drop table if exists staging2.ftdry_trs_implement_block ;
|
||||
|
||||
drop table if exists staging2.ftdry_trs_spec_block;
|
||||
|
||||
drop table if exists staging2.ftdry_trs_engine_rpm_block;
|
||||
|
||||
drop table if exists staging2.stg_process_table_ftdry_trs;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_ftdry_trs;
|
||||
|
||||
/* FTDRY_TRS starts */
|
||||
|
||||
create table staging2.FTDRY_TRS_H1_INT
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
column2 text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.FTDRY_TRS_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Report_Reference_No text,
|
||||
Objective_Of_Test text,
|
||||
Background_of_Test text,
|
||||
Job_Order_No text,
|
||||
Test_Location text,
|
||||
Soil_Moisture_Content_ text,
|
||||
Soil_Bulk_Density_g_cc text,
|
||||
Test_Engineer text,
|
||||
Test_Operator text,
|
||||
Date_of_Test text,
|
||||
Report_Date text,
|
||||
Season text,
|
||||
Type_of_Soil text,
|
||||
Soil_Cone_Index_kPa text,
|
||||
Field_Condition text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
create table staging2.FTDRY_TRS_SPEC_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Tractor_Model text,
|
||||
Tractor_Make text,
|
||||
Tractor_Sr_No text,
|
||||
Tractor_Engine_HP text,
|
||||
FIP_Type text,
|
||||
hour_Meter_Reading text,
|
||||
Steering_Type text,
|
||||
Transmission_Type text,
|
||||
Wheel_Drive_Type_WD text,
|
||||
EGR_Yes_No text,
|
||||
Brake_Type text,
|
||||
PTO_Type text,
|
||||
Standard_PTO_Speed_RPM text,
|
||||
EPTO_Speed_RPM text,
|
||||
Front_Tyre_Make text,
|
||||
Front_Tyre_Size text,
|
||||
Front_Tyre_Pressure_psi text,
|
||||
Rear_Tyre_Make text,
|
||||
Rear_Tyre_Size text,
|
||||
Rear_Tyre_Pressure_psi text,
|
||||
Tractor_Weight_kg_Front text,
|
||||
Tractor_Weight_kg_Rear text,
|
||||
Tractor_Weight_kg_Total text,
|
||||
Ballasted_Tractor_Accessories text,
|
||||
Mechanical_Ballast_Rear text,
|
||||
Mechanical_Ballast_Rear_in_KG text,
|
||||
Water_Ballast_Rear text,
|
||||
Mechanical_Ballast_Front text,
|
||||
Mechanical_Ballast_Front_in_Kg text,
|
||||
Total_Ballast_Weight text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTDRY_TRS_Engine_RPM_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Tractor_model text,
|
||||
Tractor_make text,
|
||||
tractor_sr_no text,
|
||||
Low_Idle text,
|
||||
High_Idle text,
|
||||
Rated_RPM text,
|
||||
Engine_to_PTO_Ratio_540_PTO text,
|
||||
Engine_to_PTO_Ratio_540E_PTO text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTDRY_TRS_Implement_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Name_of_Implement text,
|
||||
Type_of_Implement text,
|
||||
Make_of_Implement text,
|
||||
No_of_bottoms_Tyne_Disc_Blade text,
|
||||
Cutting_Width_m text,
|
||||
Implement_Weight_Kg text,
|
||||
Hitch_Category text,
|
||||
Span_cm_For_Mounted_Implement text,
|
||||
Mast_Height_cm_For_Mounted_Implement text,
|
||||
report_template_no text ,
|
||||
report_template_rev_no text,
|
||||
report_template_rev_date text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_ftdry_trs (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_ftdry_trs (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
/* FTDRY_TRS ends */
|
||||
@@ -0,0 +1,339 @@
|
||||
SET search_path TO staging2;
|
||||
|
||||
drop table if exists staging2.FTHLG_SUM_Trac_H1_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_SUM_Trail_Type_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_SUM_Test_Condition_1_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_SUM_Test_Condition_2_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_SUM_Comments_By_Block;
|
||||
|
||||
|
||||
drop table if exists staging2.stg_process_table_fthlg_sum;
|
||||
|
||||
|
||||
drop table if exists staging2.stg_specific_table_fthlg_sum;
|
||||
|
||||
|
||||
create table staging2.FTHLG_SUM_Trac_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
create table staging2.FTHLG_SUM_Trail_Type_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.FTHLG_SUM_Test_Condition_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Performance_compared_to_respective_competitor_tractors 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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTHLG_SUM_Test_Condition_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Performance_compared_to_respective_competitor_tractors 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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTHLG_SUM_Comments_By_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Engineer_Comments_3 text,
|
||||
Test_Manager_Comments_3 text,
|
||||
Test_Engineer_Comments_4 text,
|
||||
Test_Manager_Comments_4 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_fthlg_sum (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_fthlg_sum (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,315 @@
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
drop table if exists staging2.FTHLG_TRS_H1_INT;
|
||||
|
||||
drop table if exists staging2.FTHLG_TRS_H1_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_TRS_SPEC_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_TRS_Engine_RPM_Block;
|
||||
|
||||
drop table if exists staging2.FTHLG_TRS_Trailer_Block;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_fthlg_trs;
|
||||
|
||||
drop table if exists staging2.stg_process_table_fthlg_trs;
|
||||
|
||||
|
||||
create table staging2.FTHLG_TRS_H1_INT
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
column2 text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTHLG_TRS_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Report_Reference_No text,
|
||||
Objective_Of_Test text,
|
||||
Background_of_Test text,
|
||||
Job_Order_No text,
|
||||
Test_Location text,
|
||||
Gradient_Slope_1_Degree text,
|
||||
Gradient_Slope_2_Degree text,
|
||||
Tractor_Hitch_Type text,
|
||||
Test_Engineer text,
|
||||
Test_Operator text,
|
||||
Date_of_Test text,
|
||||
Report_Date text,
|
||||
Type_of_Road text,
|
||||
Tractor_Hitch_Height_from_Ground_mm text,
|
||||
Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
create table staging2.FTHLG_TRS_SPEC_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Tractor_Model text,
|
||||
Tractor_Make text,
|
||||
Tractor_Sr_No text,
|
||||
Tractor_Engine_HP text,
|
||||
FIP_Type text,
|
||||
Hour_Meter_Reading text,
|
||||
Steering_Type text,
|
||||
Transmission_Type text,
|
||||
Wheel_Drive_Type_WD text,
|
||||
EGR_Yes_No text,
|
||||
Brake_Type text,
|
||||
PTO_Type text,
|
||||
Standard_PTO_Speed_RPM text,
|
||||
EPTO_Speed_RPM text,
|
||||
Front_Tyre_Make text,
|
||||
Front_Tyre_Size text,
|
||||
Front_Tyre_Pressure_psi text,
|
||||
Rear_Tyre_Make text,
|
||||
Rear_Tyre_Size text,
|
||||
Rear_Tyre_Pressure_psi text,
|
||||
Tractor_Weight_kg_Front text,
|
||||
Tractor_Weight_kg_Rear text,
|
||||
Tractor_Weight_kg_Total text,
|
||||
Ballasted_Tractor_Accessories text,
|
||||
Mechanical_Ballast_Rear text,
|
||||
Mechanical_Ballast_Rear_in_kg text,
|
||||
Water_Ballast_Rear_75 text,
|
||||
Mechanical_Ballast_Front_in_kg text,
|
||||
Mechanical_Ballast_Front text,
|
||||
Total_Ballast_Weight text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTHLG_TRS_Engine_RPM_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Tractor_model text,
|
||||
Tractor_make text,
|
||||
tractor_sr_no text,
|
||||
Low_Idle text,
|
||||
High_Idle text,
|
||||
Rated_RPM text,
|
||||
Engine_to_PTO_Ratio_540_PTO text,
|
||||
Engine_to_PTO_Ratio_540E_PTO text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTHLG_TRS_Trailer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Type_Of_Trailer text,
|
||||
No_Of_Axle text,
|
||||
No_Of_Wheels text,
|
||||
Trailer_hitch_Height_above_ground_level_mm text,
|
||||
Make_model_of_trailer text,
|
||||
Trailer_platform_length_mm text,
|
||||
Trailer_platform_Width_mm text,
|
||||
Trailer_platform_Height_mm text,
|
||||
Tire_size text,
|
||||
Inflation_pressure_psi text,
|
||||
Track_width_of_trailer_mm text,
|
||||
Horizontal_distance_of_hitch_point_from_trailer_front_face_mm text,
|
||||
Tractor_Rear_Wheel_Center_to_Hitch_Point_Center_Distance_mm text,
|
||||
Distance_from_Trailer_front_axle_distance_from_hitch_point_mm text,
|
||||
Distance_from_tractor_rear_wheel_to_tractor_rear_wheel_mm text,
|
||||
Trailer_empty_weight_Kg text,
|
||||
Trailer_Gross_Weight_Kg text,
|
||||
report_template_no text ,
|
||||
report_template_rev_no text,
|
||||
report_template_rev_date text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_fthlg_trs (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_fthlg_trs (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
@@ -0,0 +1,306 @@
|
||||
SET search_path TO staging2;
|
||||
|
||||
|
||||
drop table if exists staging2.FTWET_SUM_Trac_H1_Block;
|
||||
|
||||
drop table if exists staging2.FTWET_SUM_Implement_Block;
|
||||
|
||||
drop table if exists staging2.FTWET_SUM_Cage_Wheel_Block;
|
||||
;
|
||||
drop table if exists staging2.FTWET_SUM_Test_Condition_Block;
|
||||
|
||||
drop table if exists staging2.FTWET_SUM_Comments_By_Block;
|
||||
|
||||
drop table if exists staging2.stg_process_table_ftwet_sum;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_ftwet_sum;
|
||||
|
||||
|
||||
create table staging2.FTWET_SUM_Trac_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTWET_SUM_Implement_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.FTWET_SUM_Cage_Wheel_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTWET_SUM_Test_Condition_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTWET_SUM_Comments_By_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_ftwet_sum (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_ftwet_sum (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
@@ -0,0 +1,316 @@
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
|
||||
drop table if exists staging2.FTWET_TRS_H1_INT;
|
||||
|
||||
drop table if exists staging2.FTWET_TRS_H1_Block;
|
||||
|
||||
drop table if exists staging2.FTWET_TRS_SPEC_Block;
|
||||
|
||||
drop table if exists staging2.FTWET_TRS_Engine_RPM_Block;
|
||||
|
||||
drop table if exists staging2.FTWET_TRS_Implement_Block;
|
||||
|
||||
drop table if exists staging2.stg_process_table_ftwet_trs;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_ftwet_trs;
|
||||
|
||||
|
||||
/* FTWET_TRS starts */
|
||||
create table staging2.FTWET_TRS_H1_INT
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
column2 text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTWET_TRS_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Report_Reference_No text,
|
||||
Objective_Of_Test text,
|
||||
Background_of_Test text,
|
||||
Job_Order_No text,
|
||||
Test_Location text,
|
||||
Soil_Moisture_Content_ text,
|
||||
Soil_Bulk_Density_g_cc text,
|
||||
Test_Engineer text,
|
||||
Test_Operator text,
|
||||
Date_of_Test text,
|
||||
Report_Date text,
|
||||
Season text,
|
||||
Type_of_Soil text,
|
||||
Soil_Cone_Index_kPa text,
|
||||
Field_Condition text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.FTWET_TRS_SPEC_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Tractor_Model text,
|
||||
Tractor_Make text,
|
||||
Tractor_Sr_No text,
|
||||
Tractor_Engine_HP text,
|
||||
FIP_Type text,
|
||||
hour_Meter_Reading text,
|
||||
Steering_Type text,
|
||||
Transmission_Type text,
|
||||
Wheel_Drive_Type_WD text,
|
||||
EGR_Yes_No text,
|
||||
Brake_Type text,
|
||||
PTO_Type text,
|
||||
Standard_PTO_Speed_RPM text,
|
||||
EPTO_Speed_RPM text,
|
||||
Front_Tyre_Make text,
|
||||
Front_Tyre_Size text,
|
||||
Front_Tyre_Pressure_psi text,
|
||||
Rear_Tyre_Make text,
|
||||
Rear_Tyre_Size text,
|
||||
Rear_Tyre_Pressure_psi text,
|
||||
Tractor_Weight_kg_Front text,
|
||||
Tractor_Weight_kg_Rear text,
|
||||
Tractor_Weight_kg_Total text,
|
||||
Ballasted_Tractor_Accessories text,
|
||||
Mechanical_Ballast_Rear_in_KG text,
|
||||
Water_Ballast_Rear text,
|
||||
Mechanical_Ballast_Front text,
|
||||
Mechanical_Ballast_Front_in_Kg text,
|
||||
Total_Ballast_Weight text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTWET_TRS_Engine_RPM_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Tractor_model text,
|
||||
Tractor_make text,
|
||||
tractor_sr_no text,
|
||||
Low_Idle text,
|
||||
High_Idle text,
|
||||
Rated_RPM text,
|
||||
Engine_to_PTO_Ratio_540_PTO text,
|
||||
Engine_to_PTO_Ratio_540E_PTO text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.FTWET_TRS_Implement_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
Name_of_Implement text,
|
||||
Type_of_Implement text,
|
||||
Make_of_Implement text,
|
||||
No_of_bottoms_Tyne_Disc_Blade text,
|
||||
Cutting_Width_m text,
|
||||
Implement_Weight_Kg text,
|
||||
Hitch_Category text,
|
||||
Span_cm_For_Mounted_Implement text,
|
||||
Mast_Height_cm_For_Mounted_Implement text,
|
||||
Type_of_Cage_Wheel_Half_Cage_wheel_Full_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_cage_wheel_Ring_mm_For_Full_wheel text,
|
||||
No_of_angles_on_cage_wheel text,
|
||||
No_of_days_of_water_logging text,
|
||||
Depth_of_water_mm text,
|
||||
report_template_no text ,
|
||||
report_template_rev_no text,
|
||||
report_template_rev_date text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_ftwet_trs (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_ftwet_trs (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
drop table if exists staging2.BUDNI_ARC_Spec_H1_Block;
|
||||
drop table if exists staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block;
|
||||
drop table if exists staging2.BUDNI_ARC_Test_Obs_Summary_Block;
|
||||
drop table if exists staging2.stg_process_table_BUDNI_ARC;
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_ARC;
|
||||
|
||||
create table staging2.BUDNI_ARC_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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 ,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_ARC_Perf_Atmos_Meas_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_ARC_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_ARC (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_ARC (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,440 @@
|
||||
drop table if exists staging2.BUDNI_BRK_Spec_H1_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_Service_Barke_Test_Int;
|
||||
drop table if exists staging2.BUDNI_BRK_service_cold_standard_maximum_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_service_cold_standard_25kmph_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_service_fade_standard_maximum_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_other_observations_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_Parking_Barke_Test_Int ;
|
||||
drop table if exists staging2.BUDNI_BRK_Parking_Barke_Test_Block;
|
||||
drop table if exists staging2.BUDNI_BRK_Test_Obs_Summary_Block;
|
||||
drop table if exists staging2.stg_process_table_BUDNI_BRK;
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_BRK;
|
||||
|
||||
|
||||
create table staging2.BUDNI_BRK_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_Service_Barke_Test_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_service_cold_standard_maximum_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_service_cold_ballasted_maximum_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_service_cold_standard_25kmph_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_service_cold_ballasted_25kmph_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_service_fade_standard_maximum_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_service_fade_ballasted_25kmph_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_other_observations_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.budni_brk_parking_barke_test_int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_BRK_Parking_Barke_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
particulars text,
|
||||
facing text,
|
||||
Braking_device_control_force text,
|
||||
Efficacy_of_parking_brake text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
create table staging2.BUDNI_BRK_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_BRK (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_BRK (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
drop table if exists staging2.BUDNI_DBP_Spec_H1_Block;
|
||||
|
||||
drop table if exists staging2.BUDNI_DBP_Drawbar_Perf_Block;
|
||||
|
||||
drop table if exists staging2.stg_process_table_budni_dbp;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_budni_dbp;
|
||||
|
||||
create table staging2.BUDNI_DBP_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_DBP_Drawbar_Perf_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_budni_dbp (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_budni_dbp (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
drop table if exists staging2.BUDNI_FLD_Spec_H1_Block;
|
||||
drop table if exists staging2.BUDNI_FLD_Impl_Test_Int;
|
||||
drop table if exists staging2.BUDNI_FLD_Impl_Test_Block;
|
||||
drop table if exists staging2.BUDNI_FLD_Cage_Wheel_Block;
|
||||
drop table if exists staging2.BUDNI_FLD_Sum_Perf_Test_Int;
|
||||
drop table if exists staging2.BUDNI_FLD_Sum_Perf_Test_Block;
|
||||
drop table if exists staging2.BUDNI_FLD_Test_Obs_Summary_Block;
|
||||
drop table if exists staging2.stg_process_table_BUDNI_FLD;
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_FLD;
|
||||
|
||||
|
||||
create table staging2.BUDNI_FLD_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_FLD_Impl_Test_INT
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_FLD_Impl_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_FLD_Cage_Wheel_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_FLD_Sum_Perf_Test_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_FLD_Sum_Perf_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_FLD_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_FLD (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_FLD (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
drop table if exists staging2.stg_specific_table_budni_hdl;
|
||||
drop table if exists staging2.stg_process_table_budni_hdl;
|
||||
drop table if exists staging2.budni_hdl_Spec_H1_Block;
|
||||
drop table if exists staging2.budni_hdl_power_test_Block;
|
||||
drop table if exists staging2.budni_hdl_Lifting_Capacity_Test_Block;
|
||||
drop table if exists staging2.budni_hdl_Maintenance_of_lift_load_int;
|
||||
drop table if exists staging2.budni_hdl_Maintenance_of_lift_load_Block;
|
||||
drop table if exists staging2.budni_hdl_Test_Obs_Summary_Block;
|
||||
|
||||
|
||||
create table staging2.budni_hdl_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.budni_hdl_power_test_block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
Pump_delivery_rate_at_min_pressure_and_rated_engine 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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.budni_hdl_Lifting_Capacity_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
column10 text,
|
||||
column11 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.budni_hdl_Maintenance_of_lift_load_int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.budni_hdl_Maintenance_of_lift_load_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.budni_hdl_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_budni_hdl (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_budni_hdl (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
drop table if exists staging2.BUDNI_HLG_Spec_H1_Block;
|
||||
drop table if exists staging2.BUDNI_HLG_Perf_Test_int;
|
||||
drop table if exists staging2.BUDNI_HLG_Perf_Test_block;
|
||||
drop table if exists staging2.BUDNI_HLG_Test_Obs_Summary_Block;
|
||||
drop table if exists staging2.stg_process_table_BUDNI_HLG;
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_HLG;
|
||||
|
||||
|
||||
create table staging2.BUDNI_HLG_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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 ,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_HLG_Perf_Test_int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column6 text,
|
||||
column8 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_HLG_Perf_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_HLG_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_HLG (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_HLG (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
drop table if exists staging2.BUDNI_LCG_Spec_H1_Block;
|
||||
|
||||
drop table if exists staging2.BUDNI_LCG_Gravity_Test_Block;
|
||||
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_LCG;
|
||||
|
||||
drop table if exists staging2.stg_process_table_BUDNI_LCG;
|
||||
|
||||
create table staging2.BUDNI_LCG_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_LCG_Gravity_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column2 text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_LCG (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_LCG (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,348 @@
|
||||
drop table if exists staging2.BUDNI_NMT_Spec_H1_Block;
|
||||
drop table if exists staging2.budni_nmt_noise_at_bystander_position_block;
|
||||
drop table if exists staging2.BUDNI_NMT_Atmos_Cond_1_Block;
|
||||
drop table if exists staging2.BUDNI_NMT_Meas_Results_1_Block;
|
||||
drop table if exists staging2.budni_nmt_noise_at_operator_ear_level_block;
|
||||
drop table if exists staging2.BUDNI_NMT_Atmos_Cond_2_Block;
|
||||
drop table if exists staging2.BUDNI_NMT_Meas_Results_2_Block;
|
||||
drop table if exists staging2.BUDNI_NMT_Test_Obs_Summary_Block;
|
||||
drop table if exists staging2.stg_process_table_budni_nmt;
|
||||
drop table if exists staging2.stg_specific_table_budni_nmt;
|
||||
|
||||
|
||||
create table staging2.BUDNI_NMT_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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 ,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Atmos_Cond_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Noise_at_bystander_position_block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Meas_Results_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Noise_at_operator_ear_level_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Atmos_Cond_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Meas_Results_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_NMT_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_NMT (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_NMT (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_PTO;
|
||||
drop table if exists staging2.stg_process_table_BUDNI_PTO;
|
||||
drop table if exists staging2.BUDNI_PTO_Spec_H1_Block;
|
||||
drop table if exists staging2.BUDNI_PTO_Perf_Report_block;
|
||||
drop table if exists staging2.BUDNI_PTO_MMTKeyword1_Block;
|
||||
drop table if exists staging2.BUDNI_PTO_MMTKeyword2_Block;
|
||||
drop table if exists staging2.BUDNI_PTO_Summary_Block;
|
||||
|
||||
|
||||
create table staging2.BUDNI_PTO_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_PTO_Perf_Report_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_PTO_MMTKeyword1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_PTO_MMTKeyword2_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.BUDNI_PTO_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_PTO (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_PTO (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
drop table if exists staging2.BUDNI_VMT_Spec_H1_Block;
|
||||
drop table if exists staging2.BUDNI_VMT_Perf_Meas_Test_Block;
|
||||
drop table if exists staging2.BUDNI_VMT_Test_Obs_Summary_Block;
|
||||
drop table if exists staging2.stg_process_table_BUDNI_VMT;
|
||||
drop table if exists staging2.stg_specific_table_BUDNI_VMT;
|
||||
|
||||
|
||||
create table staging2.BUDNI_VMT_Spec_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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 ,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_VMT_Perf_Meas_Test_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.BUDNI_VMT_Test_Obs_Summary_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_BUDNI_VMT (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_BUDNI_VMT (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,750 @@
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
drop table if exists staging2.dboecd_test_transmission_wheels_int;
|
||||
drop table if exists staging2.DBOECD_TEST_H1_Block;
|
||||
drop table if EXISTS staging2.DBOECD_TEST_H1_INT ;
|
||||
drop table if exists staging2.dboecd_test_engine_rpm_engine_to_pto_block;
|
||||
drop table if exists staging2.dboecd_test_engine_rpm_required_pull_block;
|
||||
drop table if exists staging2.dboecd_test_engine_rpm_weight_block;
|
||||
drop table if exists staging2.dboecd_test_engine_rpm_tyre_details_block;
|
||||
drop table if exists staging2.dboecd_test_engine_RPM_tyre_details_int;
|
||||
drop table if exists staging2.dboecd_test_test_condition_block;
|
||||
drop table if exists staging2.dboecd_test_drawbar_performance_selected_summary_block;
|
||||
drop table if exists staging2.dboecd_test_drawbar_performance_gear_performance_block;
|
||||
drop table if exists staging2.dboecd_test_drawbar_performance_fuel_consumption_block;
|
||||
drop table if exists staging2.dboecd_test_test_equipment_used_block;
|
||||
drop table if exists staging2.dboecd_test_measurement_uncertainty_block;
|
||||
drop table if exists staging2.dboecd_test_tractor_specifications_engine_details_block;
|
||||
drop table if exists staging2.dboecd_test_tractor_specifications_cylinders_block;
|
||||
drop table if exists staging2.dboecd_test_tractor_specifications_fuel_and_injection_block;
|
||||
drop table if exists staging2.dboecd_test_tractor_specifications_cleaner_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_clutch_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_drawbar_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_speed_chart_desc_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_wheels_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_fuel_lubricant_int;
|
||||
drop table if exists staging2.dboecd_test_remarks_block;
|
||||
drop table if exists staging2.dboecd_test_remarks_footer_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_fuel_lubricant_block;
|
||||
drop table if exists staging2.dboecd_test_engine_rpm_rpm_block;
|
||||
drop table if exists staging2.dboecd_test_transmission_speed_chart_block;
|
||||
drop table if exists staging2.stg_specific_table_dboecd_test;
|
||||
drop table if exists staging2.stg_process_table_dboecd_test;
|
||||
|
||||
create table staging2.DBOECD_TEST_H1_INT
|
||||
(syspk serial,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
c1 text,
|
||||
c2 text,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.DBOECD_TEST_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,file_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 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_mnemonic text,file_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 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
weight_kg text,
|
||||
Front text,
|
||||
rear text,
|
||||
Total text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
s_no text,
|
||||
tyre_details text,
|
||||
front text,
|
||||
rear text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
c1 text,
|
||||
c2 text,
|
||||
c3 text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
s_no text,
|
||||
instruments text,
|
||||
instruments_no text,
|
||||
cali_due_date text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
load_cell text,
|
||||
rpm_meter text,
|
||||
speed text,
|
||||
fuel_flow_meter text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.DBOECD_test_tractor_specifications_engine_details_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
number text,
|
||||
stroke text,
|
||||
bore text,
|
||||
capacity text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 staging2.DBOECD_test_tractor_specifications_cleaner_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
cleaner_type text,
|
||||
make_and_model text,
|
||||
type text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
clutch_type text,
|
||||
steering_type text,
|
||||
diameter_of_disc_mm text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
descr text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
tyre_condition text,
|
||||
gear text,
|
||||
forward text,
|
||||
reverse text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Descriptions text,
|
||||
Steered_wheels text,
|
||||
Driving_wheel text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Descriptions text,
|
||||
Diesel_BS_IV text,
|
||||
Engine_oil text,
|
||||
Transmission_oil text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 staging2.DBOECD_test_remarks_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
remarks text,
|
||||
parameter text,
|
||||
acceptance_criteria text,
|
||||
observations text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 staging2.stg_process_table_dboecd_test (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_dboecd_test (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
@@ -0,0 +1,696 @@
|
||||
/* create block tables */
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
drop table if exists staging2.dbstd_test_transmission_wheels_int;
|
||||
drop table if exists staging2.dbstd_test_h1_int;
|
||||
drop table if exists staging2.dbstd_test_engine_rpm_engine_to_pto_block;
|
||||
drop table if exists staging2.dbstd_test_engine_rpm_required_pull_block;
|
||||
drop table if exists staging2.dbstd_test_engine_rpm_weight_block;
|
||||
drop table if exists staging2.dbstd_test_engine_rpm_tyre_details_block;
|
||||
drop table if exists staging2.DBSTD_test_engine_RPM_tyre_details_int;
|
||||
drop table if exists staging2.dbstd_test_test_condition_block;
|
||||
drop table if exists staging2.dbstd_test_drawbar_performance_selected_summary_block;
|
||||
drop table if exists staging2.dbstd_test_drawbar_performance_gear_performance_block;
|
||||
drop table if exists staging2.dbstd_test_test_equipment_used_block;
|
||||
drop table if exists staging2.dbstd_test_measurement_uncertainty_block;
|
||||
drop table if exists staging2.dbstd_test_tractor_specifications_engine_details_block;
|
||||
drop table if exists staging2.dbstd_test_tractor_specifications_cylinders_block;
|
||||
drop table if exists staging2.dbstd_test_tractor_specifications_fuel_and_injection_block;
|
||||
drop table if exists staging2.dbstd_test_tractor_specifications_cleaner_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_clutch_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_drawbar_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_speed_chart_desc_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_wheels_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_fuel_lubricant_int;
|
||||
drop table if exists staging2.dbstd_test_remarks_block;
|
||||
drop table if exists staging2.dbstd_test_remarks_footer_block;
|
||||
drop table if exists staging2.dbstd_test_h1_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_fuel_lubricant_block;
|
||||
drop table if exists staging2.dbstd_test_engine_rpm_rpm_block;
|
||||
drop table if exists staging2.dbstd_test_transmission_speed_chart_block;
|
||||
drop table if exists staging2.stg_specific_table_dbstd_test;
|
||||
drop table if exists staging2.stg_process_table_dbstd_test;
|
||||
|
||||
create table staging2.DBSTD_TEST_H1_INT (syspk serial,dummy_f text,file_syspk int,client_id int,function_id int,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.DBSTD_TEST_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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 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_mnemonic text,file_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 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_mnemonic text,file_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 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
weight_kg text,
|
||||
Front text,
|
||||
rear text,
|
||||
Total text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
s_no text,
|
||||
tyre_details text,
|
||||
front text,
|
||||
rear text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
c1 text,
|
||||
c2 text,
|
||||
c3 text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
s_no text,
|
||||
instruments text,
|
||||
instruments_no text,
|
||||
cali_due_date text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
load_cell text,
|
||||
rpm_meter text,
|
||||
speed text,
|
||||
fuel_flow_meter text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.DBSTD_test_tractor_specifications_engine_details_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
number text,
|
||||
stroke text,
|
||||
bore text,
|
||||
capacity text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 staging2.DBSTD_test_tractor_specifications_cleaner_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
cleaner_type text,
|
||||
make_and_model text,
|
||||
type text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
clutch_type text,
|
||||
steering_type text,
|
||||
diameter_of_disc_mm text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
descr text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
tyre_condition text,
|
||||
gear text,
|
||||
forward text,
|
||||
reverse text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Descriptions text,
|
||||
Steered_wheels text,
|
||||
Driving_wheel text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 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_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Descriptions text,
|
||||
Diesel_BS_IV text,
|
||||
Engine_oil text,
|
||||
Transmission_oil text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 staging2.DBSTD_test_remarks_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
remarks text,
|
||||
parameter text,
|
||||
acceptance_criteria text,
|
||||
observations text,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table 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_mnemonic text,
|
||||
file_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 staging2.stg_process_table_dbstd_test (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_dbstd_test (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
@@ -0,0 +1,939 @@
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
drop table if exists staging2.stg_process_table_PTOBEN_PRF;
|
||||
drop table if exists staging2.stg_specific_table_PTOBEN_PRF;
|
||||
drop table if exists staging2.stg_process_table_PTOBEN_MPM;
|
||||
drop table if exists staging2.stg_specific_table_PTOBEN_MPM;
|
||||
drop table if exists staging2.stg_process_table_PTOBEN_GVG;
|
||||
drop table if exists staging2.stg_specific_table_PTOBEN_GVG;
|
||||
drop table if exists staging2.PTOBEN_PRF_tractor_specs_int;
|
||||
drop table if exists staging2.PTOBEN_PRF_tractor_specs_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_key_performance_parameters_int;
|
||||
drop table if exists staging2.PTOBEN_PRF_key_performance_parameters_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_varying_speed_natural_ambient_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_2hrs_max_power_natural_ambient_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_varying_load_rated_rpm_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_varying_load_std_pto_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_smoke_test_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_varying_speed_test_high_ambient_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_2hrs_max_power_test_high_ambient_block;
|
||||
drop table if exists staging2.PTOBEN_PRF_engine_oil_consumption_block;
|
||||
drop table if exists staging2.PTOBEN_MPM_performance_boost_natural_block;
|
||||
drop table if exists staging2.PTOBEN_GVG_performance_governing_trails_block;
|
||||
|
||||
create table staging2.PTOBEN_PRF_tractor_specs_int
|
||||
(
|
||||
file_syspk serial,
|
||||
c1 text,
|
||||
c2 text,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_tractor_specs_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
make text,
|
||||
model text,
|
||||
test_standard text,
|
||||
tractor_emmission text,
|
||||
tractor_serial_number text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_key_performance_parameters_int
|
||||
(
|
||||
file_syspk serial,
|
||||
c1 text,
|
||||
c2 text,
|
||||
c3 text,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_key_performance_parameters_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
make text,
|
||||
model text,
|
||||
test_standard text,
|
||||
tractor_emmission text,
|
||||
tractor_serial_number text,
|
||||
test_condition text,
|
||||
Engine_to_PTO_ratio text,
|
||||
specific_gravity_of_fuel text,
|
||||
PTO_power_hp text,
|
||||
PTO_power_Kw text,
|
||||
PTO_SFC_gm_hp text,
|
||||
PTO_SFC_Kw_hp text,
|
||||
pct_of_backup_torque text,
|
||||
Maximum_Equ_crankshaft_Torque_Nm text,
|
||||
Equ_Crankshaft_Torque_Maximum_Power_Nm text,
|
||||
Engine_speed_at_maximum_equivalent_crankshaft_torque_rpm text,
|
||||
Rated_engine_speed text,
|
||||
max_torque_engine_speed text,
|
||||
Engine_low_idle_speed text,
|
||||
Engine_high_Idle_speed text,
|
||||
Engine_oil_temp_NA text,
|
||||
Coolant_temp_NA text,
|
||||
Engine_oil_temp_HA text,
|
||||
Coolant_temp_HA text,
|
||||
Ambient_pressure_bar text,
|
||||
Ambient_pressure_mm_of_hg text,
|
||||
back_pressure_bar text,
|
||||
back_pressure_mm_of_hg text,
|
||||
Engine_oil_pressure_bar text,
|
||||
exhaust_temperature_C text,
|
||||
Relative_humidity_pct text,
|
||||
Coolant_water_pct text,
|
||||
Test_engineer text,
|
||||
Test_bed text,
|
||||
Place text,
|
||||
Total_run_hrs text,
|
||||
Test_date text,
|
||||
Tooled_up text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_varying_speed_natural_ambient_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
c26 text,
|
||||
c27 text,
|
||||
c28 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_2hrs_max_power_natural_ambient_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
c26 text,
|
||||
c27 text,
|
||||
c28 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.PTOBEN_PRF_varying_load_rated_rpm_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
c26 text,
|
||||
c27 text,
|
||||
c28 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_varying_load_std_pto_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
c26 text,
|
||||
c27 text,
|
||||
c28 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_smoke_test_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
make text,
|
||||
model text,
|
||||
test_condition text,
|
||||
c2 text,
|
||||
c3 text,
|
||||
c4 text,
|
||||
c5 text,
|
||||
c6 text,
|
||||
c7 text,
|
||||
c8 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.PTOBEN_PRF_varying_speed_test_high_ambient_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
c26 text,
|
||||
c27 text,
|
||||
c28 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.PTOBEN_PRF_2hrs_max_power_test_high_ambient_block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
c26 text,
|
||||
c27 text,
|
||||
c28 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE staging2.PTOBEN_PRF_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_mnemonic text NULL,
|
||||
file_sheet_mnemonic text NULL,
|
||||
make text NULL,
|
||||
model text NULL,
|
||||
test_condition text NULL,
|
||||
c2 text NULL,
|
||||
c3 text NULL,
|
||||
c5 text NULL,
|
||||
block_row_number int NULL,
|
||||
trx_record int4 NULL DEFAULT 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.PTOBEN_MPM_performance_boost_natural_block (
|
||||
syspk serial NOT NULL,
|
||||
client_id int4 NULL,
|
||||
function_id int4 NULL,
|
||||
file_syspk int4 NULL,
|
||||
dummy_f text NULL,
|
||||
file_mnemonic text NULL,
|
||||
file_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,
|
||||
block_row_number int NULL,
|
||||
trx_record int4 NULL DEFAULT 1,
|
||||
create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.PTOBEN_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_mnemonic text NULL,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int4 NULL DEFAULT 1,
|
||||
create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
/*sheet */
|
||||
|
||||
create TABLE staging2.stg_process_table_PTOBEN_PRF (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_PTOBEN_PRF (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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 staging2.stg_process_table_PTOBEN_MPM (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_PTOBEN_MPM (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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 staging2.stg_process_table_PTOBEN_GVG (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_PTOBEN_GVG (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
@@ -0,0 +1,370 @@
|
||||
drop table if exists staging2.IHTCGM_CGM_H1_Int;
|
||||
drop table if exists staging2.IHTCGM_CGM_H1_block;
|
||||
drop table if exists staging2.IHTCGM_CGM_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTCGM_CGM_Weight_Block;
|
||||
drop table if exists staging2.IHTCGM_CGM_Wheel_Block;
|
||||
drop table if exists staging2.IHTCGM_CGM_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTCGM_CGM_Lifting_Block;
|
||||
drop table if exists staging2.IHTCGM_CGM_Results_Block;
|
||||
drop table if exists staging2.IHTCGM_CGM_Footer_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTCGM_CGM;
|
||||
drop table if exists staging2.stg_process_table_IHTCGM_CGM;
|
||||
|
||||
create table staging2.IHTCGM_CGM_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTCGM_CGM_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Purpose text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Wheel_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
Wheel_Base text,
|
||||
Rear_Track_Width text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Lifting_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Results_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTCGM_CGM_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTCGM_CGM (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTCGM_CGM (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,397 @@
|
||||
drop table if exists staging2.IHTEMT_EMT_H1_INT;
|
||||
drop table if exists staging2.IHTEMT_EMT_H1_block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTEMT_EMT_Weight_Block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Wheel_Block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Steering_Block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Pedal_Block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Brake_Pedal_Block;
|
||||
drop table if exists staging2.IHTEMT_EMT_Footer_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTEMT_EMT;
|
||||
drop table if exists staging2.stg_process_table_IHTEMT_EMT;
|
||||
|
||||
create table staging2.IHTEMT_EMT_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTEMT_EMT_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Purpose text,
|
||||
trx_record int default 1,
|
||||
block_row_number int,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Wheel_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
Wheel_Base text,
|
||||
tcd text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Steering_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column2 text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column8 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Pedal_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column2 text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column8 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Brake_Pedal_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTEMT_EMT_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTEMT_EMT (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTEMT_EMT (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
drop table if exists staging2.IHTEMT_STD_RAW_Data_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTEMT_STD;
|
||||
drop table if exists staging2.stg_process_table_IHTEMT_STD;
|
||||
|
||||
create table staging2.IHTEMT_STD_RAW_Data_Block
|
||||
(syspk serial,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Time_s text,
|
||||
Steering_Angle text,
|
||||
Effort text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTEMT_STD (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTEMT_STD (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
drop table if exists staging2.IHTHAM_HAM_H1_Int;
|
||||
drop table if exists staging2.IHTHAM_HAM_H1_block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int;
|
||||
drop table if exists staging2.IHTHAM_HAM_Engine_RPM_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Tractor_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Weight_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Drawbar_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Atmos_Cond_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Results_Block;
|
||||
drop table if exists staging2.IHTHAM_HAM_Footer_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTHAM_HAM;
|
||||
drop table if exists staging2.stg_process_table_IHTHAM_HAM;
|
||||
|
||||
create table staging2.IHTHAM_HAM_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTHAM_HAM_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Remarks text,
|
||||
condition text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
column21 text,
|
||||
column22 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
test_condition text,
|
||||
Front_weight text,
|
||||
Rear_weight text,
|
||||
Total_weight text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Tractor_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
Wheel_Base_mm text,
|
||||
Engine_Power_hp text,
|
||||
PTO_Power_hp text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Drawbar_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Atmos_Cond_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Results_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHAM_HAM_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTHAM_HAM (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTHAM_HAM (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,371 @@
|
||||
drop table if exists staging2.IHTHLS_HLS_H1_Int;
|
||||
drop table if exists staging2.IHTHLS_HLS_H1_block;
|
||||
drop table if exists staging2.IHTHLS_HLS_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTHLS_HLS_Weight_Block;
|
||||
drop table if exists staging2.IHTHLS_HLS_Wheel_Block;
|
||||
drop table if exists staging2.IHTHLS_HLS_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTHLS_HLS_Numeric_Int;
|
||||
drop table if exists staging2.IHTHLS_HLS_Numeric_Block;
|
||||
drop table if exists staging2.IHTHLS_HLS_Footer_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTHLS_HLS;
|
||||
drop table if exists staging2.stg_process_table_IHTHLS_HLS;
|
||||
|
||||
create table staging2.IHTHLS_HLS_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTHLS_HLS_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Purpose text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHLS_HLS_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHLS_HLS_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHLS_HLS_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHLS_HLS_Wheel_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
Wheel_Base text,
|
||||
Rear_Track_Width text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTHLS_HLS_Numeric_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.IHTHLS_HLS_Numeric_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
TPL_load text,
|
||||
Engine_RPM text,
|
||||
Lifting_time_Sec text,
|
||||
Lowering_time_Sec text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
|
||||
create table staging2.IHTHLS_HLS_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTHLS_HLS (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTHLS_HLS (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,420 @@
|
||||
drop table if exists staging2.IHTNST_NST_H1_Int;
|
||||
drop table if exists staging2.IHTNST_NST_H1_block;
|
||||
drop table if exists staging2.IHTNST_NST_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTNST_NST_Engine_RPM_Atmos_Int;
|
||||
drop table if exists staging2.IHTNST_NST_Engine_RPM_Block;
|
||||
drop table if exists staging2.IHTNST_NST_Weight_Block;
|
||||
drop table if exists staging2.IHTNST_NST_Atmos_Cond_Block;
|
||||
drop table if exists staging2.IHTNST_NST_STAND_Noise_Block;
|
||||
drop table if exists staging2.IHTNST_NST_OEL_Noise_Block;
|
||||
drop table if exists staging2.IHTNST_NST_OEL_Noise_Load_Block;
|
||||
drop table if exists staging2.IHTNST_NST_Footer_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTNST_NST;
|
||||
drop table if exists staging2.stg_process_table_IHTNST_NST;
|
||||
|
||||
create table staging2.IHTNST_NST_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTNST_NST_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Purpose text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Tyre_Details text,
|
||||
Tyre_Make text,
|
||||
Tyre_size text,
|
||||
Ply_Rating text,
|
||||
Load_Carrying_Capacity text,
|
||||
Wheel_rim_Make_size text,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
column9 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_Engine_RPM_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_Atmos_Cond_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_STAND_Noise_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_OEL_Noise_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTNST_NST_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTNST_NST (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTNST_NST (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,398 @@
|
||||
drop table if exists staging2.IHTSLL_SLL_H1_Int;
|
||||
drop table if exists staging2.IHTSLL_SLL_H1_block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTSLL_SLL_Weight_Block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Wheel_Block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Forward_Block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Reverse_Block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Lead_Lag_Block;
|
||||
drop table if exists staging2.IHTSLL_SLL_Footer_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTSLL_SLL;
|
||||
drop table if exists staging2.stg_process_table_IHTSLL_SLL;
|
||||
|
||||
create table staging2.IHTSLL_SLL_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTSLL_SLL_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_purpose text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Wheel_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
Wheel_Base text,
|
||||
Rear_Track_Width text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Forward_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Reverse_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Lead_Lag_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
column3 text,
|
||||
column4 text,
|
||||
column5 text,
|
||||
column6 text,
|
||||
column7 text,
|
||||
column8 text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTSLL_SLL_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTSLL_SLL (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTSLL_SLL (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,438 @@
|
||||
drop table if exists staging2.IHTBT30_BT30_H1_INT;
|
||||
drop table if exists staging2.IHTBT30_BT30_H1_block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTBT30_BT30_Weight_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Test_Res_1_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Test_Res_2_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Test_Res_3_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Test_Res_4_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Footer_Block;
|
||||
drop table if exists staging2.IHTBT30_BT30_Test_Condition_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTBT30_BT30;
|
||||
drop table if exists staging2.stg_process_table_IHTBT30_BT30;
|
||||
|
||||
create table staging2.IHTBT30_BT30_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTBT30_BT30_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Standard_ref text,
|
||||
Remarks text,
|
||||
Observations text,
|
||||
Acceptance_Criteria text,
|
||||
condition text,
|
||||
Test_Purpose text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
test_condition text,
|
||||
Front text,
|
||||
Rear text,
|
||||
Total text,
|
||||
status text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Tyre_Details text,
|
||||
Pressure_kg_cm2 text,
|
||||
tyre_use_type text,
|
||||
Tyre_Make text,
|
||||
Tyre_size text,
|
||||
Ply_Rating text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
condition text,
|
||||
date text,
|
||||
location text,
|
||||
time text,
|
||||
mode text,
|
||||
Wind_Velocity_Km_hr text,
|
||||
Ambient_Temperature_C text,
|
||||
Humidity_RH text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Test_Res_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Test_Res_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Test_Res_3_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Test_Res_4_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT30_BT30_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTBT30_BT30 (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTBT30_BT30 (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,438 @@
|
||||
drop table if exists staging2.IHTBT50_BT50_H1_INT;
|
||||
drop table if exists staging2.IHTBT50_BT50_H1_block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTBT50_BT50_Weight_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Test_Res_1_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Test_Res_2_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Test_Res_3_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Test_Res_4_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Footer_Block;
|
||||
drop table if exists staging2.IHTBT50_BT50_Test_Condition_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTBT50_BT50;
|
||||
drop table if exists staging2.stg_process_table_IHTBT50_BT50;
|
||||
|
||||
create table staging2.IHTBT50_BT50_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTBT50_BT50_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Standard_ref text,
|
||||
Remarks text,
|
||||
Observations text,
|
||||
Acceptance_Criteria text,
|
||||
condition text,
|
||||
Test_Purpose text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
test_condition text,
|
||||
Front text,
|
||||
Rear text,
|
||||
Total text,
|
||||
status text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Tyre_Details text,
|
||||
Pressure_kg_cm2 text,
|
||||
tyre_use_type text,
|
||||
Tyre_Make text,
|
||||
Tyre_size text,
|
||||
Ply_Rating text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
condition text,
|
||||
date text,
|
||||
location text,
|
||||
time text,
|
||||
mode text,
|
||||
Wind_Velocity_Km_hr text,
|
||||
Ambient_Temperature_C text,
|
||||
Humidity_RH text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Test_Res_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Test_Res_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Test_Res_3_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Test_Res_4_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBT50_BT50_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTBT50_BT50 (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTBT50_BT50 (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,496 @@
|
||||
drop table if exists staging2.IHTBTD_BTD_H1_Int;
|
||||
drop table if exists staging2.IHTBTD_BTD_H1_block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Weight_Tyre_Int;
|
||||
drop table if exists staging2.IHTBTD_BTD_Weight_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Tyre_Details_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Res_1_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Res_2_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Res_3_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Res_4_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Res_5_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Res_6_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Footer_Block;
|
||||
drop table if exists staging2.IHTBTD_BTD_Test_Condition_Block;
|
||||
drop table if exists staging2.stg_specific_table_IHTBTD_BTD;
|
||||
drop table if exists staging2.stg_process_table_IHTBTD_BTD;
|
||||
|
||||
create table staging2.IHTBTD_BTD_H1_INT
|
||||
(syspk serial,dummy_f text,file_syspk int,client_id int,function_id int
|
||||
,make text,model text,file_mnemonic text,file_sheet_mnemonic text,c1 text,c2 text);
|
||||
|
||||
create table staging2.IHTBTD_BTD_H1_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
Test_Standard_ref text,
|
||||
Remarks text,
|
||||
Observations text,
|
||||
Acceptance_Criteria text,
|
||||
condition text,
|
||||
Test_Purpose text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Weight_Tyre_Int
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Weight_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
test_condition text,
|
||||
Front text,
|
||||
Rear text,
|
||||
Total text,
|
||||
status text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Tyre_Details_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_syspk int,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
Tyre_Details text,
|
||||
Pressure_kg_cm2 text,
|
||||
tyre_use_type text,
|
||||
Tyre_Make text,
|
||||
Tyre_size text,
|
||||
Ply_Rating text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Condition_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_sheet_mnemonic text,
|
||||
dummy_f text,
|
||||
make text,
|
||||
model text,
|
||||
condition text,
|
||||
date text,
|
||||
location text,
|
||||
time text,
|
||||
mode text,
|
||||
Wind_Velocity_Km_hr text,
|
||||
Ambient_Temperature_C text,
|
||||
Humidity_RH text,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Res_1_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Res_2_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Res_3_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Res_4_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Res_5_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Test_Res_6_Block
|
||||
(
|
||||
syspk serial,
|
||||
file_syspk int,
|
||||
client_id int,
|
||||
function_id int,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create table staging2.IHTBTD_BTD_Footer_Block
|
||||
(
|
||||
syspk serial,
|
||||
client_id int,
|
||||
function_id int,
|
||||
dummy_f text,
|
||||
file_syspk int,
|
||||
make text,
|
||||
model text,
|
||||
file_mnemonic text,
|
||||
file_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,
|
||||
block_row_number int,
|
||||
trx_record int default 1,
|
||||
create_time timestamp DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
create TABLE staging2.stg_process_table_IHTBTD_BTD (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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,
|
||||
block_row_number int4 NULL,
|
||||
block_tag text null
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE staging2.stg_specific_table_IHTBTD_BTD (
|
||||
generic_syspk int,
|
||||
file_syspk bigint,
|
||||
file_name varchar(1024) NULL,
|
||||
file_date date NULL,
|
||||
file_mnemonic varchar(1024) NULL,
|
||||
sheet_number int4 NULL,
|
||||
sheet_name varchar(1024) NULL,
|
||||
sheet_format text,
|
||||
file_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
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,927 @@
|
||||
--select transactional.fn_dboecd_test_trx();
|
||||
|
||||
drop function if exists staging2.fn_dboecd_test_trx;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_dboecd_test_trx(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
begin
|
||||
|
||||
/***********************************************************
|
||||
Function Name:fn_dboecd_test_trx
|
||||
Function Desc: This function populates data into trx block
|
||||
File Format: DBOECD
|
||||
Sheet Format: DBOECD_TEST
|
||||
Creation Date: March 27 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_dboecd_test_trx()
|
||||
***************************************************************/
|
||||
SET search_path TO staging2;
|
||||
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
current_date
|
||||
from
|
||||
staging2.dboecd_test_h1_block;
|
||||
|
||||
update transactional.test_instance a
|
||||
set test_condition=b.c2
|
||||
from staging2.dboecd_test_test_condition_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance a
|
||||
set remarks = b.remark
|
||||
from staging2.dboecd_test_drawbar_performance_fuel_consumption_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
select file_syspk into __file_syspk from staging2.dboecd_test_h1_block;
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
|
||||
insert into transactional.test_instance_engine_info
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_model,
|
||||
tractor_make,
|
||||
low_idle_declared,
|
||||
low_idle_observed,
|
||||
high_idle_declared,
|
||||
high_idle_observed,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,model,
|
||||
low_idle_declared,
|
||||
low_idle_observed::int,
|
||||
high_idle_declared,
|
||||
high_idle_observed::int,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.DBOECD_test_engine_RPM_RPM_block;
|
||||
|
||||
|
||||
update transactional.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
|
||||
staging2.dboecd_test_engine_rpm_engine_to_pto_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.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 staging2.dboecd_test_tractor_specifications_cylinders_block b
|
||||
where b.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.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 staging2.dboecd_test_tractor_specifications_engine_details_block b
|
||||
where b.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
wheel_base_mm,
|
||||
tractor_engine_hp,
|
||||
pto_power_hp,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
wheel_base_mm::int,
|
||||
engine_power_hp::int,
|
||||
pto_power_hp::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dboecd_test_engine_rpm_engine_to_pto_block;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set
|
||||
steering_type=b.steering_type,
|
||||
transmission_type=clutch_type,
|
||||
transmission_disc_diam=diameter_of_disc_mm
|
||||
from staging2.dboecd_test_transmission_clutch_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
insert into transactional.test_instance_drawbar_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dboecd_test_engine_rpm_required_pull_block;
|
||||
|
||||
update transactional.test_instance_drawbar_info a
|
||||
set weight_front_kg = front::int ,
|
||||
weight_rear_kg = rear::int ,
|
||||
weight_total_kg = total::int
|
||||
from staging2.dboecd_test_engine_rpm_weight_block b
|
||||
where b.weight_kg='Unballast'
|
||||
and a.drawbar_type='UB'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_drawbar_info a
|
||||
set weight_front_kg = front::int ,
|
||||
weight_rear_kg = rear::int ,
|
||||
weight_total_kg = total::int
|
||||
from staging2.dboecd_test_engine_rpm_weight_block b
|
||||
where b.weight_kg='Ballast'
|
||||
and a.drawbar_type='B'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.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 staging2.dboecd_test_transmission_drawbar_block b
|
||||
where a.drawbar_type=b.test_condition
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance_drawbar_info set drawbar_type_name='Un-Ballasted' where drawbar_type='UB';
|
||||
update transactional.test_instance_drawbar_info set drawbar_type_name='Ballasted' where drawbar_type='B';
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.DBOECD_test_engine_RPM_tyre_details_block ;
|
||||
|
||||
insert into transactional.drawbar_perf_results_summary
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dboecd_test_drawbar_performance_selected_summary_block;
|
||||
|
||||
insert into transactional.drawbar_perf_oecd_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dboecd_test_drawbar_performance_fuel_consumption_block;
|
||||
|
||||
|
||||
insert into transactional.drawbar_perf_results
|
||||
( client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dboecd_test_drawbar_performance_gear_performance_block;
|
||||
|
||||
|
||||
insert into transactional.test_instance_equipment_info
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
srl_no,
|
||||
instrument_name,
|
||||
instrument_serial_no,
|
||||
calibration_due_date,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic )
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.DBOECD_test_test_equipment_used_block;
|
||||
|
||||
insert into transactional.test_instance_measurement_uncertainty
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
load_cell,
|
||||
rpm_meter,
|
||||
speed,
|
||||
fuel_flow_meter,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
load_cell,
|
||||
rpm_meter,
|
||||
speed,
|
||||
fuel_flow_meter,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dboecd_test_measurement_uncertainty_block;
|
||||
|
||||
insert into transactional.test_instance_tractor_info_misc
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dboecd_test_tractor_specifications_fuel_and_injection_block;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set aircleaner_make_model=b.make_and_model
|
||||
from staging2.dboecd_test_tractor_specifications_cleaner_block b
|
||||
where b.cleaner_type='Air cleaner'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set aircleaner_type=b.type
|
||||
from staging2.dboecd_test_tractor_specifications_cleaner_block b
|
||||
where cleaner_type='Air cleaner'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set precleaner_make_model=b.make_and_model
|
||||
from staging2.dboecd_test_tractor_specifications_cleaner_block b
|
||||
where cleaner_type='Precleaner (if fitted)'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set precleaner_type=b.type
|
||||
from staging2.dboecd_test_tractor_specifications_cleaner_block b
|
||||
where cleaner_type='Precleaner (if fitted)'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update staging2.dboecd_test_transmission_speed_chart_block a
|
||||
set tyre_condition=b.descr
|
||||
from staging2.dboecd_test_transmission_speed_chart_desc_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
insert into transactional.test_instance_gear_speed_chart
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
forward_reverse,
|
||||
gear,
|
||||
speed_kmph,
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
'forward',
|
||||
gear,
|
||||
cast(coalesce(nullif(forward,''),'0') as numeric),
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dboecd_test_transmission_speed_chart_block;
|
||||
|
||||
|
||||
insert into transactional.test_instance_gear_speed_chart
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
forward_reverse,
|
||||
gear,
|
||||
speed_kmph,
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
'reverse',
|
||||
gear,
|
||||
cast(coalesce(nullif(reverse,''),'0') as numeric),
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dboecd_test_transmission_speed_chart_block;
|
||||
|
||||
|
||||
|
||||
insert into transactional.Test_instance_wheels_info
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dboecd_test_transmission_wheels_block;
|
||||
|
||||
|
||||
insert into transactional.Test_instance_fuel_lubricant_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
trade_name,
|
||||
fuel_lubricant_type,
|
||||
octane_per_cetane_number,
|
||||
viscocity,
|
||||
density_at_15c,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
trade_name,
|
||||
type,
|
||||
octane_cetane_number::numeric,
|
||||
viscosity,
|
||||
density_at_15c,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dboecd_test_transmission_fuel_lubricant_block ;
|
||||
|
||||
|
||||
insert into transactional.drawbar_perf_observations
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_parameter ,
|
||||
acceptance_criteria ,
|
||||
observation ,
|
||||
remarks,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
parameter,
|
||||
acceptance_criteria ,
|
||||
observations,
|
||||
remarks,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dboecd_test_remarks_block;
|
||||
|
||||
update transactional.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 staging2.dboecd_test_remarks_footer_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
|
||||
update transactional.test_instance_engine_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_results_summary
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_results
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_observations
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_oecd_results
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_equipment_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_measurement_uncertainty
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info_misc
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_gear_speed_chart
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.Test_instance_wheels_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.Test_instance_fuel_lubricant_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_observations
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_results_summary
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_oecd_results
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.drawbar_perf_results
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
|
||||
update transactional.test_instance_engine_info
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_equipment_info
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_measurement_uncertainty
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info_misc
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_gear_speed_chart
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.Test_instance_wheels_info
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.Test_instance_fuel_lubricant_info
|
||||
set test_instance_tractor_id=__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_dboecd_test_trx', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,784 @@
|
||||
drop function if exists staging2.fn_dbstd_test_trx;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_dbstd_test_trx(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS text AS $$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_dbstd_test_trx
|
||||
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 staging.fn_dbstd_test_trx()
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
test_request_no,
|
||||
date '1899-12-30' + sample_receipt_date::numeric * interval '1' day as sample_receipt_date ,
|
||||
test_report_no,
|
||||
generation,
|
||||
customer_name,
|
||||
test_engineer,
|
||||
date '1899-12-30' + test_report_date::numeric * interval '1' day as test_report_date ,
|
||||
no_of_sample,
|
||||
date '1899-12-30' + test_start_date::numeric* interval '1' day as test_start_date ,
|
||||
date '1899-12-30' + test_end_date::numeric* 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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_h1_block;
|
||||
|
||||
update transactional.test_instance a
|
||||
set test_condition=b.c2
|
||||
from staging2.dbstd_test_test_condition_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
/* ODS */
|
||||
|
||||
insert into transactional.test_instance_engine_info
|
||||
(client_id,function_id,file_syspk,tractor_model,tractor_make,low_idle_declared,low_idle_observed,high_idle_declared,high_idle_observed,file_mnemonic,
|
||||
file_sheet_mnemonic)
|
||||
select client_id,function_id,file_syspk,make,model,low_idle_declared,low_idle_observed::numeric,high_idle_declared,high_idle_observed::numeric,file_mnemonic,file_sheet_mnemonic
|
||||
from staging2.DBSTD_test_engine_RPM_RPM_block;
|
||||
|
||||
update transactional.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::numeric,
|
||||
pto_power_hp = b.pto_power_hp::numeric
|
||||
from
|
||||
staging2.dbstd_test_engine_rpm_engine_to_pto_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance_engine_info a
|
||||
set engine_cylinder_stroke_mm=b.stroke::numeric,engine_cylinder_bore_mm=b.bore::numeric,engine_cylinder_no=b.number::numeric,
|
||||
engine_cylinder_capacity_ltr=regexp_replace(b.capacity,'[^0-9]', '', 'g')::int
|
||||
from staging2.dbstd_test_tractor_specifications_cylinders_block b
|
||||
where file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance_engine_info a
|
||||
set engine_serial_no=serial_no,engine_type=type,rated_rpm=rated_speed::numeric,engine_make=b.make_in_block ,engine_model = b.model_in_block
|
||||
from staging2.dbstd_test_tractor_specifications_engine_details_block b
|
||||
where file_syspk=b.file_syspk;
|
||||
|
||||
/*ODS */
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
wheel_base_mm,
|
||||
tractor_engine_hp,
|
||||
pto_power_hp,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
wheel_base_mm::numeric,
|
||||
engine_power_hp::numeric,
|
||||
pto_power_hp::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from dbstd_test_engine_rpm_engine_to_pto_block;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set
|
||||
steering_type=b.steering_type,
|
||||
transmission_type=clutch_type,
|
||||
transmission_disc_diam=diameter_of_disc_mm
|
||||
from staging2.dbstd_test_transmission_clutch_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
/*ODS */
|
||||
insert into transactional.test_instance_drawbar_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_engine_rpm_required_pull_block;
|
||||
|
||||
update transactional.test_instance_drawbar_info a
|
||||
set weight_front_kg = front::numeric ,
|
||||
weight_rear_kg = rear::numeric ,
|
||||
weight_total_kg = total::numeric
|
||||
from staging2.dbstd_test_engine_rpm_weight_block b
|
||||
where b.weight_kg='Unballast'
|
||||
and a.drawbar_type='UB'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_drawbar_info a
|
||||
set weight_front_kg = front::numeric ,
|
||||
weight_rear_kg = rear::numeric ,
|
||||
weight_total_kg = total::numeric
|
||||
from staging2.dbstd_test_engine_rpm_weight_block b
|
||||
where b.weight_kg='Ballast'
|
||||
and a.drawbar_type='B'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.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 staging2.dbstd_test_transmission_drawbar_block b
|
||||
where a.drawbar_type=b.test_condition
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance_drawbar_info set drawbar_type_name='UnBallasted' where drawbar_type='UB';
|
||||
update transactional.test_instance_drawbar_info set drawbar_type_name='Ballasted' where drawbar_type='B';
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
dummy_f,
|
||||
tyre_make,
|
||||
size,
|
||||
ply_rating::numeric,
|
||||
load_carrying_capacity_in_kg,
|
||||
pressure_kg_cm2::numeric,
|
||||
number_of_lug::numeric,
|
||||
number_of_no_load_lug_30m::numeric,
|
||||
lug_height::numeric,
|
||||
dynamic_rolling_radius_mm::numeric,
|
||||
wheel_rim_make_size ,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.DBSTD_test_engine_RPM_tyre_details_block ;
|
||||
|
||||
/* ODS */
|
||||
|
||||
insert into transactional.drawbar_perf_results_summary
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
c1,
|
||||
c2::numeric,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dbstd_test_drawbar_performance_selected_summary_block;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.drawbar_perf_results
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
c1,
|
||||
c2::numeric,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dbstd_test_drawbar_performance_gear_performance_block;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.test_instance_equipment_info
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
srl_no,instrument_name,instrument_serial_no,calibration_due_date,file_mnemonic,
|
||||
file_sheet_mnemonic)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
s_no::numeric,
|
||||
instruments,
|
||||
instruments_no,
|
||||
date '1899-12-30' + cali_due_date::numeric * interval '1' day as cali_due_date ,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.DBSTD_test_test_equipment_used_block;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.test_instance_measurement_uncertainty
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
load_cell,
|
||||
rpm_meter,
|
||||
speed,
|
||||
fuel_flow_meter,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
load_cell,
|
||||
rpm_meter,
|
||||
speed,
|
||||
fuel_flow_meter ,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_measurement_uncertainty_block;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.test_instance_tractor_info_misc
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
regexp_replace(capacity_of_fuel_tank_lit,'[^0-9]', '', 'g')::numeric,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_tractor_specifications_fuel_and_injection_block;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set aircleaner_make_model=b.make_and_model
|
||||
from staging2.dbstd_test_tractor_specifications_cleaner_block b
|
||||
where b.cleaner_type='Air cleaner'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set aircleaner_type=b.type
|
||||
from staging2.dbstd_test_tractor_specifications_cleaner_block b
|
||||
where cleaner_type='Air cleaner'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set precleaner_make_model=b.make_and_model
|
||||
from staging2.dbstd_test_tractor_specifications_cleaner_block b
|
||||
where cleaner_type='Precleaner (if fitted)'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info_misc a
|
||||
set precleaner_type=b.type
|
||||
from staging2.dbstd_test_tractor_specifications_cleaner_block b
|
||||
where cleaner_type='Precleaner (if fitted)'
|
||||
and a.file_syspk=b.file_syspk;
|
||||
|
||||
|
||||
update staging2.dbstd_test_transmission_speed_chart_block a
|
||||
set tyre_condition=b.descr
|
||||
from staging2.dbstd_test_transmission_speed_chart_desc_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
/* ODS */
|
||||
|
||||
insert into transactional.test_instance_gear_speed_chart
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
forward_reverse,
|
||||
gear,
|
||||
speed_kmph,
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
'forward',
|
||||
gear,
|
||||
cast(coalesce(nullif(forward,''),'0') as numeric),
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_transmission_speed_chart_block;
|
||||
|
||||
/* ODs */
|
||||
insert into transactional.test_instance_gear_speed_chart
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
forward_reverse,
|
||||
gear,
|
||||
speed_kmph,
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
'reverse',
|
||||
gear,
|
||||
cast(coalesce(nullif(reverse,''),'0') as numeric),
|
||||
tyre_condition,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_transmission_speed_chart_block;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.Test_instance_wheels_info
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
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,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
dummy_f,
|
||||
location_of_driving_wheel,
|
||||
make_of_tyres,
|
||||
types,
|
||||
size,
|
||||
regexp_replace(maximum_permissible_load_kg,'[^0-9]', '', 'g')::int,
|
||||
regexp_replace(ply_rating,'[^0-9]', '', 'g')::int,
|
||||
track_width_max_mm::numeric,
|
||||
track_width_min_mm::numeric,
|
||||
inflation_pressure_kg_cm2::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dbstd_test_transmission_wheels_block;
|
||||
|
||||
update staging2.dbstd_test_transmission_wheels_block a
|
||||
set location_of_driving_wheel=(select location_of_driving_wheel from
|
||||
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 transactional.Test_instance_fuel_lubricant_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
trade_name,
|
||||
fuel_lubricant_type,
|
||||
octane_per_cetane_number,
|
||||
viscocity,
|
||||
density_at_15c,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
trade_name,
|
||||
type,
|
||||
octane_cetane_number::numeric,
|
||||
viscosity,
|
||||
density_at_15c,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from
|
||||
staging2.dbstd_test_transmission_fuel_lubricant_block ;
|
||||
|
||||
/* ODS */
|
||||
insert into transactional.drawbar_perf_observations
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_parameter ,
|
||||
acceptance_criteria ,
|
||||
observation ,
|
||||
remarks ,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
make,
|
||||
model,
|
||||
parameter,
|
||||
acceptance_criteria ,
|
||||
observations,
|
||||
remarks ,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.dbstd_test_remarks_block;
|
||||
|
||||
update transactional.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 staging2.dbstd_test_remarks_footer_block b
|
||||
where a.file_syspk=b.file_syspk;
|
||||
|
||||
select file_syspk into __file_syspk from staging2.dbstd_test_h1_block;
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_engine_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_results_summary
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_results
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_equipment_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_measurement_uncertainty
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info_misc
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_gear_speed_chart
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.Test_instance_wheels_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.Test_instance_fuel_lubricant_info
|
||||
set test_instance_id=__test_instance_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.drawbar_perf_observations
|
||||
set test_instance_id=__test_instance_id
|
||||
where 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_DBSTD_test_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
return err_context;
|
||||
|
||||
EXCEPTION when OTHERS then
|
||||
|
||||
GET STACKED DIAGNOSTICS
|
||||
err_state = returned_sqlstate,
|
||||
err_msg = message_text,
|
||||
err_detail = pg_exception_detail,
|
||||
err_hint = pg_exception_hint,
|
||||
err_context = pg_exception_context;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_DBSTD_test_block', err_state, err_msg, err_detail, err_hint, err_context,'error');
|
||||
return err_context;
|
||||
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,459 @@
|
||||
drop function if exists staging2.fn_IHTBT30_BT30_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTBT30_BT30_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTBT30_BT30_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHT
|
||||
Sheet Format: IHTBT30_BT30
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTBT30_BT30_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
Test_Request_no,
|
||||
sample_receipt_date::date,
|
||||
Test_report_No,
|
||||
Generation,
|
||||
Customer_Name,
|
||||
Test_Engineer,
|
||||
Test_Report_Date::date,
|
||||
No_of_Sample,
|
||||
Test_Start_Date::date,
|
||||
Test_End_Date::date,
|
||||
Tractor_Sr_No,
|
||||
Test_Standard_Ref,
|
||||
test_location,
|
||||
Operator_Name,
|
||||
Project_Group,
|
||||
Objective,
|
||||
condition,
|
||||
test_standard,
|
||||
test_standard_id::numeric,
|
||||
acceptance_criteria,
|
||||
remarks,
|
||||
observations
|
||||
from
|
||||
staging2.IHTBT30_BT30_H1_block where trx_record =1;
|
||||
|
||||
update transactional.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 staging2.IHTBT30_BT30_footer_block b
|
||||
where a.file_sheet_mnemonic='IHTBT30_BT30' and trx_record =1;
|
||||
|
||||
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
tyre_details,
|
||||
tyre_make,
|
||||
tyre_size,
|
||||
ply_rating::numeric,
|
||||
tyre_use_type,
|
||||
pressure_kg_cm2::numeric
|
||||
from staging2.IHTBT30_BT30_tyre_details_block where trx_record =1;
|
||||
|
||||
|
||||
insert into transactional.test_instance_drawbar_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
weight_front_kg,
|
||||
weight_rear_kg,
|
||||
weight_total_kg
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
test_condition,
|
||||
front::numeric ,
|
||||
rear::numeric ,
|
||||
total::numeric
|
||||
from staging2.IHTBT30_BT30_weight_block where trx_record =1;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
tractor_platform
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
platform
|
||||
from staging2.IHTBT30_BT30_h1_block where trx_record =1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when tractor_make like 'Mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT30_BT30_test_res_1_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT30_BT30_test_res_2_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT30_BT30_test_res_3_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT30_BT30_test_res_4_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_condition
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
date_of_test,
|
||||
time_of_test,
|
||||
location_name,
|
||||
test_mode,
|
||||
wind_velocity_kmph,
|
||||
ambient_temp_c,
|
||||
humidity_rh_pct
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,
|
||||
model,
|
||||
condition,
|
||||
date::date,
|
||||
time,
|
||||
location,
|
||||
mode,
|
||||
wind_velocity_km_hr,
|
||||
ambient_temperature_c::numeric ,
|
||||
humidity_rh::numeric
|
||||
from staging2.IHTBT30_BT30_test_condition_block where trx_record =1;
|
||||
|
||||
update transactional.iht_brake_perf_test_results a
|
||||
set brake_perf_test_condition_id=(select syspk
|
||||
from transactional.iht_brake_perf_test_condition b
|
||||
where a.test_mode =b.test_mode and a.test_condition=b.test_condition and a.file_syspk=b.file_syspk)
|
||||
where a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.iht_brake_perf_test_condition
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.iht_brake_perf_test_results
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTBT30_BT30_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,908 @@
|
||||
drop function if exists staging2.fn_IHTBT30_BT30_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTBT30_BT30_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTBT30_BT30_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHT
|
||||
Sheet Format: IHTBT30_BT30
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTBT30_BT30_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTBT30_BT30_block(1,2,'IHT','IHTBT30_BT30',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTBT30_BT30_H1_INT;
|
||||
truncate table staging2.IHTBT30_BT30_H1_block;
|
||||
truncate table staging2.IHTBT30_BT30_Weight_Tyre_Int;
|
||||
truncate table staging2.IHTBT30_BT30_Weight_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Tyre_Details_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Test_Res_1_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Test_Res_2_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Test_Res_3_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Test_Res_4_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Test_Condition_Block;
|
||||
truncate table staging2.IHTBT30_BT30_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTBT30_BT30;
|
||||
truncate table staging2.stg_process_table_IHTBT30_BT30;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHT */
|
||||
execute 'insert into staging2.stg_specific_table_IHTBT30_BT30
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTBT30_BT30;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHTBT30',
|
||||
detail = 'No data in table stg_specific_table_IHTBT30_BT30',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTBT30_BT30
|
||||
set column10='Objective' where lower(column10) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTBT30_BT30
|
||||
set column10='Acceptance criteria' where lower(column10) like 'acceptance criteria%';
|
||||
|
||||
|
||||
update staging2.stg_specific_table_IHTBT30_BT30
|
||||
set column10='Condition' where lower(column10) like 'condition%';
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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=''Un-Ballast cold''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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=''Ballast cold''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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=''Fade Performance''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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=''Recovery Performance''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT30_BT30
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT30_BT30 a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column5 into __model from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTBT30_BT30_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTBT30_BT30_H1_BLOCK';
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select a.column3,column5 from staging2.stg_process_table_IHTBT30_BT30 a where block_tag='IHTBT30_BT30_H1'
|
||||
and block_row_number <=9;
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select a.column7,column9 from staging2.stg_process_table_IHTBT30_BT30 a where block_tag='IHTBT30_BT30_H1'
|
||||
and block_row_number <=9;
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Objective',column10
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where column10='Objective'
|
||||
and block_tag='IHTBT30_BT30_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column8
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_H1' and block_row_number=11;
|
||||
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Condition',column10
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where column10='Condition'
|
||||
and block_tag='IHTBT30_BT30_H1'
|
||||
);
|
||||
|
||||
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Test std',column4
|
||||
from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where block_row_number=11
|
||||
and block_tag='IHTBT30_BT30_H1';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Test std Id',column3
|
||||
from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where block_row_number=11
|
||||
and block_tag='IHTBT30_BT30_H1';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Test Standard ref',split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where block_row_number=10
|
||||
and block_tag='IHTBT30_BT30_H1';
|
||||
|
||||
|
||||
insert into staging2.IHTBT30_BT30_H1_INT (c1,c2)
|
||||
select 'Observations',column3
|
||||
from staging2.stg_process_table_IHTBT30_BT30
|
||||
where block_tag='IHTBT30_BT30_Weight_Tyre'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where column3='Remarks & Observations'
|
||||
and block_tag='IHTBT30_BT30_Weight_Tyre'
|
||||
);
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_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,
|
||||
Test_Standard_ref,
|
||||
Remarks,
|
||||
Observations
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTBT30_BT30_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,a_26 text);
|
||||
|
||||
update staging2.IHTBT30_BT30_H1_Block
|
||||
set Sample_Receipt_Date=case
|
||||
when Sample_Receipt_Date like '%-%' then Sample_Receipt_Date::timestamptz
|
||||
else date '1899-12-30' + Sample_Receipt_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
update staging2.IHTBT30_BT30_H1_Block
|
||||
set Test_Report_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
update staging2.IHTBT30_BT30_H1_Block
|
||||
set Test_Start_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
update staging2.IHTBT30_BT30_H1_Block
|
||||
set Test_End_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
delete from staging2.IHTBT30_BT30_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTBT30_BT30_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_H1_BLOCK');
|
||||
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Weight_Tyre_Int
|
||||
(
|
||||
column3,column4,column5,column6,column7,column8,column9,
|
||||
column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,column8,
|
||||
column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_Weight_Tyre'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Weight_Tyre_Int set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Weight_Tyre_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
/*block starts - IHTBT30_BT30_Weight_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTBT30_BT30_Weight_Block';
|
||||
insert into staging2.IHTBT30_BT30_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 staging2.IHTBT30_BT30_Weight_Tyre_Int where column5 is not null and column7 is not null and block_row_number<>1
|
||||
ORDER BY generate_series(1,15),2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text);
|
||||
|
||||
|
||||
delete from staging2.IHTBT30_BT30_Weight_Block where dummy_f is null ;
|
||||
update staging2.IHTBT30_BT30_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Weight_Block');
|
||||
|
||||
/*block starts - IHTBT30_BT30_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTBT30_BT30_Tyre_Details_Block';
|
||||
insert into staging2.IHTBT30_BT30_Tyre_Details_Block
|
||||
(
|
||||
dummy_f,
|
||||
Tyre_Details,
|
||||
Pressure_kg_cm2,
|
||||
tyre_use_type,
|
||||
Tyre_Make,
|
||||
tyre_size,
|
||||
ply_rating
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{column10,column11}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[column10::text,column11::text]) AS val
|
||||
FROM staging2.IHTBT30_BT30_Weight_Tyre_Int where column11 is not null or column10 is not null
|
||||
ORDER BY generate_series(1,15),block_row_number,2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text);
|
||||
|
||||
|
||||
|
||||
delete from staging2.IHTBT30_BT30_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTBT30_BT30_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT30_BT30_Test_Res_1_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Test_Res_1_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTBT30_BT30_Test_Res_1_Block';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Test_Res_1_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_Test_Res_1'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_1_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_1_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_1_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_1_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_1_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_1_Block set trx_record =0 where block_row_number in (1,2,3,4);
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_1_Block set trx_record =0
|
||||
where column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_1_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Test_Res_1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Test_Res_1_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT30_BT30_Test_Res_2_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Test_Res_2_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTBT30_BT30_Test_Res_2_Block';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Test_Res_2_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_Test_Res_2'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_2_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_2_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
select
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_2_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_2_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_2_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_2_Block set trx_record =0 where block_row_number in (1,2,3,4);
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_2_Block set trx_record =0
|
||||
where column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_2_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Test_Res_2_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Test_Res_2_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT30_BT30_Test_Res_3_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Test_Res_3_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTBT30_BT30_Test_Res_3_Block';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Test_Res_3_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_Test_Res_3'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_3_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_3_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_3_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_3_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_3_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_3_Block set trx_record =0 where block_row_number in (1,2,3,4);
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_3_Block set trx_record =0
|
||||
where column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_3_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Test_Res_3_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Test_Res_3_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT30_BT30_Test_Res_4_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Test_Res_4_Block',__file_mnemonic,__file_sheet_mnemonic,7);
|
||||
err_block:='IHTBT30_BT30_Test_Res_4_Block';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Test_Res_4_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT30_BT30 a
|
||||
where block_tag='IHTBT30_BT30_Test_Res_4'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_4_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_4_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_4_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_4_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT30_BT30_Test_Res_4_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_4_Block set trx_record =0 where block_row_number in (1,2,3,4,15);
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_4_Block set trx_record =0
|
||||
where column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Res_4_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Test_Res_4_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Test_Res_4_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT30_BT30_Test_Condition_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Test_Condition_Block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block:='IHTBT30_BT30_Test_Condition_Block';
|
||||
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Test_Condition_Block (condition)
|
||||
select column2 from staging2.IHTBT30_BT30_Test_Res_1_Block
|
||||
where block_row_number=2
|
||||
union
|
||||
select column2 from staging2.IHTBT30_BT30_Test_Res_2_Block
|
||||
where block_row_number=2
|
||||
union
|
||||
select column2 from staging2.IHTBT30_BT30_Test_Res_3_Block
|
||||
where block_row_number=2
|
||||
union
|
||||
select column2 from staging2.IHTBT30_BT30_Test_Res_4_Block
|
||||
where block_row_number=2;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT30_BT30_Test_Res_1_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT30_BT30_Test_Res_1_Block b
|
||||
where b.block_row_number =3 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT30_BT30_Test_Res_2_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT30_BT30_Test_Res_2_Block b
|
||||
where b.block_row_number =3 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT30_BT30_Test_Res_3_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT30_BT30_Test_Res_3_Block b
|
||||
where b.block_row_number =3 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT30_BT30_Test_Res_4_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT30_BT30_Test_Res_4_Block b
|
||||
where b.block_row_number=3 and condition=b.column2;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block a
|
||||
set date= case
|
||||
when date like '%-%' then date::timestamptz
|
||||
else date '1899-12-30' + date::int * interval '1' day
|
||||
end ;
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Test_Condition_Block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Test_Condition_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Test_Condition_Block');
|
||||
|
||||
/*block starts - IHTBT30_BT30_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT30_BT30_Footer_block',__file_mnemonic,__file_sheet_mnemonic,9);
|
||||
err_block:='IHTBT30_BT30_Footer_block';
|
||||
|
||||
insert into staging2.IHTBT30_BT30_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set prepared_by=( select column6 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set reviewed_by=( select column6 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set approved_by=( select column6 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and lower(column3)='Approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set rev2=( select column7 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set rev3=( select column10 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set replaces=( select column11 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set revision_no=( select column11 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set prepared_date=( select column10 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set reviewed_date=( select column10 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block a
|
||||
set approved_date=( select column10 from staging2.stg_process_table_IHTBT30_BT30 b
|
||||
where b.block_tag='IHTBT30_BT30_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT30_BT30_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTBT30_BT30_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT30_BT30_Footer_block');
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTBT30_BT30_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
@@ -0,0 +1,460 @@
|
||||
drop function if exists staging2.fn_IHTBT50_BT50_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTBT50_BT50_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTBT50_BT50_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHT
|
||||
Sheet Format: IHTBT50_BT50
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTBT50_BT50_TRX()
|
||||
***************************************************************/
|
||||
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
Test_Request_no,
|
||||
sample_receipt_date::date,
|
||||
Test_report_No,
|
||||
Generation,
|
||||
Customer_Name,
|
||||
Test_Engineer,
|
||||
Test_Report_Date::date,
|
||||
No_of_Sample,
|
||||
Test_Start_Date::date,
|
||||
Test_End_Date::date,
|
||||
Tractor_Sr_No,
|
||||
Test_Standard_Ref,
|
||||
test_location,
|
||||
Operator_Name,
|
||||
Project_Group,
|
||||
Objective,
|
||||
condition,
|
||||
test_standard,
|
||||
test_standard_id::numeric,
|
||||
acceptance_criteria,
|
||||
remarks,
|
||||
observations
|
||||
from
|
||||
staging2.IHTBT50_BT50_H1_block where trx_record =1;
|
||||
|
||||
update transactional.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 staging2.IHTBT50_BT50_footer_block b
|
||||
where a.file_sheet_mnemonic='IHTBT50_BT50' and trx_record =1;
|
||||
|
||||
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
tyre_details,
|
||||
tyre_make,
|
||||
tyre_size,
|
||||
ply_rating::numeric,
|
||||
tyre_use_type,
|
||||
pressure_kg_cm2::numeric
|
||||
from staging2.IHTBT50_BT50_tyre_details_block where trx_record =1;
|
||||
|
||||
|
||||
insert into transactional.test_instance_drawbar_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
weight_front_kg,
|
||||
weight_rear_kg,
|
||||
weight_total_kg
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
test_condition,
|
||||
front::numeric ,
|
||||
rear::numeric ,
|
||||
total::numeric
|
||||
from staging2.IHTBT50_BT50_weight_block where trx_record =1;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
tractor_platform
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
platform
|
||||
from staging2.IHTBT50_BT50_h1_block where trx_record =1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when lower(tractor_make) like 'mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT50_BT50_test_res_1_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT50_BT50_test_res_2_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT50_BT50_test_res_3_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column10
|
||||
from staging2.IHTBT50_BT50_test_res_4_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_condition
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
date_of_test,
|
||||
time_of_test,
|
||||
location_name,
|
||||
test_mode,
|
||||
wind_velocity_kmph,
|
||||
ambient_temp_c,
|
||||
humidity_rh_pct
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,
|
||||
model,
|
||||
condition,
|
||||
date::date,
|
||||
time,
|
||||
location,
|
||||
mode,
|
||||
wind_velocity_km_hr,
|
||||
ambient_temperature_c::numeric ,
|
||||
humidity_rh::numeric
|
||||
from staging2.IHTBT50_BT50_test_condition_block where trx_record =1;
|
||||
|
||||
update transactional.iht_brake_perf_test_results a
|
||||
set brake_perf_test_condition_id=(select syspk
|
||||
from transactional.iht_brake_perf_test_condition b
|
||||
where a.test_mode =b.test_mode and a.test_condition=b.test_condition and a.file_syspk=b.file_syspk)
|
||||
where a.file_syspk=__file_syspk;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.iht_brake_perf_test_condition
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.iht_brake_perf_test_results
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTBT50_BT50_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,908 @@
|
||||
drop function if exists staging2.fn_IHTBT50_BT50_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTBT50_BT50_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTBT50_BT50_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHT
|
||||
Sheet Format: IHTBT50_BT50
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTBT50_BT50_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTBT50_BT50_block(1,2,'IHT','IHTBT50_BT50',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTBT50_BT50_H1_INT;
|
||||
truncate table staging2.IHTBT50_BT50_H1_block;
|
||||
truncate table staging2.IHTBT50_BT50_Weight_Tyre_Int;
|
||||
truncate table staging2.IHTBT50_BT50_Weight_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Tyre_Details_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Test_Res_1_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Test_Res_2_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Test_Res_3_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Test_Res_4_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Test_Condition_Block;
|
||||
truncate table staging2.IHTBT50_BT50_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTBT50_BT50;
|
||||
truncate table staging2.stg_process_table_IHTBT50_BT50;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHT */
|
||||
execute 'insert into staging2.stg_specific_table_IHTBT50_BT50
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTBT50_BT50;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHTBT50',
|
||||
detail = 'No data in table stg_specific_table_IHTBT50_BT50',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTBT50_BT50
|
||||
set column10='Objective' where lower(column10) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTBT50_BT50
|
||||
set column10='Acceptance criteria' where lower(column10) like 'acceptance criteria%';
|
||||
|
||||
|
||||
update staging2.stg_specific_table_IHTBT50_BT50
|
||||
set column10='Condition' where lower(column10) like 'condition%';
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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=''Un-Ballast cold''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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=''Ballast cold''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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=''Fade Performance''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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=''Recovery Performance''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTBT50_BT50
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTBT50_BT50 a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column5 into __model from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTBT50_BT50_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTBT50_BT50_H1_BLOCK';
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select a.column3,column5 from staging2.stg_process_table_IHTBT50_BT50 a where block_tag='IHTBT50_BT50_H1'
|
||||
and block_row_number <=9;
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select a.column7,column9 from staging2.stg_process_table_IHTBT50_BT50 a where block_tag='IHTBT50_BT50_H1'
|
||||
and block_row_number <=9;
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Objective',column10
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where column10='Objective'
|
||||
and block_tag='IHTBT50_BT50_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column8
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_H1' and block_row_number=11;
|
||||
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Condition',column10
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where column10='Condition'
|
||||
and block_tag='IHTBT50_BT50_H1'
|
||||
);
|
||||
|
||||
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Test std',column4
|
||||
from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where block_row_number=11
|
||||
and block_tag='IHTBT50_BT50_H1';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Test std Id',column3
|
||||
from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where block_row_number=11
|
||||
and block_tag='IHTBT50_BT50_H1';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Test Standard ref',split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where block_row_number=10
|
||||
and block_tag='IHTBT50_BT50_H1';
|
||||
|
||||
|
||||
insert into staging2.IHTBT50_BT50_H1_INT (c1,c2)
|
||||
select 'Observations',column3
|
||||
from staging2.stg_process_table_IHTBT50_BT50
|
||||
where block_tag='IHTBT50_BT50_Weight_Tyre'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where column3='Remarks & Observations'
|
||||
and block_tag='IHTBT50_BT50_Weight_Tyre'
|
||||
);
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_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,
|
||||
Test_Standard_ref,
|
||||
Remarks,
|
||||
Observations
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTBT50_BT50_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,a_26 text);
|
||||
|
||||
update staging2.IHTBT50_BT50_H1_Block
|
||||
set Sample_Receipt_Date=case
|
||||
when Sample_Receipt_Date like '%-%' then Sample_Receipt_Date::timestamptz
|
||||
else date '1899-12-30' + Sample_Receipt_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
update staging2.IHTBT50_BT50_H1_Block
|
||||
set Test_Report_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
update staging2.IHTBT50_BT50_H1_Block
|
||||
set Test_Start_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
update staging2.IHTBT50_BT50_H1_Block
|
||||
set Test_End_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
delete from staging2.IHTBT50_BT50_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTBT50_BT50_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_H1_BLOCK');
|
||||
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Weight_Tyre_Int
|
||||
(
|
||||
column3,column4,column5,column6,column7,column8,column9,
|
||||
column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,column8,
|
||||
column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_Weight_Tyre'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Weight_Tyre_Int set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Weight_Tyre_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
/*block starts - IHTBT50_BT50_Weight_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTBT50_BT50_Weight_Block';
|
||||
insert into staging2.IHTBT50_BT50_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 staging2.IHTBT50_BT50_Weight_Tyre_Int where column5 is not null and column7 is not null and block_row_number<>1
|
||||
ORDER BY generate_series(1,15),2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text);
|
||||
|
||||
|
||||
delete from staging2.IHTBT50_BT50_Weight_Block where dummy_f is null ;
|
||||
update staging2.IHTBT50_BT50_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Weight_Block');
|
||||
|
||||
/*block starts - IHTBT50_BT50_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTBT50_BT50_Tyre_Details_Block';
|
||||
insert into staging2.IHTBT50_BT50_Tyre_Details_Block
|
||||
(
|
||||
dummy_f,
|
||||
Tyre_Details,
|
||||
Pressure_kg_cm2,
|
||||
tyre_use_type,
|
||||
Tyre_Make,
|
||||
tyre_size,
|
||||
ply_rating
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{column10,column11}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[column10::text,column11::text]) AS val
|
||||
FROM staging2.IHTBT50_BT50_Weight_Tyre_Int where column11 is not null or column10 is not null
|
||||
ORDER BY generate_series(1,15),block_row_number,2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text);
|
||||
|
||||
|
||||
|
||||
delete from staging2.IHTBT50_BT50_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTBT50_BT50_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT50_BT50_Test_Res_1_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Test_Res_1_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTBT50_BT50_Test_Res_1_Block';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Test_Res_1_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_Test_Res_1'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_1_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_1_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_1_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_1_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_1_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_1_Block set trx_record =0 where block_row_number in (1,2,3,4);
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_1_Block set trx_record =0 where
|
||||
column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_1_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Test_Res_1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Test_Res_1_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT50_BT50_Test_Res_2_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Test_Res_2_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTBT50_BT50_Test_Res_2_Block';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Test_Res_2_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_Test_Res_2'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_2_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_2_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
select
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_2_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_2_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_2_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_2_Block set trx_record =0 where block_row_number in (1,2,3,4);
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_2_Block set trx_record =0 where
|
||||
column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_2_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Test_Res_2_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Test_Res_2_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT50_BT50_Test_Res_3_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Test_Res_3_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTBT50_BT50_Test_Res_3_Block';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Test_Res_3_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_Test_Res_3'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_3_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_3_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_3_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_3_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_3_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_3_Block set trx_record =0 where block_row_number in (1,2,3,4);
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_3_Block set trx_record =0 where
|
||||
column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_3_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Test_Res_3_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Test_Res_3_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT50_BT50_Test_Res_4_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Test_Res_4_Block',__file_mnemonic,__file_sheet_mnemonic,7);
|
||||
err_block:='IHTBT50_BT50_Test_Res_4_Block';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Test_Res_4_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,column11,column12,block_row_number
|
||||
from staging2.stg_process_table_IHTBT50_BT50 a
|
||||
where block_tag='IHTBT50_BT50_Test_Res_4'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_4_Block
|
||||
set column2=column3 where block_row_number=1;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_4_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number,column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_4_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_4_Block a
|
||||
set column10= b.first_value from (SELECT
|
||||
block_row_number,column10, value_partition, first_value(column10) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column10,
|
||||
sum(case when column10 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTBT50_BT50_Test_Res_4_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number=b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_4_Block set trx_record =0 where block_row_number in (1,2,3,4,15);
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_4_Block set trx_record =0 where
|
||||
column4 is null and column5 is null;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Res_4_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Test_Res_4_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Test_Res_4_Block');
|
||||
|
||||
|
||||
/*block starts - IHTBT50_BT50_Test_Condition_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Test_Condition_Block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block:='IHTBT50_BT50_Test_Condition_Block';
|
||||
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Test_Condition_Block (condition)
|
||||
select column2 from staging2.IHTBT50_BT50_Test_Res_1_Block
|
||||
where block_row_number=2
|
||||
union
|
||||
select column2 from staging2.IHTBT50_BT50_Test_Res_2_Block
|
||||
where block_row_number=2
|
||||
union
|
||||
select column2 from staging2.IHTBT50_BT50_Test_Res_3_Block
|
||||
where block_row_number=2
|
||||
union
|
||||
select column2 from staging2.IHTBT50_BT50_Test_Res_4_Block
|
||||
where block_row_number=2;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT50_BT50_Test_Res_1_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT50_BT50_Test_Res_1_Block b
|
||||
where b.block_row_number =3 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT50_BT50_Test_Res_2_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT50_BT50_Test_Res_2_Block b
|
||||
where b.block_row_number =3 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT50_BT50_Test_Res_3_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT50_BT50_Test_Res_3_Block b
|
||||
where b.block_row_number =3 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set date=b.column4,
|
||||
location=b.column7,
|
||||
--time=b.column9,
|
||||
mode=b.column10
|
||||
from staging2.IHTBT50_BT50_Test_Res_4_Block b
|
||||
where b.block_row_number =2 and condition=b.column2;
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block
|
||||
set Wind_Velocity_Km_hr=b.column5,
|
||||
Ambient_Temperature_C=b.column7,
|
||||
Humidity_RH=b.column9
|
||||
from staging2.IHTBT50_BT50_Test_Res_4_Block b
|
||||
where b.block_row_number=3 and condition=b.column2;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block a
|
||||
set date= case
|
||||
when date like '%-%' then date::timestamptz
|
||||
else date '1899-12-30' + date::int * interval '1' day
|
||||
end ;
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Test_Condition_Block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Test_Condition_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Test_Condition_Block');
|
||||
|
||||
/*block starts - IHTBT50_BT50_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTBT50_BT50_Footer_block',__file_mnemonic,__file_sheet_mnemonic,9);
|
||||
err_block:='IHTBT50_BT50_Footer_block';
|
||||
|
||||
insert into staging2.IHTBT50_BT50_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set prepared_by=( select column6 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set reviewed_by=( select column6 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set approved_by=( select column6 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and lower(column3)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set rev2=( select column7 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set rev3=( select column10 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set replaces=( select column11 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set revision_no=( select column11 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set prepared_date=( select column10 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set reviewed_date=( select column10 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block a
|
||||
set approved_date=( select column10 from staging2.stg_process_table_IHTBT50_BT50 b
|
||||
where b.block_tag='IHTBT50_BT50_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTBT50_BT50_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTBT50_BT50_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTBT50_BT50_Footer_block');
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTBT50_BT50_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
@@ -0,0 +1,539 @@
|
||||
drop function if exists staging2.fn_IHTBTD_BTD_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTBTD_BTD_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTBTD_BTD_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHT
|
||||
Sheet Format: IHTBTD_BTD
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTBTD_BTD_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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,
|
||||
test_standard_ref
|
||||
acceptance_criteria,
|
||||
remarks,
|
||||
observations
|
||||
from
|
||||
staging2.IHTBTD_BTD_H1_block where trx_record =1;
|
||||
|
||||
update transactional.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 staging2.IHTBTD_BTD_footer_block b
|
||||
where a.file_sheet_mnemonic='IHTBTD_BTD' and trx_record =1;
|
||||
|
||||
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
tyre_details,
|
||||
tyre_make,
|
||||
tyre_size,
|
||||
ply_rating::numeric,
|
||||
tyre_use_type,
|
||||
pressure_kg_cm2::numeric
|
||||
from staging2.IHTBTD_BTD_tyre_details_block where trx_record =1;
|
||||
|
||||
|
||||
|
||||
insert into transactional.test_instance_drawbar_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
weight_front_kg,
|
||||
weight_rear_kg,
|
||||
weight_total_kg,
|
||||
status
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
test_condition,
|
||||
front::numeric ,
|
||||
rear::numeric ,
|
||||
total::numeric ,
|
||||
status
|
||||
from staging2.IHTBTD_BTD_weight_block where trx_record =1;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
tractor_platform
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
platform
|
||||
from staging2.IHTBTD_BTD_h1_block where trx_record =1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when tractor_make like 'Mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column11
|
||||
from staging2.IHTBTD_BTD_test_res_1_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column11
|
||||
from staging2.IHTBTD_BTD_test_res_2_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column11
|
||||
from staging2.IHTBTD_BTD_test_res_3_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column11
|
||||
from staging2.IHTBTD_BTD_test_res_4_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column11
|
||||
from staging2.IHTBTD_BTD_test_res_5_block where trx_record =1;
|
||||
|
||||
|
||||
insert into transactional.iht_brake_perf_test_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
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,
|
||||
observation,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9,
|
||||
column13
|
||||
from staging2.IHTBTD_BTD_test_res_6_block where trx_record =1;
|
||||
|
||||
insert into transactional.iht_brake_perf_test_condition
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
date_of_test,
|
||||
time_of_test,
|
||||
location_name,
|
||||
test_mode,
|
||||
wind_velocity_kmph,
|
||||
ambient_temp_c,
|
||||
humidity_rh_pct
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,
|
||||
model,
|
||||
condition,
|
||||
date::date,
|
||||
time,
|
||||
location,
|
||||
mode,
|
||||
wind_velocity_km_hr,
|
||||
ambient_temperature_c::numeric ,
|
||||
humidity_rh::numeric
|
||||
from staging2.ihtbtd_btd_test_condition_block where trx_record =1;
|
||||
|
||||
update transactional.iht_brake_perf_test_results a
|
||||
set brake_perf_test_condition_id=(select syspk
|
||||
from transactional.iht_brake_perf_test_condition b
|
||||
where a.test_mode =b.test_mode and a.test_condition=b.test_condition and a.file_syspk=b.file_syspk)
|
||||
where a.file_syspk=__file_syspk;
|
||||
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.iht_brake_perf_test_condition
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.iht_brake_perf_test_results
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTBTD_BTD_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,336 @@
|
||||
drop function if exists staging2.fn_IHTCGM_CGM_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTCGM_CGM_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTCGM_CGM_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTCGM
|
||||
Sheet Format: IHTCGM_CGM
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTCGM_CGM_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTCGM_CGM_H1_block where trx_record=1;
|
||||
|
||||
update transactional.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 staging2.IHTCGM_CGM_footer_block b
|
||||
where a.file_sheet_mnemonic ='IHTCGM_CGM' and trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTCGM_CGM_tyre_details_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
wheel_base_mm,
|
||||
rear_track_width_mm
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
wheel_base::numeric ,
|
||||
rear_track_width::numeric
|
||||
from staging2.IHTCGM_CGM_wheel_block where trx_record=1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when tractor_make like 'Mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_weight_reaction
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTCGM_CGM_weight_block where trx_record=1;
|
||||
|
||||
|
||||
insert into transactional.IHT_cgm_lifting_angle_load_details
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column3::numeric,
|
||||
column4::numeric ,
|
||||
column5::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric,
|
||||
column10::numeric
|
||||
from staging2.IHTCGM_cgm_lifting_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_cgm_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTCGM_cgm_results_block where trx_record=1;
|
||||
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_weight_reaction
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_cgm_lifting_angle_load_details
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_cgm_results
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTCGM_CGM_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,565 @@
|
||||
drop function if exists staging2.fn_IHTCGM_CGM_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTCGM_CGM_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTCGM_CGM_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHTCGM
|
||||
Sheet Format: IHTCGM_CGM
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTCGM_CGM_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTCGM_CGM_block(1,2,'IHTCGM','IHTCGM_CGM',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTCGM_CGM_H1_Int;
|
||||
truncate table staging2.IHTCGM_CGM_H1_block;
|
||||
truncate table staging2.IHTCGM_CGM_Weight_Tyre_Int;
|
||||
truncate table staging2.IHTCGM_CGM_Weight_Block;
|
||||
truncate table staging2.IHTCGM_CGM_Wheel_Block;
|
||||
truncate table staging2.IHTCGM_CGM_Tyre_Details_Block;
|
||||
truncate table staging2.IHTCGM_CGM_Lifting_Block;
|
||||
truncate table staging2.IHTCGM_CGM_Results_Block;
|
||||
truncate table staging2.IHTCGM_CGM_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTCGM_CGM;
|
||||
truncate table staging2.stg_process_table_IHTCGM_CGM;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHTCGM */
|
||||
execute 'insert into staging2.stg_specific_table_IHTCGM_CGM
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTCGM_CGM;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHT CGM',
|
||||
detail = 'No data in table stg_specific_table_IHTCGM_CGM',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTCGM_CGM
|
||||
set column15='Objective' where lower(column15) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTCGM_CGM
|
||||
set column15='Acceptance criteria' where lower(column15) like 'acceptance criteria%';
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTCGM_CGM b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTCGM_CGM a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTCGM_CGM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTCGM_CGM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTCGM_CGM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTCGM_CGM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTCGM_CGM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTCGM_CGM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTCGM_CGM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTCGM_CGM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column6 into __model from staging2.stg_process_table_IHTCGM_CGM a
|
||||
where block_tag='IHTCGM_CGM_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTCGM_CGM_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTCGM_CGM_H1_BLOCK';
|
||||
|
||||
insert into staging2.IHTCGM_CGM_H1_INT (c1,c2)
|
||||
select a.column3,column6 from staging2.stg_process_table_IHTCGM_CGM a where block_tag='IHTCGM_CGM_H1';
|
||||
|
||||
insert into staging2.IHTCGM_CGM_H1_INT (c1,c2)
|
||||
select a.column9,column12 from staging2.stg_process_table_IHTCGM_CGM a where block_tag='IHTCGM_CGM_H1';
|
||||
|
||||
insert into staging2.IHTCGM_CGM_H1_INT (c1,c2)
|
||||
select 'Objective',column15
|
||||
from staging2.stg_process_table_IHTCGM_CGM a
|
||||
where block_tag='IHTCGM_CGM_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTCGM_CGM a
|
||||
where column15='Objective'
|
||||
and block_tag='IHTCGM_CGM_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTCGM_CGM_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column15
|
||||
from staging2.stg_process_table_IHTCGM_CGM a
|
||||
where block_tag='IHTCGM_CGM_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTCGM_CGM a
|
||||
where column15='Acceptance criteria'
|
||||
and block_tag='IHTCGM_CGM_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTCGM_CGM_H1_INT (c1,c2)
|
||||
select split_part(column3,':',1),split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTCGM_CGM
|
||||
where block_tag='IHTCGM_CGM_Lifting' and block_row_number=15;
|
||||
|
||||
insert into staging2.IHTCGM_CGM_H1_INT (c1,c2)
|
||||
select 'Test Purpose',column10
|
||||
from staging2.stg_process_table_IHTCGM_CGM a
|
||||
where block_tag='IHTCGM_CGM_H1' and column3='Test Purpose';
|
||||
|
||||
update staging2.IHTCGM_CGM_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTCGM_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,
|
||||
Test_Purpose
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTCGM_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,a_20 text);
|
||||
|
||||
|
||||
delete from staging2.IHTCGM_CGM_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTCGM_CGM_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_H1_BLOCK');
|
||||
|
||||
|
||||
insert into staging2.IHTCGM_CGM_Weight_Tyre_Int
|
||||
(
|
||||
column3,column6,column10,column11,column13,column15,column17,column19,
|
||||
column20,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column6,column10,column11,column13,column15,column17,column19,
|
||||
column20,block_row_number
|
||||
from staging2.stg_process_table_IHTCGM_CGM a
|
||||
where block_tag='IHTCGM_CGM_Weight_Tyre'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTCGM_CGM_Weight_Tyre_Int set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Weight_Tyre_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTCGM_CGM_Weight_Tyre_Int set trx_record = 0 where block_row_number=3;
|
||||
|
||||
/*block starts - IHTCGM_CGM_Weight_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTCGM_CGM_Weight_Block';
|
||||
|
||||
insert into staging2.IHTCGM_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 staging2.IHTCGM_CGM_Weight_Tyre_Int where trx_record=1
|
||||
ORDER BY generate_series(1,15),block_row_number,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 staging2.IHTCGM_CGM_Weight_Block where dummy_f is null ;
|
||||
update staging2.IHTCGM_CGM_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_Weight_Block');
|
||||
|
||||
/*block starts - IHTCGM_CGM_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTCGM_CGM_Tyre_Details_Block';
|
||||
insert into staging2.IHTCGM_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 staging2.IHTCGM_CGM_Weight_Tyre_Int where block_row_number between 3 and 11
|
||||
ORDER BY generate_series(1,15),block_row_number,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 staging2.IHTCGM_CGM_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTCGM_CGM_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTCGM_CGM_Wheel_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_Wheel_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTCGM_CGM_Wheel_Block';
|
||||
insert into staging2.IHTCGM_CGM_Wheel_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTCGM_CGM_Wheel_Block
|
||||
set Wheel_Base=(select column13 from
|
||||
staging2.IHTCGM_CGM_Weight_Tyre_Int
|
||||
where block_row_number=1 and column10='Wheel Base in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Wheel_Block
|
||||
set Rear_Track_Width=(select column20 from
|
||||
staging2.IHTCGM_CGM_Weight_Tyre_Int
|
||||
where block_row_number=1 and column17='Rear Track Width in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTCGM_CGM_Wheel_Block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Wheel_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_Wheel_Block');
|
||||
|
||||
/*block starts - IHTCGM_CGM_Lifting_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_Lifting_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTCGM_CGM_Lifting_Block';
|
||||
|
||||
insert into staging2.IHTCGM_CGM_Lifting_Block
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,column10,block_row_number
|
||||
from staging2.stg_process_table_IHTCGM_CGM a
|
||||
where block_tag='IHTCGM_CGM_Lifting'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
|
||||
update staging2.IHTCGM_CGM_Lifting_Block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Lifting_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTCGM_CGM_Lifting_Block set trx_record =0 where block_row_number not in (3,4,5,6,7,8,9);
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_Lifting_Block');
|
||||
|
||||
|
||||
/*block starts - IHTCGM_CGM_Results_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_Results_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTCGM_CGM_Results_Block';
|
||||
insert into staging2.IHTCGM_CGM_Results_Block (dummy_f) values('dummy');
|
||||
|
||||
update staging2.IHTCGM_CGM_Results_Block
|
||||
set Determination_of_Horizontal_Distance_from_RAC_X=
|
||||
(select column10 from staging2.IHTCGM_CGM_Lifting_Block
|
||||
where block_row_number=12) where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Results_Block
|
||||
set Determination_of_Lateral_CoOrdinate_in_Horizontal_Plane_Y=
|
||||
(select column10 from staging2.IHTCGM_CGM_Lifting_Block
|
||||
where block_row_number=13) where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Results_Block
|
||||
set Determination_of_Vertical_CoOrdinate_Z=
|
||||
(select column10 from staging2.IHTCGM_CGM_Lifting_Block
|
||||
where block_row_number=14) where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTCGM_CGM_Results_Block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Results_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_Results_Block');
|
||||
|
||||
|
||||
/*block starts - IHTCGM_CGM_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTCGM_CGM_Footer_block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block='IHTCGM_CGM_Footer_block';
|
||||
insert into staging2.IHTCGM_CGM_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set prepared_by=( select column7 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set reviewed_by=( select column7 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set approved_by=( select column7 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and lower(column3)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set rev2=( select column9 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set rev3=( select column18 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set replaces=( select column19 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set revision_no=( select column19 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set prepared_date=( select column16 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set reviewed_date=( select column16 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block a
|
||||
set approved_date=( select column16 from staging2.stg_process_table_IHTCGM_CGM b
|
||||
where b.block_tag='IHTCGM_CGM_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTCGM_CGM_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTCGM_CGM_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTCGM_CGM_Footer_block');
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTCGM_CGM_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,434 @@
|
||||
drop function if exists staging2.fn_IHTEMT_EMT_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTEMT_EMT_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTEMT_EMT_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTEMT
|
||||
Sheet Format: IHTEMT_EMT
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTEMT_EMT_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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,
|
||||
test_purpose
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_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,
|
||||
Test_Purpose
|
||||
from staging2.IHTEMT_EMT_H1_block where trx_record =1;
|
||||
|
||||
update transactional.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 staging2.IHTEMT_EMT_footer_block b
|
||||
where a.file_sheet_mnemonic ='IHTEMT_EMT' and trx_record =1;
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTEMT_EMT_tyre_details_block where trx_record =1;
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
wheel_base_mm,
|
||||
turning_circle_diameter_mm
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
wheel_base::numeric ,
|
||||
tcd::numeric
|
||||
from staging2.IHTEMT_EMT_wheel_block where trx_record =1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when tractor_make like 'Mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_weight_reaction
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTEMT_EMT_weight_block where trx_record =1;
|
||||
|
||||
|
||||
insert into transactional.IHT_steering_effort
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column8::numeric
|
||||
from staging2.IHTEMT_emt_steering_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_pedal_effort
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
parameters,
|
||||
efforts_kg,
|
||||
travel_mm
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3::numeric ,
|
||||
column4::numeric
|
||||
from staging2.IHTEMT_emt_pedal_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_gear_effort
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
parameters,
|
||||
efforts_kg
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column5,
|
||||
column8::numeric
|
||||
from staging2.IHTEMT_emt_pedal_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_brake_pedal_effort
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2::numeric,
|
||||
column3::numeric,
|
||||
column4::numeric ,
|
||||
column5::numeric,
|
||||
column6::numeric
|
||||
from staging2.IHTEMT_emt_brake_pedal_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_clutch_pedal_effort
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
srl_no,
|
||||
pedal_effort_kg,
|
||||
pedal_travel_mm
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric
|
||||
from staging2.IHTEMT_emt_brake_pedal_block where trx_record=1;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_weight_reaction
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_brake_pedal_effort
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_pedal_effort
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_steering_effort
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_gear_effort
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_clutch_pedal_effort
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTEMT_EMT_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
|
||||
drop function if exists staging2.fn_IHTEMT_STD_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTEMT_STD_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTEMT_STD_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTEMT
|
||||
Sheet Format: IHTEMT_STD
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTEMT_STD_TRX()
|
||||
***************************************************************/
|
||||
|
||||
insert into transactional.iht_steering_effort_raw_data
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
time_sec,
|
||||
steering_anglel,
|
||||
effort_kg
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
time_s::numeric,
|
||||
steering_angle ::numeric,
|
||||
effort ::numeric
|
||||
from staging2.IHTEMT_STD_RAW_Data_Block where trx_record=1;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTEMT_STD_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
drop function if exists staging2.fn_IHTEMT_STD_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTEMT_STD_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTEMT_STD_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHTEMT
|
||||
Sheet Format: IHTEMT_STD
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTEMT_STD_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTEMT_STD_block(1,2,'IHTEMT','IHTEMT_STD',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTEMT_STD_RAW_Data_Block;
|
||||
truncate table staging2.stg_specific_table_IHTEMT_STD;
|
||||
truncate table staging2.stg_process_table_IHTEMT_STD;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHTEMT */
|
||||
execute 'insert into staging2.stg_specific_table_IHTEMT_STD
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTEMT_STD;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHTEMT STD',
|
||||
detail = 'No data in table stg_specific_table_IHTEMT_STD',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTEMT_STD b
|
||||
where upper(F1_modified)=upper(column1)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTEMT_STD a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column1)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Steering effort RAW data''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_STD
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_STD a
|
||||
join transactional.source_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 RAW data''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
/*block starts - IHTEMT_STD_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_STD_RAW_Data_Block',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
|
||||
err_block:='IHTEMT_STD_RAW_Data_Block';
|
||||
insert into staging2.IHTEMT_STD_RAW_Data_Block (Time_s,Steering_Angle,Effort,block_row_number)
|
||||
select a.column1,column2,column3,block_row_number from staging2.stg_process_table_IHTEMT_STD a
|
||||
where block_tag='IHTEMT_STD_RAW_Data';
|
||||
|
||||
|
||||
execute 'update staging2.IHTEMT_STD_RAW_Data_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTEMT_STD_RAW_Data_Block set trx_record =0 where block_row_number in (1,2,3);
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_STD_RAW_Data_Block');
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTEMT_STD_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,615 @@
|
||||
drop function if exists staging2.fn_IHTEMT_EMT_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTEMT_EMT_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTEMT_EMT_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHTEMT
|
||||
Sheet Format: IHTEMT_EMT
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTEMT_EMT_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTEMT_EMT_block(1,2,'IHTEMT','IHTEMT_EMT',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTEMT_EMT_H1_INT;
|
||||
truncate table staging2.IHTEMT_EMT_H1_block;
|
||||
truncate table staging2.IHTEMT_EMT_Weight_Tyre_Int;
|
||||
truncate table staging2.IHTEMT_EMT_Weight_Block;
|
||||
truncate table staging2.IHTEMT_EMT_Wheel_Block;
|
||||
truncate table staging2.IHTEMT_EMT_Tyre_Details_Block;
|
||||
truncate table staging2.IHTEMT_EMT_Steering_Block;
|
||||
truncate table staging2.IHTEMT_EMT_Pedal_Block;
|
||||
truncate table staging2.IHTEMT_EMT_Brake_Pedal_Block;
|
||||
truncate table staging2.IHTEMT_EMT_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTEMT_EMT;
|
||||
truncate table staging2.stg_process_table_IHTEMT_EMT;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHTEMT */
|
||||
execute 'insert into staging2.stg_specific_table_IHTEMT_EMT
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTEMT_EMT;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHTEMT EMT',
|
||||
detail = 'No data in table stg_specific_table_IHTEMT_EMT',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTEMT_EMT
|
||||
set column14='Objective' where lower(column14) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTEMT_EMT
|
||||
set column14='Acceptance criteria' where lower(column14) like 'acceptance criteria%';
|
||||
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTEMT_EMT b
|
||||
where upper(F1_modified)=upper(column2)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTEMT_EMT a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column2)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_EMT
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_EMT a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_EMT
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_EMT a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_EMT
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_EMT a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_EMT
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_EMT a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_EMT
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_EMT a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTEMT_EMT
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTEMT_EMT a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model and make*/
|
||||
select column5 into __make from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_H1' and trim(column2)='Tractor Model';
|
||||
|
||||
|
||||
select column5 into __model from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_H1' and trim(column2)='Tractor Model';
|
||||
|
||||
/*block starts - IHTEMT_EMT_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTEMT_EMT_H1_BLOCK';
|
||||
insert into staging2.IHTEMT_EMT_H1_INT (c1,c2)
|
||||
select a.column2,column5 from staging2.stg_process_table_IHTEMT_EMT a where block_tag='IHTEMT_EMT_H1';
|
||||
|
||||
insert into staging2.IHTEMT_EMT_H1_INT (c1,c2)
|
||||
select a.column8,column11 from staging2.stg_process_table_IHTEMT_EMT a where block_tag='IHTEMT_EMT_H1';
|
||||
|
||||
insert into staging2.IHTEMT_EMT_H1_INT (c1,c2)
|
||||
select 'Objective',column14
|
||||
from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTEMT_EMT a
|
||||
where column14='Objective'
|
||||
and block_tag='IHTEMT_EMT_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTEMT_EMT_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column14
|
||||
from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTEMT_EMT a
|
||||
where column14='Acceptance criteria'
|
||||
and block_tag='IHTEMT_EMT_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTEMT_EMT_H1_INT (c1,c2)
|
||||
select split_part(column2,':',1),split_part(column2,':',2)
|
||||
from staging2.stg_process_table_IHTEMT_EMT
|
||||
where block_tag='IHTEMT_EMT_Footer' and block_row_number=1;
|
||||
|
||||
insert into staging2.IHTEMT_EMT_H1_INT (c1,c2)
|
||||
select 'Test Purpose',column9
|
||||
from staging2.stg_process_table_IHTEMT_EMT
|
||||
where block_tag='IHTEMT_EMT_Weight_Tyre' and column2='Test Purpose';
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTEMT_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,
|
||||
Test_Purpose
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTEMT_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,a_20 text);
|
||||
|
||||
|
||||
delete from staging2.IHTEMT_EMT_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTEMT_EMT_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_H1_BLOCK');
|
||||
|
||||
|
||||
insert into staging2.IHTEMT_EMT_Weight_Tyre_Int
|
||||
(
|
||||
column2,column5,column9,column10,column12,column14,column16,column18,
|
||||
column19,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column5,column9,column10,column12,column14,column16,column18,
|
||||
column19,block_row_number
|
||||
from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_Weight_Tyre'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTEMT_EMT_Weight_Tyre_Int set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Weight_Tyre_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
/*block starts - IHTEMT_EMT_Weight_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTEMT_EMT_Weight_Block';
|
||||
|
||||
insert into staging2.IHTEMT_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 staging2.IHTEMT_EMT_Weight_Tyre_Int
|
||||
ORDER BY generate_series(1,15),block_row_number,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 staging2.IHTEMT_EMT_Weight_Block where dummy_f is null ;
|
||||
update staging2.IHTEMT_EMT_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Weight_Block');
|
||||
|
||||
/*block starts - IHTEMT_EMT_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTEMT_EMT_Tyre_Details_Block';
|
||||
|
||||
insert into staging2.IHTEMT_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 staging2.IHTEMT_EMT_Weight_Tyre_Int where block_row_number 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 staging2.IHTEMT_EMT_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTEMT_EMT_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTEMT_EMT_Wheel_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Wheel_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTEMT_EMT_Wheel_Block';
|
||||
insert into staging2.IHTEMT_EMT_Wheel_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTEMT_EMT_Wheel_Block
|
||||
set Wheel_Base=(select column12 from
|
||||
staging2.IHTEMT_EMT_Weight_Tyre_Int
|
||||
where block_row_number=1 and column9='Wheel Base in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Wheel_Block
|
||||
set TCD=(select replace(column19,'mm','') from
|
||||
staging2.IHTEMT_EMT_Weight_Tyre_Int
|
||||
where block_row_number=1 and column16='TCD in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_Wheel_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Wheel_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Wheel_Block');
|
||||
|
||||
/*block starts - IHTEMT_EMT_Steering_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Steering_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTEMT_EMT_Steering_Block';
|
||||
|
||||
insert into staging2.IHTEMT_EMT_Steering_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,
|
||||
column8,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,
|
||||
column8,block_row_number
|
||||
from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_Steering'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_Steering_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Steering_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTEMT_EMT_Steering_Block set trx_record =0 where block_row_number in (1,2,3);
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Steering_Block');
|
||||
|
||||
|
||||
/*block starts - IHTEMT_EMT_Pedal_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Pedal_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTEMT_EMT_Pedal_Block';
|
||||
insert into staging2.IHTEMT_EMT_Pedal_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,
|
||||
column8,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,
|
||||
column8,block_row_number
|
||||
from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_Pedal'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_Pedal_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Pedal_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTEMT_EMT_Pedal_Block set trx_record =0 where block_row_number in (1,2);
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Pedal_Block');
|
||||
|
||||
/*block starts - IHTEMT_EMT_Brake_Pedal_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Brake_Pedal_Block',__file_mnemonic,__file_sheet_mnemonic,7);
|
||||
err_block:='IHTEMT_EMT_Brake_Pedal_Block';
|
||||
insert into staging2.IHTEMT_EMT_Brake_Pedal_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTEMT_EMT a
|
||||
where block_tag='IHTEMT_EMT_Brake_Pedal'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_Brake_Pedal_Block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Brake_Pedal_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_Brake_Pedal_Block set trx_record =0 where block_row_number in (1,2,3,14);
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Brake_Pedal_Block');
|
||||
|
||||
/*block starts - IHTEMT_EMT_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTEMT_EMT_Footer_block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block:='IHTEMT_EMT_Footer_block';
|
||||
insert into staging2.IHTEMT_EMT_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set prepared_by=( select column6 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and lower(column2)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set reviewed_by=( select column6 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and lower(column2)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set approved_by=( select column6 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and lower(column2)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set comments=( select column2 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set rev1=( select column2 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set rev2=( select column8 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set rev3=( select column17 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set replaces=( select column18 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set revision_no=( select column18 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set prepared_date=( select column15 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set reviewed_date=( select column15 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block a
|
||||
set approved_date=( select column15 from staging2.stg_process_table_IHTEMT_EMT b
|
||||
where b.block_tag='IHTEMT_EMT_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTEMT_EMT_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTEMT_EMT_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTEMT_EMT_Footer_block');
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTEMT_EMT_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
drop function if exists staging2.fn_IHTHAM_HAM_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTHAM_HAM_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTHAM_HAM_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTHAM
|
||||
Sheet Format: IHTHAM_HAM
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTHAM_HAM_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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,
|
||||
remarks
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
Test_Request_no,
|
||||
Sample_Receipt_Date::date,
|
||||
Test_report_No,
|
||||
Generation,
|
||||
Customer_Name,
|
||||
Test_Engineer,
|
||||
Test_Report_Date::date,
|
||||
No_of_Sample,
|
||||
Test_Start_Date::date,
|
||||
Test_End_Date::date,
|
||||
Tractor_Sr_No,
|
||||
Test_Standard_Refer,
|
||||
Test_location,
|
||||
Operator_Name,
|
||||
Project_Group,
|
||||
Acceptance_criteria,
|
||||
Objective,
|
||||
condition,
|
||||
Remarks
|
||||
from
|
||||
staging2.IHTHAM_HAM_H1_block where trx_record=1;
|
||||
|
||||
update transactional.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 staging2.IHTHAM_HAM_footer_block b
|
||||
where a.file_sheet_mnemonic='IHTHAM_HAM' and trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
tyre_details,
|
||||
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 staging2.IHTHAM_HAM_tyre_details_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model
|
||||
from
|
||||
staging2.IHTHAM_HAM_H1_block where trx_record=1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when lower(tractor_make) like 'mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
insert into transactional.test_instance_engine_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTHAM_HAM_engine_rpm_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_weight_reaction
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
front_reaction_kg,
|
||||
rear_reaction_kg,
|
||||
total_weight_kg
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
test_condition,
|
||||
Front_weight::numeric,
|
||||
Rear_weight::numeric,
|
||||
Total_weight::numeric
|
||||
from staging2.IHTHAM_HAM_weight_block where trx_record=1;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_atmospheric_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
ambient_temp_c,
|
||||
humidity_pct,
|
||||
wind_velocity_kmph,
|
||||
date_of_test,
|
||||
start_time,
|
||||
end_time
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
Ambient_temp_C::numeric ,
|
||||
humidity::numeric ,
|
||||
wind_velocity,
|
||||
date::date,
|
||||
start_time::time,
|
||||
end_time::time
|
||||
from staging2.IHTHAM_HAM_atmos_cond_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_drawbar_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTHAM_ham_drawbar_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_hot_air_mapping_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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,
|
||||
rh_leg_measured_temp_c,
|
||||
rh_leg_roa_c,
|
||||
lh_leg_measured_temp_c,
|
||||
lh_leg_roa_c,
|
||||
rh_hand_measured_temp_c,
|
||||
rh_hand_roa_c,
|
||||
lh_hand_measured_temp_c,
|
||||
lh_hand_roa_c,
|
||||
time_of_test,
|
||||
towards_main_security_gate_yn,
|
||||
time_diff_h_min
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column3,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::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::time ,column23 ,column24::time
|
||||
from staging2.IHTHAM_ham_results_block ihrb where trx_record=1 order by block_row_number;
|
||||
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_engine_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_weight_reaction
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_atmospheric_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_drawbar_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_hot_air_mapping_results
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTHAM_HAM_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,855 @@
|
||||
drop function if exists staging2.fn_IHTHAM_HAM_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTHAM_HAM_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTHAM_HAM_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHT
|
||||
Sheet Format: IHTHAM_HAM
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTHAM_HAM_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTHAM_HAM_block(1,2,'IHT','IHTHAM_HAM',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTHAM_HAM_H1_Int;
|
||||
truncate table staging2.IHTHAM_HAM_H1_block;
|
||||
truncate table staging2.IHTHAM_HAM_Tyre_Details_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int;
|
||||
truncate table staging2.IHTHAM_HAM_Engine_RPM_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Tractor_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Weight_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Drawbar_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Atmos_Cond_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Results_Block;
|
||||
truncate table staging2.IHTHAM_HAM_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTHAM_HAM;
|
||||
truncate table staging2.stg_process_table_IHTHAM_HAM;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHT */
|
||||
execute 'insert into staging2.stg_specific_table_IHTHAM_HAM
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTHAM_HAM;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHT HAM',
|
||||
detail = 'No data in table stg_specific_table_IHTHAM_HAM',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTHAM_HAM set column15='Objective'
|
||||
where lower(column15) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTHAM_HAM set column15='Acceptance criteria'
|
||||
where lower(column15) like 'acceptance criteria%';
|
||||
|
||||
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTHAM_HAM b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTHAM_HAM a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTHAM_HAM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHAM_HAM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHAM_HAM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHAM_HAM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHAM_HAM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHAM_HAM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHAM_HAM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHAM_HAM a
|
||||
join transactional.source_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=''Gear''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHAM_HAM
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHAM_HAM a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column6 into __model from staging2.stg_process_table_IHTHAM_HAM a
|
||||
where block_tag='IHTHAM_HAM_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTHAM_HAM_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTHAM_HAM_H1_BLOCK';
|
||||
|
||||
insert into staging2.IHTHAM_HAM_H1_INT (c1,c2)
|
||||
select a.column3,column6 from staging2.stg_process_table_IHTHAM_HAM a where block_tag='IHTHAM_HAM_H1';
|
||||
|
||||
insert into staging2.IHTHAM_HAM_H1_INT (c1,c2)
|
||||
select a.column9,column12 from staging2.stg_process_table_IHTHAM_HAM a where block_tag='IHTHAM_HAM_H1';
|
||||
|
||||
insert into staging2.IHTHAM_HAM_H1_INT (c1,c2)
|
||||
select 'Objective',column15
|
||||
from staging2.stg_process_table_IHTHAM_HAM a
|
||||
where block_tag='IHTHAM_HAM_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTHAM_HAM a
|
||||
where column15='Objective'
|
||||
and block_tag='IHTHAM_HAM_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTHAM_HAM_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column15
|
||||
from staging2.stg_process_table_IHTHAM_HAM a
|
||||
where block_tag='IHTHAM_HAM_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTHAM_HAM a
|
||||
where column15='Acceptance criteria'
|
||||
and block_tag='IHTHAM_HAM_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTHAM_HAM_H1_INT (c1,c2)
|
||||
select split_part(column3,':',1),split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTHAM_HAM
|
||||
where block_tag='IHTHAM_HAM_Results' and block_row_number=49;
|
||||
|
||||
insert into staging2.IHTHAM_HAM_H1_INT (c1,c2)
|
||||
select column3,column4
|
||||
from staging2.stg_process_table_IHTHAM_HAM
|
||||
where block_tag='IHTHAM_HAM_Atmos_Cond' and block_row_number=4;
|
||||
|
||||
update staging2.IHTHAM_HAM_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTHAM_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_Location,
|
||||
Operator_Name,
|
||||
Project_Group,
|
||||
Test_standard_refer,
|
||||
Objective,
|
||||
Acceptance_Criteria,
|
||||
Remarks,
|
||||
condition
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTHAM_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,a_20 text);
|
||||
|
||||
update staging2.IHTHAM_HAM_H1_Block
|
||||
set Sample_Receipt_Date=case
|
||||
when Sample_Receipt_Date like '%-%' then Sample_Receipt_Date::timestamptz
|
||||
else date '1899-12-30' + Sample_Receipt_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
update staging2.IHTHAM_HAM_H1_Block
|
||||
set Test_Report_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
update staging2.IHTHAM_HAM_H1_Block
|
||||
set Test_Start_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
update staging2.IHTHAM_HAM_H1_Block
|
||||
set Test_End_Date=case
|
||||
when Test_Report_Date like '%-%' then Test_Report_Date::timestamptz
|
||||
else date '1899-12-30' + Test_Report_Date::int * interval '1' day
|
||||
end;
|
||||
|
||||
|
||||
delete from staging2.IHTHAM_HAM_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTHAM_HAM_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_H1_BLOCK');
|
||||
|
||||
insert into staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
(
|
||||
column3,column4,column5,column6,column8,column9 ,
|
||||
column10,column11,column12,column13,
|
||||
column14,column15,column16,column17,
|
||||
column18,column19,column20,column21 ,
|
||||
column22,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column8,column9,
|
||||
column10,column11,column12,column13,
|
||||
column14,column15,column16,column17,
|
||||
column18,column19,column20,column21 ,
|
||||
column22,block_row_number
|
||||
from staging2.stg_process_table_IHTHAM_HAM a
|
||||
where block_tag='IHTHAM_HAM_Engine_Tyre_Weight'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*block starts - IHTHAM_HAM_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTHAM_HAM_Tyre_Details_Block';
|
||||
insert into staging2.IHTHAM_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(''{column15,column20}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[column15::text,column20::text]) AS val
|
||||
FROM staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int where block_row_number 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 staging2.IHTHAM_HAM_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTHAM_HAM_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTHAM_HAM_Engine_RPM_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Engine_RPM_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTHAM_HAM_Engine_RPM_Block';
|
||||
insert into staging2.IHTHAM_HAM_Engine_RPM_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set low_idle_declared=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=2 and column3='Low Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set low_idle_observed=(select column8 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=2 and column3='Low Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set high_idle_declared=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=3 and column10='High Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set high_idle_observed=(select column8 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=3 and column3='High Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set rated_rpm_declared=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=4 and column3='Rated RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set rated_rpm_observed=(select column8 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=4 and column3='Rated RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block
|
||||
set Engine_to_PTO_Ratio=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=5 and column3='Engine to PTO Ratio')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Engine_RPM_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Engine_RPM_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Engine_RPM_Block');
|
||||
|
||||
|
||||
/*block starts -IHTHAM_HAM_Drawbar_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Drawbar_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTHAM_HAM_Drawbar_Block';
|
||||
|
||||
|
||||
insert into staging2.IHTHAM_HAM_Drawbar_Block(test_condition)
|
||||
select distinct column6 from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number between 9 and 14;
|
||||
|
||||
insert into staging2.IHTHAM_HAM_Drawbar_Block(test_condition)
|
||||
select distinct column8 from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number between 9 and 14;
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Required_pull_in_kg = (select column7
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='UB' and block_row_number =9);
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Required_Power_in_hp = (select column7
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='UB' and block_row_number =10);
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Actual_pull_in_kg = (select column7
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='UB' and block_row_number =11);
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set actual_power_in_hp = (select column7
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='UB' and block_row_number =12);
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Calculated_hitch_heigh_mm = (select column7
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='UB' and block_row_number =13);
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Actual_hitch_height_mm = (select column7
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='UB' and block_row_number =14);
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Required_pull_in_kg = (select column9
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='B' and block_row_number =9);
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Required_Power_in_hp = (select column9
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='B' and block_row_number =10);
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Actual_pull_in_kg = (select column9
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='B' and block_row_number =11);
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set actual_power_in_hp = (select column9
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='B' and block_row_number =12);
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Calculated_hitch_heigh_mm = (select column9
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='B' and block_row_number =13);
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block
|
||||
set Actual_hitch_height_mm = (select column9
|
||||
from staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where test_condition='B' and block_row_number =14);
|
||||
|
||||
update staging2.IHTHAM_HAM_Drawbar_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Drawbar_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Drawbar_Block');
|
||||
|
||||
|
||||
|
||||
/*block starts - IHTHAM_HAM_Tractor_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Tractor_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTHAM_HAM_Tractor_Block';
|
||||
|
||||
insert into staging2.IHTHAM_HAM_Tractor_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTHAM_HAM_Tractor_Block
|
||||
set Wheel_Base_mm=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=5 and column3='Wheel Base (mm)')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Tractor_Block
|
||||
set Engine_Power_hp=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=6 and column3='Engine Power hp')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Tractor_Block
|
||||
set PTO_Power_hp=(select column6 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=7 and column3='PTO Power hp')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Tractor_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Tractor_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Tractor_Block');
|
||||
|
||||
/*block starts -IHTHAM_HAM_Weight_Block*/
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTHAM_HAM_Weight_Block';
|
||||
|
||||
insert into staging2.IHTHAM_HAM_Weight_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set test_condition=(select column10 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=2 )
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set test_condition=(select column10 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=3)
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set Front_weight=(select column13 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=2 and column14='Unballast')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set Front_weight=(select column13 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=3 and column14='Ballast')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set Rear_weight=(select column17 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=2 and column14='Unballast')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set Rear_weight=(select column17 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=3 and column14='Ballast')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set Total_weight=(select column21 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=2 and column14='Unballast')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block
|
||||
set Total_weight=(select column21 from
|
||||
staging2.IHTHAM_HAM_Engine_Tyre_Weight_Int
|
||||
where block_row_number=3 and column14='Ballast')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Weight_Block');
|
||||
|
||||
|
||||
/*block starts - IHTHAM_HAM_Atmos_Cond_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Atmos_Cond_Block',__file_mnemonic,__file_sheet_mnemonic,7);
|
||||
err_block:='IHTHAM_HAM_Atmos_Cond_Block';
|
||||
insert into staging2.IHTHAM_HAM_Atmos_Cond_Block
|
||||
(
|
||||
dummy_f,
|
||||
Ambient_temp_C,
|
||||
humidity,
|
||||
wind_velocity
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{column5}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[column5::text]) AS val
|
||||
FROM staging2.stg_process_table_ihtham_ham
|
||||
where block_tag=''IHTHAM_HAM_Atmos_Cond'' and block_row_number in (1,2,3)
|
||||
ORDER BY generate_series(1,15),block_row_number,2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text);
|
||||
|
||||
update staging2.IHTHAM_HAM_Atmos_Cond_Block
|
||||
set date=
|
||||
(select date '1899-12-30' + column8::int * interval '1' day
|
||||
FROM staging2.stg_process_table_ihtham_ham
|
||||
where column7='Date' and block_tag='IHTHAM_HAM_Atmos_Cond' and block_row_number =1);
|
||||
|
||||
update staging2.IHTHAM_HAM_Atmos_Cond_Block
|
||||
set start_time=
|
||||
(select to_char(to_timestamp((column8::numeric)* 60),'HH12:MI')
|
||||
FROM staging2.stg_process_table_ihtham_ham
|
||||
where column7='Start Time' and block_tag='IHTHAM_HAM_Atmos_Cond' and block_row_number=2);
|
||||
|
||||
update staging2.IHTHAM_HAM_Atmos_Cond_Block
|
||||
set end_time=
|
||||
(select to_char(to_timestamp((column8::numeric)* 60),'HH12:MI')
|
||||
FROM staging2.stg_process_table_ihtham_ham
|
||||
where column7='End time' and block_tag='IHTHAM_HAM_Atmos_Cond' and block_row_number=3);
|
||||
|
||||
|
||||
|
||||
delete from staging2.IHTHAM_HAM_Atmos_Cond_Block where dummy_f is null ;
|
||||
update staging2.IHTHAM_HAM_Atmos_Cond_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Atmos_Cond_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Atmos_Cond_Block');
|
||||
|
||||
|
||||
/*block starts - IHTHAM_HAM_Results_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Results_Block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block:='IHTHAM_HAM_Results_Block';
|
||||
insert into staging2.IHTHAM_HAM_Results_Block
|
||||
(
|
||||
column3,column4,column5,column6,
|
||||
column7,column8,column9,
|
||||
column10,column11,column12,
|
||||
column13,column14,column15,
|
||||
column16,column17,column18,
|
||||
column19,column20,column21,
|
||||
column22,column23,column24,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,
|
||||
column7,column8,column9,
|
||||
column10,column11,column12,
|
||||
column13,column14,column15,
|
||||
column16,column17,column18,
|
||||
column19,column20,column21,
|
||||
column22,column23,column24,block_row_number
|
||||
from staging2.stg_process_table_IHTHAM_HAM a
|
||||
where block_tag='IHTHAM_HAM_Results'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Results_Block
|
||||
set trx_record =0 where block_row_number in (1,2,49,50,51);
|
||||
|
||||
update staging2.ihtham_ham_results_block a
|
||||
set column3= b.first_value from (SELECT
|
||||
block_row_number, column3, value_partition, first_value(column3) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column3,
|
||||
sum(case when column3 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.ihtham_ham_results_block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTHAM_HAM_Results_Block
|
||||
set column22= to_char((column22::numeric) * '24 hours'::interval,'HH12:MIPM')
|
||||
where trx_record=1;
|
||||
|
||||
--select to_char((3.4722222222222654E-3) * '24 hours'::interval,'HH12:MI')
|
||||
|
||||
--select to_timestamp(cast('3.4722222222222654E-3' as real));
|
||||
|
||||
update staging2.IHTHAM_HAM_Results_Block
|
||||
set column24= to_char((cast(column24 as real)) * '24 hours'::interval,'HH24:MI')
|
||||
where trx_record=1;
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Results_Block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Results_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Results_Block');
|
||||
|
||||
/*block starts - IHTHAM_HAM_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHAM_HAM_Footer_block',__file_mnemonic,__file_sheet_mnemonic,9);
|
||||
err_block:='IHTHAM_HAM_Footer_block';
|
||||
|
||||
insert into staging2.IHTHAM_HAM_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set prepared_by=( select column7 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set reviewed_by=( select column7 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set approved_by=( select column7 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and lower(column3)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set rev2=( select column9 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set rev3=( select column18 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set replaces=( select column23 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set revision_no=( select column23 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set prepared_date=( select column19 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set reviewed_date=( select column19 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block a
|
||||
set approved_date=( select column19 from staging2.stg_process_table_IHTHAM_HAM b
|
||||
where b.block_tag='IHTHAM_HAM_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHAM_HAM_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTHAM_HAM_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHAM_HAM_Footer_block');
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTHAM_HAM_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
drop function if exists staging2.fn_IHTHLS_HLS_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTHLS_HLS_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTHLS_HLS_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTHLS
|
||||
Sheet Format: IHTHLS_HLS
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTHLS_HLS_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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,
|
||||
test_purpose
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_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,
|
||||
Test_Purpose
|
||||
from staging2.IHTHLS_HLS_H1_block where trx_record=1;
|
||||
|
||||
update transactional.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 staging2.IHTHLS_HLS_footer_block b
|
||||
where a.file_sheet_mnemonic ='IHTHLS_HLS' and trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTHLS_HLS_tyre_details_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
wheel_base_mm,
|
||||
rear_track_width_mm
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
wheel_base::numeric ,
|
||||
rear_track_width::numeric
|
||||
from staging2.IHTHLS_hls_wheel_block where trx_record=1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when tractor_make like 'Mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_weight_reaction
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTHLS_hls_weight_block where trx_record=1;
|
||||
|
||||
|
||||
insert into transactional.IHT_hyd_lift_sensitivity
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
tpl_load,
|
||||
engine_rpm_type,
|
||||
lifting_time_sec,
|
||||
lowering_time_sec
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
TPL_load,
|
||||
Engine_RPM,
|
||||
Lifting_time_Sec::numeric ,
|
||||
Lowering_time_Sec::numeric
|
||||
from staging2.IHTHLS_hls_numeric_block where trx_record=1;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_weight_reaction
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_hyd_lift_sensitivity
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTHLS_HLS_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,571 @@
|
||||
drop function if exists staging2.fn_IHTHLS_HLS_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTHLS_HLS_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTHLS_HLS_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHTHLS
|
||||
Sheet Format: IHTHLS_HLS
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTHLS_HLS_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTHLS_HLS_block(1,2,'IHTHLS','IHTHLS_HLS',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTHLS_HLS_H1_Int;
|
||||
truncate table staging2.IHTHLS_HLS_H1_block;
|
||||
truncate table staging2.IHTHLS_HLS_Weight_Tyre_Int;
|
||||
truncate table staging2.IHTHLS_HLS_Weight_Block;
|
||||
truncate table staging2.IHTHLS_HLS_Wheel_Block;
|
||||
truncate table staging2.IHTHLS_HLS_Numeric_Int;
|
||||
truncate table staging2.IHTHLS_HLS_Numeric_Block;
|
||||
truncate table staging2.IHTHLS_HLS_Tyre_Details_Block;
|
||||
truncate table staging2.IHTHLS_HLS_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTHLS_HLS;
|
||||
truncate table staging2.stg_process_table_IHTHLS_HLS;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHTHLS */
|
||||
execute 'insert into staging2.stg_specific_table_IHTHLS_HLS
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTHLS_HLS;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHTHLS ',
|
||||
detail = 'No data in table stg_specific_table_IHTHLS_HLS',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTHLS_HLS
|
||||
set column15='Objective' where lower(column15) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTHLS_HLS
|
||||
set column15='Acceptance criteria' where lower(column15) like 'acceptance criteria%';
|
||||
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTHLS_HLS b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTHLS_HLS a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTHLS_HLS
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHLS_HLS a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHLS_HLS
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHLS_HLS a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHLS_HLS
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHLS_HLS a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTHLS_HLS
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTHLS_HLS a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column6 into __model from staging2.stg_process_table_IHTHLS_HLS a
|
||||
where block_tag='IHTHLS_HLS_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTHLS_HLS_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHLS_HLS_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTHLS_HLS_H1_BLOCK';
|
||||
|
||||
insert into staging2.IHTHLS_HLS_H1_INT (c1,c2)
|
||||
select a.column3,column6 from staging2.stg_process_table_IHTHLS_HLS a where block_tag='IHTHLS_HLS_H1';
|
||||
|
||||
insert into staging2.IHTHLS_HLS_H1_INT (c1,c2)
|
||||
select a.column9,column12 from staging2.stg_process_table_IHTHLS_HLS a where block_tag='IHTHLS_HLS_H1';
|
||||
|
||||
insert into staging2.IHTHLS_HLS_H1_INT (c1,c2)
|
||||
select 'Objective',column15
|
||||
from staging2.stg_process_table_IHTHLS_HLS a
|
||||
where block_tag='IHTHLS_HLS_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTHLS_HLS a
|
||||
where column15='Objective'
|
||||
and block_tag='IHTHLS_HLS_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTHLS_HLS_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column15
|
||||
from staging2.stg_process_table_IHTHLS_HLS a
|
||||
where block_tag='IHTHLS_HLS_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTHLS_HLS a
|
||||
where column15='Acceptance criteria'
|
||||
and block_tag='IHTHLS_HLS_H1'
|
||||
);
|
||||
|
||||
|
||||
|
||||
insert into staging2.IHTHLS_HLS_H1_INT (c1,c2)
|
||||
select split_part(column3,':',1),split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTHLS_HLS
|
||||
where block_tag='IHTHLS_HLS_Numeric' and block_row_number=6;
|
||||
|
||||
insert into staging2.IHTHLS_HLS_H1_INT (c1,c2)
|
||||
select 'Test Purpose',column10
|
||||
from staging2.stg_process_table_IHTHLS_HLS a
|
||||
where block_tag='IHTHLS_HLS_Weight_Tyre' and column3='Test Purpose';
|
||||
|
||||
|
||||
update staging2.IHTHLS_HLS_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTHLS_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,
|
||||
Test_Purpose
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTHLS_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,a_20 text);
|
||||
|
||||
|
||||
delete from staging2.IHTHLS_HLS_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTHLS_HLS_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_H1_Block');
|
||||
|
||||
|
||||
insert into staging2.IHTHLS_HLS_Weight_Tyre_Int
|
||||
(
|
||||
column3,column6,column10,column13,column15,column17,column19,
|
||||
column20,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column6,column10,column13,column15,column17,column19,
|
||||
column20,block_row_number
|
||||
from staging2.stg_process_table_IHTHLS_HLS a
|
||||
where block_tag='IHTHLS_HLS_Weight_Tyre'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTHLS_HLS_Weight_Tyre_Int set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Weight_Tyre_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
/*block starts - IHTHLS_HLS_Weight_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHLS_HLS_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTHLS_HLS_Weight_Block';
|
||||
insert into staging2.IHTHLS_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 staging2.IHTHLS_HLS_Weight_Tyre_Int
|
||||
ORDER BY generate_series(1,15),block_row_number,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 staging2.IHTHLS_HLS_Weight_Block where dummy_f is null ;
|
||||
update staging2.IHTHLS_HLS_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_Weight_Block');
|
||||
|
||||
/*block starts - IHTHLS_HLS_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHLS_HLS_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTHLS_HLS_Tyre_Details_Block';
|
||||
insert into staging2.IHTHLS_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 staging2.IHTHLS_HLS_Weight_Tyre_Int where block_row_number 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 staging2.IHTHLS_HLS_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTHLS_HLS_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTHLS_HLS_Wheel_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHLS_HLS_Wheel_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTHLS_HLS_Wheel_Block';
|
||||
insert into staging2.IHTHLS_HLS_Wheel_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTHLS_HLS_Wheel_Block
|
||||
set Wheel_Base=(select column13 from
|
||||
staging2.IHTHLS_HLS_Weight_Tyre_Int
|
||||
where block_row_number=1 and column10='Wheel Base in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Wheel_Block
|
||||
set Rear_Track_Width=(select column20 from
|
||||
staging2.IHTHLS_HLS_Weight_Tyre_Int
|
||||
where block_row_number=1 and column17='Rear Track Width in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHLS_HLS_Wheel_Block set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Wheel_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_Wheel_Block');
|
||||
|
||||
|
||||
/* insert IHTHLS_HLS_Numeric_Int*/
|
||||
|
||||
insert into staging2.IHTHLS_HLS_Numeric_Int
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,block_row_number
|
||||
from staging2.stg_process_table_IHTHLS_HLS a
|
||||
where block_tag='IHTHLS_HLS_Numeric'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTHLS_HLS_Numeric_Int set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Numeric_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTHLS_HLS_Numeric_Int set trx_record =0 where block_row_number in (1,6);
|
||||
|
||||
|
||||
/*block starts - IHTHLS_HLS_Numeric_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHLS_HLS_Numeric_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTHLS_HLS_Numeric_Block';
|
||||
insert into staging2.IHTHLS_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 staging2.IHTHLS_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 staging2.IHTHLS_hls_numeric_block a
|
||||
set TPL_load= b.first_value from (SELECT
|
||||
block_row_number,TPL_load, value_partition, first_value(TPL_load) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
TPL_load,
|
||||
sum(case when TPL_load is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTHLS_hls_numeric_block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b;
|
||||
|
||||
delete from staging2.IHTHLS_HLS_Numeric_Block where dummy_f is null;
|
||||
update staging2.IHTHLS_HLS_Numeric_Block set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Numeric_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_Numeric_Block');
|
||||
|
||||
/*block starts - IHTHLS_HLS_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTHLS_HLS_Footer_block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTHLS_HLS_Footer_block';
|
||||
insert into staging2.IHTHLS_HLS_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set prepared_by=( select column7 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set reviewed_by=( select column7 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set approved_by=( select column7 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and lower(column3)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set rev2=( select column9 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set rev3=( select column18 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set replaces=( select column19 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set revision_no=( select column19 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set prepared_date=( select column16 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set reviewed_date=( select column16 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block a
|
||||
set approved_date=( select column16 from staging2.stg_process_table_IHTHLS_HLS b
|
||||
where b.block_tag='IHTHLS_HLS_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTHLS_HLS_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTHLS_HLS_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTHLS_HLS_Footer_block');
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTHLS_HLS_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
@@ -0,0 +1,603 @@
|
||||
drop function if exists staging2.fn_IHTNST_NST_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTNST_NST_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTNST_NST_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTNST
|
||||
Sheet Format: IHTNST_NST
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTNST_NST_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_purpose
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_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,
|
||||
Test_Purpose
|
||||
from
|
||||
staging2.IHTNST_NST_H1_block where trx_record=1;
|
||||
|
||||
update transactional.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 staging2.IHTNST_nst_footer_block b
|
||||
where a.file_sheet_mnemonic='IHTNST_NST' and trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
tyre_details,
|
||||
tyre_make,
|
||||
tyre_size,
|
||||
ply_rating::numeric ,
|
||||
load_carrying_capacity,
|
||||
wheel_rim_make_size
|
||||
from staging2.IHTNST_nst_tyre_details_block where trx_record=1;
|
||||
|
||||
|
||||
insert into transactional.test_instance_engine_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTNST_nst_engine_rpm_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTNST_nst_weight_block where trx_record=1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when tractor_make like 'Mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_atmospheric_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
ambient_temp_c::numeric,
|
||||
humidity::numeric,
|
||||
pressure_kpa::numeric,
|
||||
background_noise::numeric,
|
||||
wind_velocity
|
||||
from staging2.IHTNST_nst_atmos_cond_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_noise_measurement_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column1,
|
||||
column2,
|
||||
column3,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric
|
||||
from staging2.IHTNST_nst_stand_noise_block where trx_record=1;
|
||||
|
||||
update transactional.IHT_noise_measurement_results
|
||||
set test_condition = (select column4
|
||||
from staging2.IHTNST_nst_stand_noise_block
|
||||
where block_row_number=3) where file_syspk = __file_syspk;
|
||||
|
||||
insert into transactional.IHT_noise_measurement_test
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
from transactional.IHT_noise_measurement_results where test_type='BY STANDER’S NOISE';
|
||||
|
||||
update transactional.IHT_noise_measurement_test
|
||||
set acceptance_criteria=b.acceptance_criteria,
|
||||
remarks =b.remarks
|
||||
from staging2.IHTNST_nst_stand_noise_block b
|
||||
where b.column1 ='BY STANDER’S NOISE' and test_type='BY STANDER’S NOISE' and trx_record=1;
|
||||
|
||||
insert into transactional.IHT_noise_measurement_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column1,
|
||||
column2,
|
||||
column3,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric
|
||||
from staging2.IHTNST_nst_stand_noise_block where trx_record=1;
|
||||
|
||||
update transactional.IHT_noise_measurement_results
|
||||
set test_condition = (select column7
|
||||
from staging2.IHTNST_nst_stand_noise_block
|
||||
where block_row_number=3) where test_condition is null;
|
||||
|
||||
insert into transactional.IHT_noise_measurement_test
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
from transactional.IHT_noise_measurement_results where test_type='BY STANDER’S NOISE';
|
||||
|
||||
update transactional.IHT_noise_measurement_test
|
||||
set acceptance_criteria=b.acceptance_criteria,
|
||||
remarks =b.remarks
|
||||
from staging2.IHTNST_nst_stand_noise_block b
|
||||
where b.column1 ='BY STANDER’S NOISE' and test_type='BY STANDER’S NOISE' and trx_record=1;
|
||||
|
||||
insert into transactional.IHT_noise_measurement_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column1,
|
||||
column2,
|
||||
column3,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric
|
||||
from staging2.IHTNST_nst_oel_noise_block where trx_record=1;
|
||||
|
||||
update transactional.IHT_noise_measurement_test
|
||||
set acceptance_criteria=b.acceptance_criteria,
|
||||
remarks =b.remarks
|
||||
from staging2.IHTNST_nst_oel_noise_block b
|
||||
where b.column1 ='OEL Noise without Load' and test_type='OEL Noise without Load';
|
||||
|
||||
insert into transactional.IHT_noise_measurement_results
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column1,
|
||||
column2,
|
||||
column3,
|
||||
column4::numeric,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric
|
||||
from staging2.IHTNST_nst_oel_noise_load_block where trx_record=1;
|
||||
|
||||
update transactional.IHT_noise_measurement_test
|
||||
set acceptance_criteria=b.acceptance_criteria,
|
||||
remarks =b.remarks
|
||||
from staging2.IHTNST_nst_oel_noise_load_block b
|
||||
where b.column1 ='OEL Noise with Load' and test_type='OEL Noise with Load';
|
||||
|
||||
insert into transactional.IHT_noise_measurement_test
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
from transactional.IHT_noise_measurement_results where test_type ='OEL Noise without Load' ;
|
||||
|
||||
insert into transactional.IHT_noise_measurement_test
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
test_condition,
|
||||
test_type,
|
||||
test_mode
|
||||
from transactional.IHT_noise_measurement_results where test_type ='OEL Noise with Load';
|
||||
|
||||
delete from transactional.IHT_noise_measurement_test a
|
||||
using transactional.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 transactional.IHT_noise_measurement_results a
|
||||
set noise_measurement_id =(select syspk
|
||||
from transactional.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 syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_engine_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_atmospheric_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_noise_measurement_results
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_noise_measurement_test
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTNST_NST_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,917 @@
|
||||
drop function if exists staging2.fn_IHTNST_NST_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTNST_NST_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
|
||||
begin
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTNST_NST_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHTNST
|
||||
Sheet Format: IHTNST_NST
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTNST_NST_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTNST_NST_block(1,2,'IHTNST','IHTNST_NST',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTNST_NST_H1_Int;
|
||||
truncate table staging2.IHTNST_NST_H1_block;
|
||||
truncate table staging2.IHTNST_NST_Tyre_Details_Block;
|
||||
truncate table staging2.IHTNST_NST_Engine_RPM_Atmos_Int;
|
||||
truncate table staging2.IHTNST_NST_Engine_RPM_Block;
|
||||
truncate table staging2.IHTNST_NST_Weight_Block;
|
||||
truncate table staging2.IHTNST_NST_Atmos_Cond_Block;
|
||||
truncate table staging2.IHTNST_NST_STAND_Noise_Block;
|
||||
truncate table staging2.IHTNST_NST_OEL_Noise_Block;
|
||||
truncate table staging2.IHTNST_NST_OEL_Noise_Load_Block;
|
||||
truncate table staging2.IHTNST_NST_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTNST_NST;
|
||||
truncate table staging2.stg_process_table_IHTNST_NST;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHTNST */
|
||||
execute 'insert into staging2.stg_specific_table_IHTNST_NST
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTNST_NST;
|
||||
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHT NST',
|
||||
detail = 'No data in table stg_specific_table_IHTNST_NST',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTNST_NST set column8='Objective' where lower(column8) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTNST_NST set column8='Condition' where lower(column8) like 'condition%';
|
||||
|
||||
update staging2.stg_specific_table_IHTNST_NST set column3='Remarks' where lower(column3) like 'remarks%';
|
||||
|
||||
update staging2.stg_specific_table_IHTNST_NST set column7='Acceptance Criteria'
|
||||
where lower(column7) like 'acceptance criteria%';
|
||||
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified ;
|
||||
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTNST_NST b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTNST_NST a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Prepared by''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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=''Tyre Details''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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=''BY STANDER’S NOISE''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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=''OEL Noise without Load''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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=''OEL Noise with Load''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTNST_NST
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTNST_NST a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column4 into __model from staging2.stg_process_table_IHTNST_nst a
|
||||
where block_tag='IHTNST_NST_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTNST_NST_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTNST_NST_H1_BLOCK';
|
||||
insert into staging2.IHTNST_NST_H1_INT (c1,c2)
|
||||
select a.column3,column4 from staging2.stg_process_table_IHTNST_NST a where block_tag='IHTNST_NST_H1';
|
||||
|
||||
insert into staging2.IHTNST_NST_H1_INT (c1,c2)
|
||||
select a.column6,column7 from staging2.stg_process_table_IHTNST_NST a where block_tag='IHTNST_NST_H1';
|
||||
|
||||
insert into staging2.IHTNST_NST_H1_INT (c1,c2)
|
||||
select 'Objective',column8
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where column8='Objective'
|
||||
and block_tag='IHTNST_NST_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTNST_NST_H1_INT (c1,c2)
|
||||
select 'Condition',column8
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_Tyre_Details'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where column8='Condition'
|
||||
and block_tag='IHTNST_NST_Tyre_Details'
|
||||
);
|
||||
|
||||
insert into staging2.IHTNST_NST_H1_INT (c1,c2)
|
||||
select 'Test Purpose',column6
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where column3='Test Purpose' and block_tag ='IHTNST_NST_Engine_RPM_Atmos';
|
||||
|
||||
|
||||
update staging2.IHTNST_NST_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTNST_NST_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,
|
||||
condition,
|
||||
Test_Purpose
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTNST_NST_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 staging2.IHTNST_NST_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTNST_NST_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_H1_BLOCK');
|
||||
|
||||
/*block starts - IHTNST_NST_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTNST_NST_Tyre_Details_Block';
|
||||
|
||||
insert into staging2.IHTNST_NST_Tyre_Details_Block
|
||||
(
|
||||
dummy_f,
|
||||
Tyre_Details,
|
||||
Tyre_Make,
|
||||
Tyre_size,
|
||||
Ply_Rating,
|
||||
Load_Carrying_Capacity,
|
||||
Wheel_rim_Make_size
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{column4,column6}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[column4::text,column6::text]) AS val
|
||||
FROM staging2.stg_process_table_IHTNST_NST where block_tag=''IHTNST_NST_Tyre_Details''
|
||||
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);
|
||||
|
||||
update staging2.IHTNST_NST_Tyre_Details_Block
|
||||
set ply_rating =replace(ply_rating,' Ply','');
|
||||
|
||||
delete from staging2.IHTNST_NST_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTNST_NST_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_Tyre_Details_Block');
|
||||
|
||||
|
||||
/* inserting Engine_RPM_Atmos_INT */
|
||||
|
||||
insert into staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_Engine_RPM_Atmos'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column8=(select column6 from staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=9) where block_row_number=5;
|
||||
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column6 = null where block_row_number=9;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column9=(select column7 from staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=9) where block_row_number=5;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column7=null where block_row_number=9;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column8=(select column8 from staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=9)where block_row_number=6;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column8 =null where block_row_number=9;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column9=(select column9 from staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=9)where block_row_number=6;
|
||||
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
set column9 =null where block_row_number=9;
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Atmos_Int set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_Engine_RPM_Atmos_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*block starts - IHTNST_NST_Engine_RPM_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_Engine_RPM_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTNST_NST_Engine_RPM_Block';
|
||||
insert into staging2.IHTNST_NST_Engine_RPM_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set low_idle_declared=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=2 and column3='Low Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set low_idle_observed=(select column6 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=2 and column3='Low Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set high_idle_declared=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=3 and column3='High IdleRPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set high_idle_observed=(select column6 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=3 and column3='High IdleRPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set rated_rpm_declared=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=4 and column3='Rated RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set rated_rpm_observed=(select column6 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=4 and column3='Rated RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set Engine_to_PTO_Ratio=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=9 and column3='Engine to PTO Ratio')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set low_idle_remark= (select column7
|
||||
FROM staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=2 and column3='Low Idle RPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block
|
||||
set high_idle_remark= (select column7
|
||||
FROM staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=3 and column3='High IdleRPM')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTNST_NST_Engine_RPM_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_Engine_RPM_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_Engine_RPM_Block');
|
||||
|
||||
/*block starts -IHTNST_NST_Weight_Block*/
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTNST_NST_Weight_Block';
|
||||
insert into staging2.IHTNST_NST_Weight_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set Front_weight_declared=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=6 and column3='Front')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set Front_weight_observed=(select column6 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=6 and column3='Front')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set Rear_weight_declared=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=7 and column3='Rear')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set Rear_weight_observed=(select column6 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=7 and column3='Rear')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set Total_weight_declared=(select column4 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=8 and column3='Total')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set Total_weight_observed=(select column6 from
|
||||
staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=8 and column3='Total')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set front_weight_remark= (select column7
|
||||
FROM staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=6 and column3='Front')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set rear_weight_remark= (select column7
|
||||
FROM staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=7 and column3='Rear')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block
|
||||
set total_weight_remark= (select column7
|
||||
FROM staging2.IHTNST_NST_Engine_RPM_Atmos_Int
|
||||
where block_row_number=8 and column3='Total')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTNST_NST_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_Weight_Block');
|
||||
|
||||
|
||||
/*block starts - IHTNST_NST_Atmos_Cond_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_Atmos_Cond_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTNST_NST_Atmos_Cond_Block';
|
||||
insert into staging2.IHTNST_NST_Atmos_Cond_Block
|
||||
(
|
||||
dummy_f,
|
||||
Ambient_temp_C,
|
||||
humidity,
|
||||
Pressure_kPa,
|
||||
Background_Noise,
|
||||
wind_velocity
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{column9}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[column9::text]) AS val
|
||||
FROM staging2.IHTNST_NST_Engine_RPM_Atmos_Int where block_row_number between 2 and 6
|
||||
ORDER BY generate_series(1,15),block_row_number,2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text);
|
||||
|
||||
delete from staging2.IHTNST_NST_Atmos_Cond_Block where dummy_f is null ;
|
||||
update staging2.IHTNST_NST_Atmos_Cond_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_Atmos_Cond_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_Atmos_Cond_Block');
|
||||
|
||||
|
||||
/*block starts - IHTNST_NST_STAND_Noise_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_STAND_Noise_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
err_block:='IHTNST_NST_STAND_Noise_Block';
|
||||
insert into staging2.IHTNST_NST_STAND_Noise_Block
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_STAND_Noise'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block
|
||||
set column2=column3 where column4 is null and block_row_number in (2,6);
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block
|
||||
set column1=column3 where column4 is null and block_row_number =1;
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block a
|
||||
set column1= b.first_value from (SELECT
|
||||
block_row_number, column1, value_partition, first_value(column1) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column1,
|
||||
sum(case when column1 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTNST_NST_STAND_Noise_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number, column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTNST_NST_STAND_Noise_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block
|
||||
set trx_record=0 where block_row_number <>5;
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block
|
||||
set remarks=(select column3
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_STAND_Noise' and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where lower(column3)='remarks'
|
||||
and block_tag='IHTNST_NST_STAND_Noise'
|
||||
));
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block
|
||||
set acceptance_criteria=(select column7
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_STAND_Noise' and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where lower(column7)='acceptance criteria'
|
||||
and block_tag='IHTNST_NST_STAND_Noise'
|
||||
));
|
||||
|
||||
update staging2.IHTNST_NST_STAND_Noise_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_STAND_Noise_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_STAND_Noise_Block');
|
||||
|
||||
|
||||
/*block starts - IHTNST_NST_OEL_Noise_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_OEL_Noise_Block',__file_mnemonic,__file_sheet_mnemonic,7);
|
||||
err_block:='IHTNST_NST_OEL_Noise_Block';
|
||||
insert into staging2.IHTNST_NST_OEL_Noise_Block
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_OEL_Noise'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block
|
||||
set column2=column3 where column4 is null and block_row_number in (2,8,14);
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block
|
||||
set column1=column3 where column4 is null and block_row_number =1;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block a
|
||||
set column1= b.first_value from (SELECT
|
||||
block_row_number, column1, value_partition, first_value(column1) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column1,
|
||||
sum(case when column1 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTNST_NST_OEL_Noise_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number, column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTNST_NST_OEL_Noise_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block
|
||||
set trx_record=0 where block_row_number in (1,2,3,4,8,9,10,14,15,16,17,18);
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block
|
||||
set remarks=(select column3
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_OEL_Noise' and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where lower(column3)='remarks'
|
||||
and block_tag='IHTNST_NST_OEL_Noise'
|
||||
));
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block
|
||||
set acceptance_criteria=(select column7
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_OEL_Noise' and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where lower(column7)='acceptance criteria'
|
||||
and block_tag='IHTNST_NST_OEL_Noise'
|
||||
));
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_OEL_Noise_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_OEL_Noise_Block');
|
||||
|
||||
/*block starts - IHTNST_NST_OEL_Noise_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_OEL_Noise_Load_Block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block:='IHTNST_NST_OEL_Noise_Load_Block';
|
||||
insert into staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_OEL_Noise_Load'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
set column2=column3 where column4 is null and block_row_number in (2,5,11);
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
set column1=column3 where column4 is null and block_row_number =1;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block a
|
||||
set column1= b.first_value from (SELECT
|
||||
block_row_number, column1, value_partition, first_value(column1) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column1,
|
||||
sum(case when column1 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block a
|
||||
set column2= b.first_value from (SELECT
|
||||
block_row_number, column2, value_partition, first_value(column2) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column2,
|
||||
sum(case when column2 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
set trx_record=0 where block_row_number not in (8,9,10,14,15,16);
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
set remarks=(select column3
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_OEL_Noise_Load' and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where lower(column3)='remarks'
|
||||
and block_tag='IHTNST_NST_OEL_Noise_Load'
|
||||
));
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block
|
||||
set acceptance_criteria=(select column7
|
||||
from staging2.stg_process_table_IHTNST_NST a
|
||||
where block_tag='IHTNST_NST_OEL_Noise_Load' and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTNST_NST a
|
||||
where lower(column7)='acceptance criteria'
|
||||
and block_tag='IHTNST_NST_OEL_Noise_Load'
|
||||
));
|
||||
|
||||
update staging2.IHTNST_NST_OEL_Noise_Load_Block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_OEL_Noise_Load_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_OEL_Noise_Load_Block');
|
||||
|
||||
|
||||
|
||||
/*block starts - IHTNST_NST_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTNST_NST_Footer_block',__file_mnemonic,__file_sheet_mnemonic,9);
|
||||
err_block:='IHTNST_NST_Footer_block';
|
||||
|
||||
insert into staging2.IHTNST_NST_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set prepared_by=( select column4 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set reviewed_by=( select column4 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set approved_by=( select column4 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and lower(column3)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set rev2=( select column5 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set rev3=( select column8 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set replaces=( select column9 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set revision_no=( select column9 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set prepared_date=( select column8 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set reviewed_date=( select column8 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block a
|
||||
set approved_date=( select column8 from staging2.stg_process_table_IHTNST_NST b
|
||||
where b.block_tag='IHTNST_NST_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTNST_NST_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTNST_NST_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_Footer_block');
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTNST_NST_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,379 @@
|
||||
drop function if exists staging2.fn_IHTSLL_SLL_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTSLL_SLL_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __test_instance_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
declare __test_master_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
begin
|
||||
__file_syspk := p_file_syspk;
|
||||
/************************************************************
|
||||
Function Name:fn_IHTSLL_SLL_TRX
|
||||
Function Desc: This function populates data into ODS
|
||||
File Format: IHTSLL
|
||||
Sheet Format: IHTSLL_SLL
|
||||
Creation Date:
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTSLL_SLL_TRX()
|
||||
***************************************************************/
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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,
|
||||
test_purpose
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_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,
|
||||
Test_Purpose
|
||||
from staging2.IHTSLL_SLL_H1_block where trx_record=1;
|
||||
|
||||
update transactional.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 staging2.IHTSLL_SLL_footer_block b
|
||||
where a.file_sheet_mnemonic ='IHTSLL_SLL' and trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tyre_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTSLL_SLL_tyre_details_block where trx_record=1;
|
||||
|
||||
insert into transactional.test_instance_tractor_info
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
tractor_make,
|
||||
tractor_model,
|
||||
wheel_base_mm,
|
||||
rear_track_width_mm
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
wheel_base::numeric ,
|
||||
rear_track_width::numeric
|
||||
from staging2.IHTSLL_SLL_wheel_block where trx_record=1;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set mahindra_model_yn = (
|
||||
case when lower(tractor_make) like 'mahindra%' then 'Y' else 'N' end
|
||||
) where file_syspk =__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info a
|
||||
set test_tractor_yn ='Y' where syspk in
|
||||
(select min(syspk) from transactional.test_instance_tractor_info b
|
||||
where b.file_syspk =a.file_syspk)
|
||||
and a.file_syspk =__file_syspk;
|
||||
|
||||
|
||||
/*block */
|
||||
|
||||
insert into transactional.test_instance_weight_reaction
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_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 staging2.IHTSLL_SLL_weight_block where trx_record=1;
|
||||
|
||||
|
||||
insert into transactional.IHT_gear_max_speed
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3,
|
||||
column4::numeric ,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric
|
||||
from staging2.IHTSLL_sll_forward_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_gear_max_speed
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column2,
|
||||
column3,
|
||||
column4::numeric ,
|
||||
column5::numeric,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8::numeric,
|
||||
column9::numeric
|
||||
from staging2.IHTSLL_sll_reverse_block where trx_record=1;
|
||||
|
||||
insert into transactional.IHT_speed_lead_lag_measurement
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
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_mnemonic,
|
||||
file_sheet_mnemonic,
|
||||
make,model,
|
||||
column3,
|
||||
column4::numeric ,
|
||||
column5,
|
||||
column6::numeric,
|
||||
column7::numeric,
|
||||
column8
|
||||
from staging2.IHTSLL_sll_lead_lag_block where trx_record=1;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_model into __model from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk from transactional.test_master into __test_master_id where test_type ='In House';
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance
|
||||
set test_master_id =__test_master_id,
|
||||
test_tractor_id =__test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance_tractor_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_tyre_info
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
|
||||
update transactional.test_instance_weight_reaction
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_gear_max_speed
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.IHT_speed_lead_lag_measurement
|
||||
set test_instance_id=__test_instance_id,
|
||||
test_instance_tractor_id = __test_instance_tractor_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'trx', 'fn_IHTSLL_SLL_TRX', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
@@ -0,0 +1,670 @@
|
||||
drop function if exists staging2.fn_IHTSLL_SLL_block;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_IHTSLL_SLL_block(p_client_id int,p_function_id int, p_file_mnemonic text,p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare err_query int;
|
||||
declare err_block text;
|
||||
|
||||
begin
|
||||
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_IHTSLL_SLL_block
|
||||
Function Desc: This function populates data into staging 2 block
|
||||
File Format: IHTSLL
|
||||
Sheet Format: IHTSLL_SLL
|
||||
Creation Date: March 25 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_IHTSLL_SLL_block(p_client_id,p_function_id, p_file_mnemonic,
|
||||
p_file_sheet_mnemonic, p_file_syspk)
|
||||
Function call ex: select staging2.fn_IHTSLL_SLL_block(1,2,'IHTSLL','IHTSLL_SLL',456)
|
||||
***************************************************************/
|
||||
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/* to process multiple files - re-runnability*/
|
||||
|
||||
truncate table staging2.IHTSLL_SLL_H1_Int;
|
||||
truncate table staging2.IHTSLL_SLL_H1_block;
|
||||
truncate table staging2.IHTSLL_SLL_Weight_Tyre_Int;
|
||||
truncate table staging2.IHTSLL_SLL_Weight_Block;
|
||||
truncate table staging2.IHTSLL_SLL_Wheel_Block;
|
||||
truncate table staging2.IHTSLL_SLL_Tyre_Details_Block;
|
||||
truncate table staging2.IHTSLL_SLL_Forward_Block;
|
||||
truncate table staging2.IHTSLL_SLL_Reverse_Block;
|
||||
truncate table staging2.IHTSLL_SLL_Lead_Lag_Block;
|
||||
truncate table staging2.IHTSLL_SLL_Footer_Block;
|
||||
truncate table staging2.stg_specific_table_IHTSLL_SLL;
|
||||
truncate table staging2.stg_process_table_IHTSLL_SLL;
|
||||
|
||||
|
||||
execute 'delete from fw_core.fw_jobctl_file_sheet_block_run_schedule where file_syspk='||p_file_syspk||' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=null,
|
||||
row_previous_number=null,
|
||||
row_read_end=null,
|
||||
run_time=null
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* transfer data from generic to specific for IHTSLL */
|
||||
execute 'insert into staging2.stg_specific_table_IHTSLL_SLL
|
||||
select * from staging1.staging_generic_table a
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''
|
||||
and a.file_syspk='||p_file_syspk||'';
|
||||
|
||||
select count(*) into err_query from staging2.stg_specific_table_IHTSLL_SLL;
|
||||
|
||||
if err_query=0 then
|
||||
err_context := 'data not present';
|
||||
raise exception using
|
||||
message = 'No Data for IHTSLL',
|
||||
detail = 'No data in table stg_specific_table_IHTSLL_SLL',
|
||||
errcode = '42704',
|
||||
hint = 'check sheet mnemonic in generic table, if it is null update it';
|
||||
end if;
|
||||
|
||||
/* trimming data */
|
||||
update staging2.stg_specific_table_IHTSLL_SLL
|
||||
set column15='Objective' where lower(column15) like 'objective%';
|
||||
|
||||
update staging2.stg_specific_table_IHTSLL_SLL
|
||||
set column15='Acceptance criteria' where lower(column15) like 'acceptance criteria%';
|
||||
|
||||
update transactional.source_config set F1_source=F1_modified;
|
||||
|
||||
/* keyword match in config table*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_number_start=(select min(b.row_number)
|
||||
from staging2.stg_specific_table_IHTSLL_SLL b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.is_rownumber_fetched is null)
|
||||
where a.row_number_start is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* reverese update in process table for match*/
|
||||
execute 'update staging2.stg_specific_table_IHTSLL_SLL a
|
||||
set is_rownumber_fetched=1
|
||||
from transactional.source_config b
|
||||
where upper(F1_modified)=upper(column3)
|
||||
and b.row_number_start=a.row_number
|
||||
and is_rownumber_fetched is null
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'update transactional.source_config a set row_previous_number=row_number_start-1
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* update config files for row numbers start, end */
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end= (select b.row_number_start
|
||||
from transactional.source_config b
|
||||
where b.syspk=a.syspk+1 and file_mnemonic='''||p_file_mnemonic||''' and file_sheet_mnemonic='''||p_file_sheet_mnemonic||''' )
|
||||
where a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* config file last field update as null otherwise it picks up next format row number*/
|
||||
execute 'update transactional.source_config a
|
||||
set row_read_end = null ,run_time=current_timestamp
|
||||
where f1_modified =''Remarks:''
|
||||
and a.file_mnemonic='''||p_file_mnemonic||''' and a.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/* tagging block_row_numbers*/
|
||||
execute 'insert into staging2.stg_process_table_IHTSLL_SLL
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTSLL_SLL a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTSLL_SLL
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTSLL_SLL a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTSLL_SLL
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTSLL_SLL a
|
||||
join transactional.source_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=''K2-4WD HST EACH GEAR MAX SPEED - FORWARD''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTSLL_SLL
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTSLL_SLL a
|
||||
join transactional.source_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=''K2- 4WD HST EACH GEAR MAX SPEED REVERSE''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTSLL_SLL
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTSLL_SLL a
|
||||
join transactional.source_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 K2 4WD HST''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
execute 'insert into staging2.stg_process_table_IHTSLL_SLL
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_IHTSLL_SLL a
|
||||
join transactional.source_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_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
/*selecting tractor model*/
|
||||
select column6 into __model from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_H1' and trim(column3)='Tractor Model';
|
||||
|
||||
/*block starts - IHTSLL_SLL_H1_BLOCK */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_H1_BLOCK',__file_mnemonic,__file_sheet_mnemonic,1);
|
||||
err_block:='IHTSLL_SLL_H1_BLOCK';
|
||||
|
||||
insert into staging2.IHTSLL_SLL_H1_INT (c1,c2)
|
||||
select a.column3,column6 from staging2.stg_process_table_IHTSLL_SLL a where block_tag='IHTSLL_SLL_H1';
|
||||
|
||||
insert into staging2.IHTSLL_SLL_H1_INT (c1,c2)
|
||||
select a.column9,column12 from staging2.stg_process_table_IHTSLL_SLL a where block_tag='IHTSLL_SLL_H1';
|
||||
|
||||
insert into staging2.IHTSLL_SLL_H1_INT (c1,c2)
|
||||
select 'Objective',column15
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTSLL_SLL a
|
||||
where column15='Objective'
|
||||
and block_tag='IHTSLL_SLL_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTSLL_SLL_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column15
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_H1'
|
||||
and row_number=
|
||||
(
|
||||
select row_number+1 from
|
||||
staging2.stg_process_table_IHTSLL_SLL a
|
||||
where column15='Acceptance criteria'
|
||||
and block_tag='IHTSLL_SLL_H1'
|
||||
);
|
||||
|
||||
insert into staging2.IHTSLL_SLL_H1_INT (c1,c2)
|
||||
select split_part(column3,':',1),split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTSLL_SLL
|
||||
where block_tag='IHTSLL_SLL_Lead_Lag' and block_row_number=10;
|
||||
|
||||
insert into staging2.IHTSLL_SLL_H1_INT (c1,c2)
|
||||
select 'Test Purpose',column10
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where column3='Test Purpose' and block_tag='IHTSLL_SLL_Weight_Tyre';
|
||||
|
||||
update staging2.IHTSLL_SLL_H1_Int set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_H1_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
insert into staging2.IHTSLL_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,
|
||||
Test_Purpose
|
||||
)
|
||||
SELECT *
|
||||
FROM crosstab(
|
||||
'SELECT unnest(''{c2}''::text[]) AS col
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTSLL_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,a_20 text);
|
||||
|
||||
|
||||
delete from staging2.IHTSLL_SLL_H1_Block where dummy_f is null ;
|
||||
update staging2.IHTSLL_SLL_H1_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_H1_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_H1_BLOCK');
|
||||
|
||||
|
||||
insert into staging2.IHTSLL_SLL_Weight_Tyre_Int
|
||||
(
|
||||
column3,column6,column10,column11,column13,column15,column17,column19,
|
||||
column20,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column6,column10,column11,column13,column15,column17,column19,
|
||||
column20,block_row_number
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_Weight_Tyre'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTSLL_SLL_Weight_Tyre_Int set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Weight_Tyre_Int set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
/*block starts - IHTSLL_SLL_Weight_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Weight_Block',__file_mnemonic,__file_sheet_mnemonic,2);
|
||||
err_block:='IHTSLL_SLL_Weight_Block';
|
||||
insert into staging2.IHTSLL_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 staging2.IHTSLL_SLL_Weight_Tyre_Int
|
||||
ORDER BY generate_series(1,15),block_row_number,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 staging2.IHTSLL_SLL_Weight_Block where dummy_f is null ;
|
||||
update staging2.IHTSLL_SLL_Weight_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Weight_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Weight_Block');
|
||||
|
||||
/*block starts - IHTSLL_SLL_Tyre_Details_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Tyre_Details_Block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='IHTSLL_SLL_Tyre_Details_Block';
|
||||
insert into staging2.IHTSLL_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 staging2.IHTSLL_SLL_Weight_Tyre_Int where block_row_number 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 staging2.IHTSLL_SLL_Tyre_Details_Block where dummy_f is null ;
|
||||
update staging2.IHTSLL_SLL_Tyre_Details_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Tyre_Details_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Tyre_Details_Block');
|
||||
|
||||
|
||||
/*block starts - IHTSLL_SLL_Wheel_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Wheel_Block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='IHTSLL_SLL_Wheel_Block';
|
||||
insert into staging2.IHTSLL_SLL_Wheel_Block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTSLL_SLL_Wheel_Block
|
||||
set Wheel_Base=(select column13 from
|
||||
staging2.IHTSLL_SLL_Weight_Tyre_Int
|
||||
where block_row_number=1 and column10='Wheel Base in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Wheel_Block
|
||||
set Rear_Track_Width=(select column20 from
|
||||
staging2.IHTSLL_SLL_Weight_Tyre_Int
|
||||
where block_row_number=1 and column17='Rear Track Width in mm')
|
||||
where dummy_f='dummy';
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Wheel_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Wheel_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Wheel_Block');
|
||||
|
||||
/*block starts - IHTSLL_SLL_Forward_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Forward_Block',__file_mnemonic,__file_sheet_mnemonic,5);
|
||||
err_block:='IHTSLL_SLL_Forward_Block';
|
||||
|
||||
insert into staging2.IHTSLL_SLL_Forward_Block
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_Forward'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTSLL_SLL_Forward_Block
|
||||
set column2=(select split_part(column3,'-',3)
|
||||
from staging2.IHTSLL_SLL_Forward_Block where block_row_number =1);
|
||||
|
||||
delete from staging2.IHTSLL_SLL_Forward_Block where column3 is null;
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Forward_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Forward_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTSLL_SLL_Forward_Block set trx_record =0 where block_row_number in (1,2);
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Forward_Block');
|
||||
|
||||
/*block starts - IHTSLL_SLL_Reverse_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Reverse_Block',__file_mnemonic,__file_sheet_mnemonic,6);
|
||||
|
||||
err_block:='IHTSLL_SLL_Reverse_Block';
|
||||
|
||||
insert into staging2.IHTSLL_SLL_Reverse_Block
|
||||
(
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
)
|
||||
select
|
||||
column2,column3,column4,column5,column6,column7,
|
||||
column8,column9,block_row_number
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_Reverse'
|
||||
order by block_row_number;
|
||||
|
||||
update staging2.IHTSLL_sll_reverse_block
|
||||
set column2=(select split_part(column3,' ',8)
|
||||
from staging2.IHTSLL_sll_reverse_block where block_row_number =1);
|
||||
|
||||
delete from staging2.IHTSLL_sll_reverse_block where column3 is null;
|
||||
|
||||
update staging2.IHTSLL_SLL_Reverse_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Reverse_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
update staging2.IHTSLL_SLL_Reverse_Block set trx_record =0 where block_row_number in (1,2);
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Reverse_Block');
|
||||
|
||||
/*block starts - IHTSLL_SLL_Lead_Lag_Block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Lead_Lag_Block',__file_mnemonic,__file_sheet_mnemonic,7);
|
||||
err_block='IHTSLL_SLL_Lead_Lag_Block';
|
||||
insert into staging2.IHTSLL_SLL_Lead_Lag_Block
|
||||
(
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,block_row_number
|
||||
)
|
||||
select
|
||||
column3,column4,column5,column6,column7,
|
||||
column8,block_row_number
|
||||
from staging2.stg_process_table_IHTSLL_SLL a
|
||||
where block_tag='IHTSLL_SLL_Lead_Lag'
|
||||
order by block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Lead_Lag_Block a
|
||||
set column3= b.first_value from (SELECT
|
||||
block_row_number, column3, value_partition, first_value(column3) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column3,
|
||||
sum(case when column3 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTSLL_SLL_Lead_Lag_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTSLL_SLL_Lead_Lag_Block a
|
||||
set column4= b.first_value from (SELECT
|
||||
block_row_number, column4, value_partition, first_value(column4) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column4,
|
||||
sum(case when column4 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTSLL_SLL_Lead_Lag_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Lead_Lag_Block a
|
||||
set column7= b.first_value from (SELECT
|
||||
block_row_number, column7, value_partition, first_value(column7) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column7,
|
||||
sum(case when column7 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTSLL_SLL_Lead_Lag_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Lead_Lag_Block a
|
||||
set column8= b.first_value from (SELECT
|
||||
block_row_number, column8, value_partition, first_value(column8) over (partition by value_partition order by block_row_number)
|
||||
FROM (
|
||||
SELECT
|
||||
block_row_number,
|
||||
column8,
|
||||
sum(case when column8 is null then 0 else 1 end) over (order by block_row_number) as value_partition
|
||||
FROM staging2.IHTSLL_SLL_Lead_Lag_Block
|
||||
ORDER BY block_row_number ASC
|
||||
) as q) b where a.block_row_number = b.block_row_number;
|
||||
|
||||
update staging2.IHTSLL_SLL_Lead_Lag_Block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Lead_Lag_Block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Lead_Lag_Block set trx_record =0 where block_row_number in (1,2,3);
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Lead_Lag_Block');
|
||||
|
||||
/*block starts - IHTSLL_SLL_Footer_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'IHTSLL_SLL_Footer_block',__file_mnemonic,__file_sheet_mnemonic,8);
|
||||
err_block:='IHTSLL_SLL_Footer_block';
|
||||
insert into staging2.IHTSLL_SLL_Footer_block(dummy_f) values ('dummy');
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set prepared_by=( select column7 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and lower(column3)='prepared by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set reviewed_by=( select column7 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and lower(column3)='reviewed by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set approved_by=( select column7 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and lower(column3)='approved by' )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set comments=( select column3 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=5 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set rev1=( select column3 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set rev2=( select column9 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set rev3=( select column18 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=6 )
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set replaces=( select column19 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set revision_no=( select column19 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set prepared_date=( select column16 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=1)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set reviewed_date=( select column16 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=2)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block a
|
||||
set approved_date=( select column16 from staging2.stg_process_table_IHTSLL_SLL b
|
||||
where b.block_tag='IHTSLL_SLL_Footer'
|
||||
and block_row_number=3)
|
||||
where dummy_F='dummy';
|
||||
|
||||
update staging2.IHTSLL_SLL_Footer_block set model=__model;
|
||||
execute 'update staging2.IHTSLL_SLL_Footer_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTSLL_SLL_Footer_block');
|
||||
perform fw_core.fn_insert_db_error ( __client_id, __function_id, 1001, 'Compegence', __file_syspk ,__file_mnemonic,__file_sheet_mnemonic ,null,'stg2', 'fn_IHTSLL_SLL_block', err_state, err_msg, err_detail, err_hint, err_context,'success');
|
||||
|
||||
end
|
||||
$function$
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
drop function if exists staging2.fn_PTO_GVG_TRX;
|
||||
CREATE OR REPLACE FUNCTION staging2.fn_PTO_GVG_TRX(p_client_id int,p_function_id int, p_file_mnemonic text,
|
||||
p_file_sheet_mnemonic text, p_file_syspk int)
|
||||
RETURNS text AS $$
|
||||
declare __make text;
|
||||
declare __model text;
|
||||
declare __test_instance_id int;
|
||||
declare __test_instance_tractor_id int;
|
||||
declare __client_id int :=p_client_id;
|
||||
declare __function_id int :=p_function_id;
|
||||
declare __file_mnemonic text :=p_file_mnemonic;
|
||||
declare __file_sheet_mnemonic text :=p_file_sheet_mnemonic;
|
||||
declare __file_syspk int :=p_file_syspk;
|
||||
declare err_state text;
|
||||
declare err_msg text;
|
||||
declare err_detail text;
|
||||
declare err_hint text;
|
||||
declare err_context text;
|
||||
declare _error int;
|
||||
begin
|
||||
|
||||
SET search_path TO staging2;
|
||||
|
||||
/************************************************************
|
||||
Function Name:fn_PTOBEN_GVG_TRX
|
||||
Function Desc: This function populates data into ODS blocks
|
||||
File Format: PTOBEN
|
||||
Sheet Format: PTOBEN_GVG
|
||||
Creation Date: April 27 2021
|
||||
Updation Date:
|
||||
Author: compegence team
|
||||
Function Call: select staging2.fn_PTO_GVG_TRX(907)
|
||||
***************************************************************/
|
||||
select tractor_model into __model from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
select tractor_make into __make from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
insert into transactional.test_instance
|
||||
(
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic ,
|
||||
tractor_make,
|
||||
tractor_model
|
||||
)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
file_mnemonic,
|
||||
case when __file_sheet_mnemonic = 'PTOBEN_GVG' then 'PTOBEN_GVG'
|
||||
else 'PTOSTD_GVG'
|
||||
end,
|
||||
make,
|
||||
model
|
||||
from staging2.ptoben_prf_tractor_specs_block where trx_record=1;
|
||||
|
||||
|
||||
insert into transactional.PTO_Perf_Governing_Graph
|
||||
(client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
tractor_model,
|
||||
tractor_make,
|
||||
test_condition,
|
||||
test_type,
|
||||
engine_speed_rpm,
|
||||
torque_kg_m,
|
||||
power_hp,
|
||||
sfc_gm_per_hp_hr,
|
||||
fuelling_mm3_per_stroke_per_cyl,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic)
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
model,
|
||||
make,
|
||||
test_condition ,
|
||||
c1,
|
||||
c2::numeric,
|
||||
c3::numeric,
|
||||
c4::numeric,
|
||||
c5::numeric,
|
||||
c6::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_record=1
|
||||
union
|
||||
select
|
||||
client_id,
|
||||
function_id,
|
||||
file_syspk,
|
||||
model,
|
||||
make,
|
||||
test_condition ,
|
||||
c7_1,
|
||||
c7::numeric,
|
||||
c8::numeric,
|
||||
c9::numeric,
|
||||
c10::numeric,
|
||||
c11::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_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,
|
||||
test_condition ,
|
||||
c12_1,
|
||||
c12::numeric,
|
||||
c13::numeric,
|
||||
c14::numeric,
|
||||
c15::numeric,
|
||||
c16::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_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,
|
||||
test_condition ,
|
||||
c17_1,
|
||||
c17::numeric,
|
||||
c18::numeric,
|
||||
c19::numeric,
|
||||
c20::numeric,
|
||||
c21::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_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,
|
||||
test_condition ,
|
||||
c22_1,
|
||||
c22::numeric,
|
||||
c23::numeric,
|
||||
c24::numeric,
|
||||
c25::numeric,
|
||||
c26::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_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,
|
||||
test_condition ,
|
||||
c27_1,
|
||||
c27::numeric,
|
||||
c28::numeric,
|
||||
c29::numeric,
|
||||
c30::numeric,
|
||||
c31::numeric,
|
||||
file_mnemonic,
|
||||
file_sheet_mnemonic
|
||||
from staging2.PTOBEN_GVG_performance_governing_trails_block
|
||||
where trx_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,
|
||||
test_condition ,
|
||||
c32_1,
|
||||
c32::numeric,
|
||||
c33::numeric,
|
||||
c34::numeric,
|
||||
c35::numeric,
|
||||
c36::numeric,
|
||||
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);
|
||||
|
||||
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;
|
||||
update transactional.PTO_Perf_Governing_Graph set test_mode = 'Eco Mode' where file_sheet_mnemonic = 'PTOBEN_GVGE' and file_syspk = __file_syspk;
|
||||
update transactional.PTO_Perf_Governing_Graph set test_mode = 'Standard Mode' where file_sheet_mnemonic = 'PTOSTD_GVG' and file_syspk = __file_syspk;
|
||||
|
||||
|
||||
select syspk into __test_instance_id from transactional.test_instance where file_syspk =__file_syspk;
|
||||
select syspk into __test_instance_tractor_id from transactional.test_instance_tractor_info where file_syspk =__file_syspk;
|
||||
|
||||
|
||||
update transactional.PTO_Perf_Governing_Graph
|
||||
set test_instance_id=__test_instance_id,
|
||||
tractor_model =__model,
|
||||
tractor_make=__make,
|
||||
test_instance_tractor_id = __test_instance_tractor_id
|
||||
where file_syspk=__file_syspk;
|
||||
|
||||
update transactional.test_instance
|
||||
set test_tractor_id = __test_instance_tractor_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')
|
||||
where file_syspk = __file_syspk;
|
||||
|
||||
UPDATE transactional.pto_perf_governing_graph a set test_mode = CASE WHEN a.test_condition like '%Normal%' THEN 'Normal'
|
||||
WHEN a.test_condition like '%Eco%' THEN 'Eco'
|
||||
WHEN a.test_condition like '%Boost%' THEN 'Boost'
|
||||
WHEN a.test_condition like '%Standard%' THEN 'Standard'
|
||||
ELSE NULL
|
||||
end;
|
||||
|
||||
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;
|
||||
|
||||
EXCEPTION when OTHERS then
|
||||
|
||||
GET STACKED DIAGNOSTICS
|
||||
err_state = returned_sqlstate,
|
||||
err_msg = message_text,
|
||||
err_detail = pg_exception_detail,
|
||||
err_hint = pg_exception_hint,
|
||||
err_context = pg_exception_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,'error');
|
||||
return err_context;
|
||||
end
|
||||
$$ LANGUAGE plpgsql;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user