sql
This commit is contained in:
@@ -41,8 +41,8 @@ truncate table staging2.stg_specific_table_BUDNI_PTO;
|
||||
truncate table staging2.stg_process_table_BUDNI_PTO;
|
||||
truncate table staging2.BUDNI_PTO_Spec_H1_Block;
|
||||
truncate table staging2.BUDNI_PTO_Perf_Report_block;
|
||||
truncate table staging2.BUDNI_PTO_MMTKeyword1_Block;
|
||||
truncate table staging2.BUDNI_PTO_MMTKeyword2_Block;
|
||||
truncate table staging2.BUDNI_PTO_Parameter1_Block;
|
||||
truncate table staging2.BUDNI_PTO_Parameter2_Block;
|
||||
truncate table staging2.BUDNI_PTO_Summary_Block;
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ execute 'insert into staging2.stg_process_table_budni_pto
|
||||
select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag as block_tag
|
||||
from staging2.stg_specific_table_budni_pto a
|
||||
join transactional.source_config b
|
||||
on a.row_number >row_number_start
|
||||
on a.row_number >=row_number_start
|
||||
and (a.row_number< row_read_end or row_read_end is null)
|
||||
and f1_modified=''PTO Performance Report''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
@@ -136,7 +136,7 @@ select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag
|
||||
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=''MMTKeyword1''
|
||||
and f1_modified=''Parameter1''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_budni_pto
|
||||
@@ -144,7 +144,7 @@ select a.* , RANK () OVER ( ORDER BY row_number) as block_row_number,b.block_tag
|
||||
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=''MMTKeyword2''
|
||||
and f1_modified=''Parameter2''
|
||||
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
|
||||
|
||||
execute 'insert into staging2.stg_process_table_budni_pto
|
||||
@@ -276,56 +276,56 @@ file_sheet_mnemonic='''||p_file_sheet_mnemonic||''',
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_PTO_Perf_Report_block');
|
||||
|
||||
|
||||
/* blocks data loading - BUDNI_PTO_MMTKeyword1_block */
|
||||
/* blocks data loading - BUDNI_PTO_Parameter1_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'BUDNI_PTO_MMTKeyword1_block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='BUDNI_PTO_MMTKeyword1_block';
|
||||
'BUDNI_PTO_Parameter1_block',__file_mnemonic,__file_sheet_mnemonic,3);
|
||||
err_block:='BUDNI_PTO_Parameter1_block';
|
||||
|
||||
insert into staging2.BUDNI_PTO_MMTKeyword1_block
|
||||
insert into staging2.BUDNI_PTO_Parameter1_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_budni_pto
|
||||
where block_tag='BUDNI_PTO_MMTKeyword1';
|
||||
where block_tag='BUDNI_PTO_Parameter1';
|
||||
|
||||
|
||||
update staging2.BUDNI_PTO_MMTKeyword1_block set trx_record=0 where block_row_number in (1,2);
|
||||
update staging2.BUDNI_PTO_Parameter1_block set trx_record=0 where block_row_number in (1,2);
|
||||
|
||||
update staging2.BUDNI_PTO_MMTKeyword1_block set make=__make,model=__model;
|
||||
execute 'update staging2.BUDNI_PTO_MMTKeyword1_block set
|
||||
update staging2.BUDNI_PTO_Parameter1_block set make=__make,model=__model;
|
||||
execute 'update staging2.BUDNI_PTO_Parameter1_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||''',
|
||||
file_syspk='||p_file_syspk||'';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_PTO_MMTKeyword1_block');
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_PTO_Parameter1_block');
|
||||
|
||||
/* blocks data loading - BUDNI_PTO_MMTKeyword2_block */
|
||||
/* blocks data loading - BUDNI_PTO_Parameter2_block */
|
||||
|
||||
perform fw_core.fn_jobctl_block_begin(__client_id,__function_id,__file_syspk,
|
||||
'BUDNI_PTO_MMTKeyword2_block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='BUDNI_PTO_MMTKeyword2_block';
|
||||
'BUDNI_PTO_Parameter2_block',__file_mnemonic,__file_sheet_mnemonic,4);
|
||||
err_block:='BUDNI_PTO_Parameter2_block';
|
||||
|
||||
insert into staging2.BUDNI_PTO_MMTKeyword2_block
|
||||
insert into staging2.BUDNI_PTO_Parameter2_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_budni_pto
|
||||
where block_tag='BUDNI_PTO_MMTKeyword2';
|
||||
where block_tag='BUDNI_PTO_Parameter2';
|
||||
|
||||
|
||||
update staging2.BUDNI_PTO_MMTKeyword2_block set trx_record=0 where block_row_number in (1,2);
|
||||
update staging2.BUDNI_PTO_Parameter2_block set trx_record=0 where block_row_number in (1,2);
|
||||
|
||||
|
||||
update staging2.BUDNI_PTO_MMTKeyword2_block set make=__make,model=__model;
|
||||
execute 'update staging2.BUDNI_PTO_MMTKeyword2_block set
|
||||
update staging2.BUDNI_PTO_Parameter2_block set make=__make,model=__model;
|
||||
execute 'update staging2.BUDNI_PTO_Parameter2_block set
|
||||
client_id='||p_client_id||',
|
||||
function_id='||p_function_id||',
|
||||
file_mnemonic='''||p_file_mnemonic||''',
|
||||
file_sheet_mnemonic='''||p_file_sheet_mnemonic||''',
|
||||
file_syspk='||p_file_syspk||'';
|
||||
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_PTO_MMTKeyword2_block');
|
||||
perform fw_core.fn_jobctl_block_end(__file_syspk,'BUDNI_PTO_Parameter2_block');
|
||||
|
||||
/* blocks data loading -BUDNI_PTO_Summary_Block */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user