sql
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
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
|
||||
@@ -238,6 +239,8 @@ Test_Request_no,
|
||||
Sample_Receipt_Date,
|
||||
Test_report_No,
|
||||
Tractor_Model,
|
||||
tractor_power_hp,
|
||||
variant,
|
||||
Generation,
|
||||
Customer_Name,
|
||||
Test_Engineer,
|
||||
@@ -246,6 +249,8 @@ No_of_Sample,
|
||||
Test_Start_Date,
|
||||
Test_End_Date,
|
||||
Tractor_Sr_No,
|
||||
drive,
|
||||
platform,
|
||||
Test_Location,
|
||||
Operator_Name,
|
||||
Project_Group,
|
||||
@@ -264,32 +269,9 @@ FROM crosstab(
|
||||
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_19 text,a_20 text,a_21 text,a_22 text,a_23 text,a_24 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
|
||||
|
||||
Reference in New Issue
Block a user