sql
This commit is contained in:
@@ -225,11 +225,11 @@ perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
err_block:='IHTBTD_BTD_H1_BLOCK';
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select a.column3,column5 from staging2.stg_process_table_IHTBTD_BTD a where block_tag='IHTBTD_BTD_H1'
|
||||
and block_row_number <=9;
|
||||
and block_row_number <=11;
|
||||
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select a.column7,column9 from staging2.stg_process_table_IHTBTD_BTD a where block_tag='IHTBTD_BTD_H1'
|
||||
and block_row_number <=9;
|
||||
and block_row_number <=10;
|
||||
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select 'Objective',column11
|
||||
@@ -246,7 +246,7 @@ and block_tag='IHTBTD_BTD_H1'
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select 'Acceptance criteria',column8
|
||||
from staging2.stg_process_table_IHTBTD_BTD a
|
||||
where block_tag='IHTBTD_BTD_H1' and block_row_number=11;
|
||||
where block_tag='IHTBTD_BTD_H1' and block_row_number=13;
|
||||
|
||||
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
@@ -266,19 +266,19 @@ and block_tag='IHTBTD_BTD_H1'
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select 'Test std',column4
|
||||
from staging2.stg_process_table_IHTBTD_BTD b
|
||||
where block_row_number=11
|
||||
where block_row_number=13
|
||||
and block_tag='IHTBTD_BTD_H1';
|
||||
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select 'Test std Id',column3
|
||||
from staging2.stg_process_table_IHTBTD_BTD b
|
||||
where block_row_number=11
|
||||
where block_row_number=13
|
||||
and block_tag='IHTBTD_BTD_H1';
|
||||
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select 'Test Standard ref',split_part(column3,':',2)
|
||||
from staging2.stg_process_table_IHTBTD_BTD b
|
||||
where block_row_number=10
|
||||
where block_row_number=12
|
||||
and block_tag='IHTBTD_BTD_H1';
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ and block_tag='IHTBTD_BTD_Weight_Tyre'
|
||||
insert into staging2.IHTBTD_BTD_H1_INT (c1,c2)
|
||||
select 'Test Purpose',column8
|
||||
from staging2.stg_process_table_IHTBTD_BTD b
|
||||
where block_row_number=12
|
||||
where block_row_number=14
|
||||
and block_tag='IHTBTD_BTD_H1';
|
||||
|
||||
update staging2.IHTBTD_BTD_H1_Int set model=__model;
|
||||
@@ -310,6 +310,8 @@ file_syspk='||p_file_syspk||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
|
||||
|
||||
insert into staging2.IHTBTD_BTD_H1_Block
|
||||
(
|
||||
dummy_f,
|
||||
@@ -317,6 +319,8 @@ Test_Request_no,
|
||||
Sample_Receipt_Date,
|
||||
Test_report_No,
|
||||
Tractor_Model,
|
||||
tractor_power_hp,
|
||||
variant,
|
||||
Generation,
|
||||
Customer_Name,
|
||||
Test_Engineer,
|
||||
@@ -326,18 +330,18 @@ No_of_Sample,
|
||||
Test_Start_Date,
|
||||
Test_End_Date,
|
||||
Tractor_Sr_No,
|
||||
drive,
|
||||
platform,
|
||||
Test_Standard_Refer,
|
||||
Domestic_Export,
|
||||
Operator_Name,
|
||||
Project_Group,
|
||||
Platform,
|
||||
Objective,
|
||||
Acceptance_Criteria,
|
||||
condition,
|
||||
Test_Standard,
|
||||
Test_Standard_id,
|
||||
Test_Standard_ref,
|
||||
Remarks,
|
||||
Observations,
|
||||
Test_Purpose
|
||||
)
|
||||
@@ -347,10 +351,10 @@ FROM crosstab(
|
||||
, row_number() OVER ()
|
||||
, unnest(ARRAY[c2::text]) AS val
|
||||
FROM staging2.IHTBTD_BTD_H1_INT
|
||||
ORDER BY generate_series(1,15),2'
|
||||
ORDER BY generate_series(1,15),syspk,2'
|
||||
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,
|
||||
a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,
|
||||
a_18 text,a_19 text,a_20 text,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text);
|
||||
a_18 text,a_19 text,a_20 text,a_21 text,a_22 text,a_23 text,a_24 text,a_25 text,a_26 text,a_27 text,a_28 text,a_29 text);
|
||||
|
||||
|
||||
delete from staging2.IHTBTD_BTD_H1_Block where dummy_f is null ;
|
||||
|
||||
Reference in New Issue
Block a user