Вы находитесь на странице: 1из 23

When MATCHED

select otinsm_key
,otinsm_source_system_id
,otinsm_source_id
,otinsm_otcat_key
,otinsm_reference
,otinsm_external_ref
,otinsm_otinsmtp_key
,otinsm_maturity_otcls_key
,otinsm_stipulate_otcls_key
,otinsm_otinsmch_key
,otinsm_chtp_key
,otinsm_out_chtp_key
,otinsm_master_source_id
,otinsm_master_otcat_key
,otinsm_otst_key
,otinsm_sett_otcls_key
,otinsm_gldoc_key
,otinsm_document_number
,otinsm_document_date
,otinsm_acctrn_id
,otinsm_rest_acctrn_id
,otinsm_otfeetp_key
,otinsm_payer_name
,otinsm_payer_iban
,otinsm_payer_acc_key
,otinsm_payer_acc_acctp_key
,otinsm_pay_org_key
,otinsm_payer_comp_reg_code
,otinsm_payer_address
,otinsm_payer_bnk_key
,otinsm_payer_pt_key
,otinsm_payer_ptinst_key
,otinsm_payer_bnk_pt_key
,otinsm_payer_fee_amount
,otinsm_ben_name
,otinsm_ben_iban
,otinsm_ben_acc_key
,otinsm_ben_acc_acctp_key
,otinsm_ben_comp_reg_code
,otinsm_ben_address
,otinsm_ben_bnk_key
,otinsm_ben_pt_key
,otinsm_ben_ptinst_key
,otinsm_ben_bnk_pt_key
,otinsm_ben_fee_amount
,otinsm_ben_cntry_key
,otinsm_date
,otinsm_issue_date
,otinsm_due_date
,otinsm_clearing_date
,otinsm_transaction_date
,otinsm_start_date
,otinsm_end_date
,otinsm_presentation_date
,otinsm_settlement_date
,otinsm_init_org_key
,otinsm_receiver_org_key
,otinsm_otagr_key
,otinsm_otma_key
,otinsm_otpaymeth_key
,otinsm_otrejrs_key
,otinsm_rejection_reason_desc
,otinsm_source_desc
,otinsm_error_msg
,otinsm_days
,otinsm_amount_fx
,otinsm_amount_fc
,otinsm_accepted_amount_fc
,otinsm_curr_key
,otinsm_currate_date
,otinsm_shipping_fee
,otinsm_emergency_fee
,otinsm_external_bank_fee
,otinsm_cancel_fee
,otinsm_collection_fee
,otinsm_series
,otinsm_number
,otinsm_issue_location
,otinsm_payment_location
,otinsm_operation_flag
,otinsm_issued_flag
,otinsm_template_flag
,otinsm_returned_flag
,otinsm_book_flag
,otinsm_booking_date
,otinsm_ottrntp_key
,otinsm_filetp_key
,otinsm_acctrntp_key
,otinsm_status_flag
,otinsm_rejection_date
,otinsm_insert_process_key
,otinsm_inserted_datetime
,otinsm_inserted_effect_date
,otinsm_update_process_key
,otinsm_updated_datetime
,otinsm_updated_effect_date
,otinsm_deleted_flag
,otinsm_ben_country_name
,otinsm_payer_cntry_key
,otinsm_payer_country_name
,otinsm_cash_flag
,otinsm_file_source_id
,otinsm_file_header_desc
,otinsm_priority_flag
,otinsm_msg_type
,otinsm_sablon1
,otinsm_sablon2
,otinsm_sablon3
,otinsm_sablon4
, -- A.Nicu CR 4994
otcat_key
,otcat_source_id
from stg_owner.stm_ot_instruments soti
,dwh_owner.dwh_ot_categories
where otcat_key = otinsm_otcat_key
and otcat_source_code = 'IDB_NEW') oti
where soti.otinsm_acctrn_id = oti.otinsm_acctrn_id) src
on ( trg.otinsm_source_id = src.otinsm_source_id
and trg.otinsm_otcat_key = src.otinsm_otcat_key
and trg.otinsm_otcat_key = src.otcat_key)
when matched then
update set trg.otinsm_chtp_key = src.otinsm_chtp_key
,trg.otinsm_out_chtp_key = src.otinsm_out_chtp_key
,trg.otinsm_otfeetp_key = src.otinsm_otfeetp_key
,trg.otinsm_update_process_key = p_process_key
,trg.otinsm_updated_datetime = sysdate
delete
where src.otcat_source_code = 'ICRED'
when not matched then
insert
(
otinsm_key
,otinsm_source_system_id
,otinsm_source_id
,otinsm_otcat_key
,otinsm_reference
,otinsm_external_ref
,otinsm_otinsmtp_key
,otinsm_maturity_otcls_key
,otinsm_stipulate_otcls_key
,otinsm_otinsmch_key
,otinsm_chtp_key
,otinsm_out_chtp_key
,otinsm_master_source_id
,otinsm_master_otcat_key
,otinsm_otst_key
,otinsm_sett_otcls_key
,otinsm_gldoc_key
,otinsm_document_number
,otinsm_document_date
,otinsm_acctrn_id
,otinsm_rest_acctrn_id
,otinsm_otfeetp_key
,otinsm_payer_name
,otinsm_payer_iban
,otinsm_payer_acc_key
,otinsm_payer_acc_acctp_key
,otinsm_pay_org_key
,otinsm_payer_comp_reg_code
,otinsm_payer_address
,otinsm_payer_bnk_key
,otinsm_payer_pt_key
,otinsm_payer_ptinst_key
,otinsm_payer_bnk_pt_key
,otinsm_payer_fee_amount
,otinsm_ben_name
,otinsm_ben_iban
,otinsm_ben_acc_key
,otinsm_ben_acc_acctp_key
,otinsm_ben_comp_reg_code
,otinsm_ben_address
,otinsm_ben_bnk_key
,otinsm_ben_pt_key
,otinsm_ben_ptinst_key
,otinsm_ben_bnk_pt_key
,otinsm_ben_fee_amount
,otinsm_ben_cntry_key
,otinsm_date
,otinsm_issue_date
,otinsm_due_date
,otinsm_clearing_date
,otinsm_transaction_date
,otinsm_start_date
,otinsm_end_date
,otinsm_presentation_date
,otinsm_settlement_date
,otinsm_init_org_key
,otinsm_receiver_org_key
,otinsm_otagr_key
,otinsm_otma_key
,otinsm_otpaymeth_key
,otinsm_otrejrs_key
,otinsm_rejection_reason_desc
,otinsm_source_desc
,otinsm_error_msg
,otinsm_days
,otinsm_amount_fx
,otinsm_amount_fc
,otinsm_accepted_amount_fc
,otinsm_curr_key
,otinsm_currate_date
,otinsm_shipping_fee
,otinsm_emergency_fee
,otinsm_external_bank_fee
,otinsm_cancel_fee
,otinsm_collection_fee
,otinsm_series
,otinsm_number
,otinsm_issue_location
,otinsm_payment_location
,otinsm_operation_flag
,otinsm_issued_flag
,otinsm_template_flag
,otinsm_returned_flag
,otinsm_book_flag
,otinsm_booking_date
,otinsm_ottrntp_key
,otinsm_filetp_key
,otinsm_acctrntp_key
,otinsm_status_flag
,otinsm_rejection_date
,otinsm_insert_process_key
,otinsm_inserted_datetime
,otinsm_inserted_effect_date
,otinsm_update_process_key
,otinsm_updated_datetime
,otinsm_updated_effect_date
,otinsm_deleted_flag
,otinsm_change_type
,otinsm_prev_effect_date
,otinsm_ben_country_name
,otinsm_payer_cntry_key
,otinsm_payer_country_name
,otinsm_cash_flag
,otinsm_file_source_id
,otinsm_file_header_desc
,otinsm_priority_flag
,otinsm_msg_type
,otinsm_sablon1
,otinsm_sablon2
,otinsm_sablon3
,otinsm_sablon4 -- A.Nicu CR 4994
)
values
(
src.otinsm_key
,src.otinsm_source_system_id
,src.otinsm_source_id
,src.otinsm_otcat_key
,src.otinsm_reference
,src.otinsm_external_ref
,src.otinsm_otinsmtp_key
,src.otinsm_maturity_otcls_key
,src.otinsm_stipulate_otcls_key
,src.otinsm_otinsmch_key
,src.otinsm_chtp_key
,src.otinsm_out_chtp_key
,src.otinsm_master_source_id
,src.otinsm_master_otcat_key
,src.otinsm_otst_key
,src.otinsm_sett_otcls_key
,src.otinsm_gldoc_key
,src.otinsm_document_number
,src.otinsm_document_date
,src.otinsm_acctrn_id
,src.otinsm_rest_acctrn_id
,src.otinsm_otfeetp_key
,src.otinsm_payer_name
,src.otinsm_payer_iban
,src.otinsm_payer_acc_key
,src.otinsm_payer_acc_acctp_key
,src.otinsm_pay_org_key
,src.otinsm_payer_comp_reg_code
,src.otinsm_payer_address
,src.otinsm_payer_bnk_key
,src.otinsm_payer_pt_key
,src.otinsm_payer_ptinst_key
,src.otinsm_payer_bnk_pt_key
,src.otinsm_payer_fee_amount
,src.otinsm_ben_name
,src.otinsm_ben_iban
,src.otinsm_ben_acc_key
,src.otinsm_ben_acc_acctp_key
,src.otinsm_ben_comp_reg_code
,src.otinsm_ben_address
,src.otinsm_ben_bnk_key
,src.otinsm_ben_pt_key
,src.otinsm_ben_ptinst_key
,src.otinsm_ben_bnk_pt_key
,src.otinsm_ben_fee_amount
,src.otinsm_ben_cntry_key
,src.otinsm_date
,src.otinsm_issue_date
,src.otinsm_due_date
,src.otinsm_clearing_date
,src.otinsm_transaction_date
,src.otinsm_start_date
,src.otinsm_end_date
,src.otinsm_presentation_date
,src.otinsm_settlement_date
,src.otinsm_init_org_key
,src.otinsm_receiver_org_key
,src.otinsm_otagr_key
,src.otinsm_otma_key
,src.otinsm_otpaymeth_key
,src.otinsm_otrejrs_key
,src.otinsm_rejection_reason_desc
,src.otinsm_source_desc
,src.otinsm_error_msg
,src.otinsm_days
,src.otinsm_amount_fx
,src.otinsm_amount_fc
,src.otinsm_accepted_amount_fc
,src.otinsm_curr_key
,src.otinsm_currate_date
,src.otinsm_shipping_fee
,src.otinsm_emergency_fee
,src.otinsm_external_bank_fee
,src.otinsm_cancel_fee
,src.otinsm_collection_fee
,src.otinsm_series
,src.otinsm_number
,src.otinsm_issue_location
,src.otinsm_payment_location
,src.otinsm_operation_flag
,src.otinsm_issued_flag
,src.otinsm_template_flag
,src.otinsm_returned_flag
,src.otinsm_book_flag
,src.otinsm_booking_date
,src.otinsm_ottrntp_key
,src.otinsm_filetp_key
,src.otinsm_acctrntp_key
,src.otinsm_status_flag
,src.otinsm_rejection_date
,src.otinsm_insert_process_key
,src.otinsm_inserted_datetime
,src.otinsm_inserted_effect_date
,p_process_key
,sysdate
,p_effective_date
,src.otinsm_deleted_flag
,'X'
,date '1000-01-01'
,src.otinsm_ben_country_name
,src.otinsm_payer_cntry_key
,src.otinsm_payer_country_name
,src.otinsm_cash_flag
,src.otinsm_file_source_id
,src.otinsm_file_header_desc
,src.otinsm_priority_flag
,src.otinsm_msg_type
,src.otinsm_sablon1
,src.otinsm_sablon2
,src.otinsm_sablon3
,src.otinsm_sablon4 -- A.Nicu CR 4994
);

RN CNT

select *
from (select count(1)
over
(
partition by pta_action_id
,pta_next_event_run_date
,pta_diary
,inserted_effective_date
)
cnt_rec
,src.*
from brcc_support_l3.int_dm_party_actions src)
where 1 = 1
and cnt_rec > 1
and 1 = 1
order by pta_action_id
,pta_next_event_run_date
,pta_diary
,inserted_effective_date;

DELETE 
--select *
FROM int_owner.int_dl_do_bpm_xml
WHERE inserted_effective_date = DATE '2019­12­14'
   AND rowid IN (SELECT row_id
                   FROM (SELECT rowid AS row_id
                               ,row_number()
                                    OVER
                                    (
                                        PARTITION BY 
doa_bpm_process_instance_id
                                                    ,doas_code
                                                    ,doas_start_time
                                                    ,inserted_effective_date
                                        ORDER BY 1
                                    )
                                    rn
                               ,i.*
                           FROM int_owner.int_dl_do_bpm_xml i
                          WHERE inserted_effective_date = DATE '2019­12­14')
                  WHERE rn <> 1);

TABLE NAME

SELECT *
FROM lin_owner.lng_table_relations_v
WHERE target_table_name like '’
==============================================
SELECT *
FROM all_tab_columns
WHERE column_name =

COntext
DECLARE
P_DATE DATE;
P_ATTRIBUTE_1 VARCHAR2 (32767);
PRMRESULTSET SYS_REFCURSOR;
BEGIN
P_DATE := TO_DATE ('30/11/2019', 'dd/mm/yyyy');
P_ATTRIBUTE_1 := NULL;
-- PRMRESULTSET := NULL; Modify the code to initialize this parameter

ETL_OWNER.ETL_NP_UTIL_PKG.COGNOS_SET_CORRECTION_CONTEXT
(P_DATE,
P_ATTRIBUTE_1,
PRMRESULTSET);
COMMIT;
END;
/
=============================================
WITH IN
--count 552

UPDATE cdf_owner.dwh_risk_product_facts_def_cv ff
SET NBR_DPD_CODE =
(SELECT NBR_DPD_CODE
FROM brcc_support_l2.crc_servciul_datoriei_201911 dd
WHERE dd.LOAN_ID = ff.LOAN_ID),
UPDATE_PROCESS_KEY = -15031,
UPDATED_DATETIME = SYSDATE,
CORR_UPDATED_BY = 'SIT_PI_15031_DW_INC_U_12838536_CRC',
CORR_MOTIVE = 'corectare NBR_DPD_CODE dupa specs business'
WHERE reporting_date = TO_DATE ('30/11/2019', 'dd/mm/yyyy')
AND company_code = 'BCR'
AND dummy_category = 'XNA'
AND threshold_flag = 'Y'
AND (LOAN_ID) IN (SELECT LOAN_ID
FROM brcc_support_l2.crc_servciul_datoriei_201911);
COntext
BEGIN
ETL_OWNER.ETL_NP_UTIL_PKG.SET_any_CONTEXT ('IFRS_BAL_VIEW_PARAM',
'ACCOUNTING_DATE_MIN',
'31-may-2019');
ETL_OWNER.ETL_NP_UTIL_PKG.SET_any_CONTEXT ('IFRS_BAL_VIEW_PARAM',
'ACCOUNTING_PERIOD',
'20190501');
ETL_OWNER.ETL_NP_UTIL_PKG.SET_any_CONTEXT ('IFRS_BAL_VIEW_PARAM',
'RECALCULATION_DATE',
'31-may-2019');
COMMIT;
END;
=================================================================
MERGE

merge /*+ APPEND USE_HASH(S T) FULL(S) FULL(T) PARALLEL(T, 16) */ into


CDF_OWNER.DWH_FEE_FACTS_CF T using (
select --+ USE_HASH(DEAL FEEFCT) FULL(DEAL) FULL(FEEFCT) PARALLEL(DEAL, 16)
distinct -- TTS20191113 = resolve error running
FEEFCT.SOURCE_ROWID,
FEEFCT.FEETRN_TRANSACTION_DATE,
DEAL.DEAL_KEY,
DEAL.DEALSB_SOURCE_ID
from
(select --+ LEADING(FEEFCT) USE_HASH(FEEFCT EXT_III ORG) FULL(FEEFCT) FULL(EXT_III)
FULL(ORG) PARALLEL(FEEFCT, 16)
FEEFCT.ROWID as SOURCE_ROWID,
FEEFCT.FEETRN_ACCOUNTING_DATE,
FEEFCT.FEETRN_TRANSACTION_DATE,
FEEFCT.FEETRN_COD_LEVEL_III,
ORG.ORG_GLORG_KEY,
decode(FEEFCT.FEETRN_DEBTOR_PT_KEY, -1, FEEFCT.FEETRN_PT_KEY,
FEEFCT.FEETRN_DEBTOR_PT_KEY) as PT_KEY
from
CDF_OWNER.DWH_FEE_FACTS_CF FEEFCT,
EXT_OWNER.EXT_CODE_LEVEL_III EXT_III,
DWH_OWNER.DWH_ORGANIZATIONS ORG
where
FEEFCT.FEETRN_TRANSACTION_DATE between p_min_transaction_date and p_max_transaction_date
and
FEEFCT.FEETRN_ACCOUNTING_DATE between p_min_accounting_date and p_max_accounting_date and
FEEFCT.DEAL_KEY = -1 and
FEEFCT.GPM_RELEVANT_FLAG = 'Y' and
FEEFCT.FEETRN_SOURCE_SYSTEM_ID = 'SB' and
FEEFCT.FEETRN_DEBTOR_PT_KEY = -1 and
FEEFCT.FEETRN_PT_KEY = v_bank_pt_key and
EXT_III.LOB_STATUS = 'SRV_DEAL_3' and
FEEFCT.FEETRN_ACCOUNTING_DATE between EXT_III.DATE_IN and EXT_III.DATE_OUT and
FEEFCT.FEETRN_COD_LEVEL_III = EXT_III.COD_LEVEL_III and
ORG.ORG_KEY = FEEFCT.ORG_KEY_BOOK
) FEEFCT,
(select --+ FULL(DEAL) PARALLEL(DEAL, 16)
DEAL.*
from
STG_OWNER.STG_DEALS_CF DEAL
where
DEAL.DEAL_PT_KEY = v_bank_pt_key and
DEAL.DEALSB_SOURCE_ID = 'SRV_DEAL_3'
) DEAL
where
p_effective_date between DEAL.DEAL_VALID_FROM_DATE and DEAL.DEAL_VALID_TO_DATE and
FEEFCT.PT_KEY = DEAL.DEAL_PT_KEY and
FEEFCT.FEETRN_COD_LEVEL_III = DEAL.DEAL_FEE_COD_LEVEL_III and
FEEFCT.ORG_GLORG_KEY = DEAL.DEAL_GLORG_BALANCE_KEY
) S on (
T.ROWID = S.SOURCE_ROWID and
T.FEETRN_TRANSACTION_DATE = S.FEETRN_TRANSACTION_DATE
)
when matched then update set
T.DEAL_KEY = S.DEAL_KEY,
--10.01.2017 M.Plavanescu - FEE_RECL_PREREQ - new attribute (backup of DEAL_KEY that could be updated
during monthly GDP process)
T.DAILY_DEAL_KEY = S.DEAL_KEY,
T.DEALSB_SOURCE_ID = S.DEALSB_SOURCE_ID,
T.FEEFCT_UPDATE_PROCESS_KEY = p_process_key,
T.FEEFCT_UPDATED_EFFECT_DATE = p_effective_date,
T.FEEFCT_UPDATED_DATETIME = sysdate;

alter table INT_OWNER.INT_DL_DO_BPM_XML drop constraint DO_BPM_XML_PK;
 
drop index INT_OWNER.DO_BPM_XML_PK;
 ===================================================
FRANA SI INDEXI
 
­­FRANA
update(select * from etl_owner.etl_modules where upper(mod_name) like 
'%DO_INCR_LOAD_DIFF_CHECK%' )set 
MOD_PROCEDURE_NAME=MOD_PROCEDURE_NAME||'_STOP';

CREATE UNIQUE INDEX INT_OWNER.DO_BPM_XML_PK ON INT_OWNER.INT_DL_DO_BPM_XML
(DOA_BPM_PROCESS_INSTANCE_ID, DOAS_CODE, DOAS_START_TIME, 
INSERTED_EFFECTIVE_DATE)
  TABLESPACE INT_INDEX
  PCTFREE    10
  INITRANS   2
  MAXTRANS   255
  STORAGE    (
              BUFFER_POOL      DEFAULT
              FLASH_CACHE      DEFAULT
              CELL_FLASH_CACHE DEFAULT
             )
NOLOGGING
LOCAL (  
  PARTITION PARTITION_20190715
    NOLOGGING
    COMPRESS 
    TABLESPACE INT_INDEX_201907
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          160K
                NEXT             1M
                MAXSIZE          UNLIMITED
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                BUFFER_POOL      DEFAULT
                FLASH_CACHE      DEFAULT
                CELL_FLASH_CACHE DEFAULT
               ),  
  PARTITION PARTITION_20190716
    NOLOGGING
    COMPRESS 
    TABLESPACE INT_INDEX_201907
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          160K
                NEXT             1M
                MAXSIZE          UNLIMITED
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                BUFFER_POOL      DEFAULT
                FLASH_CACHE      DEFAULT
                CELL_FLASH_CACHE DEFAULT
               ),  
PARALLEL ( DEGREE 16 INSTANCES 1 )
COMPRESS 3;
 
ALTER TABLE INT_OWNER.INT_DL_DO_BPM_XML ADD (
  CONSTRAINT DO_BPM_XML_PK
  PRIMARY KEY
  (DOA_BPM_PROCESS_INSTANCE_ID, DOAS_CODE, DOAS_START_TIME, 
INSERTED_EFFECTIVE_DATE)
  USING INDEX LOCAL
  ENABLE VALIDATE);

=================================================================
Procedura si select

procedure update_fee_facts_group (
p_process_key in integer default -1,
p_effective_date in date default trunc(sysdate) - 1,
p_data_type in varchar2 default null
);

procedure stg_lgd_clients_1
(
p_process_key in integer default -1
,p_effective_date in date default trunc(sysdate) - 1
,p_data_type in varchar2 default null
);

CASE -- MC eliminare GREATEST din case


WHEN acc.acc_last_extension_date <> '01-jan-1000'
THEN
round((months_between(acc.acc_maturity_date, acc.acc_last_extension_date)), 0)
ELSE
round((months_between(acc.acc_maturity_date, nvl(acb.acc_open_date, acc.acc_open_date))),
0)
END

SELECT DISTINCT
(CASE WHEN rra.acc_key IS NOT NULL THEN rra.acc_key ELSE accper.acc_key END) AS
acc_key
,(CASE WHEN rra.acc_key IS NOT NULL THEN rra.pt_key ELSE accper.pt_key END) AS
pt_key
,(CASE WHEN rra.acc_key IS NOT NULL THEN 'Y' ELSE 'N' END) AS yn_risk_relevance
FROM (SELECT *
FROM cdf_owner.dwh_risk_relevant_accounts rra
WHERE rra.balance_date = p_effective_date
AND rra.deleted_flag = 'N'
AND rra.risk_relevant_flag = 1) rra
FULL OUTER JOIN
(SELECT *
FROM cdf_owner.cdf_account_periods accper
WHERE accper.period_category = 'ACC_DEFAULT_PERIOD'
AND accper.accper_deleted_flag = 'N'
AND p_effective_date BETWEEN accper.bi_period_start_date AND
last_day(accper.bi_period_end_date)) accper
ON rra.acc_key = accper.acc_key
AND rra.pt_key = accper.pt_key) rra
,(SELECT acc.acc_key, min(liquidation_start_date) AS liquidation_start_date, 'Y' AS
liquidation_legal_actions_flag
FROM cdf_owner.dwh_accounts_dim acc
,cdf_owner.dwh_pt_liquidation_legalact_v liq
WHERE 1 = 1
AND p_effective_date BETWEEN acc.acc_valid_from_date AND acc.acc_valid_to_date
AND acc.acc_deleted_flag = 'N'
AND acc.pt_key = liq.pt_key
AND (acc.acc_key = liq.acc_key
OR liq.acc_key = -1)

EROARE clasica

Procesul LD_MAIN_IFRS_DAILY este in eroare pe mapa PL_TRANSACTIONS_SB.

ORA-20101: ORA-20099: ORA-20099: ORA-12801: error signaled in parallel query server P057
ORA-00001: unique constraint (CDF_OWNER.PLTRAN_PK) violated
ORA-06512: at 'ETL_OWNER.CDF_PL_TRANSACTIONS', line 306
ORA-06512: at 'ETL_OWNER.CDF_PL_TRANSACTIONS', line 563
ORA-06512: at line 5

ORA-06512: at 'ETL_OWNER.ETL_WF_API', line 364


ORA-06512: at 'ETL_OWNER.ETL_WF_API', line 839 [Error Process Error: 3114: Activity
'ETLERROR/DEFAULT_ERROR' is not a process.]

select ACCOUNTING_DATE,
ACC_OTHER_KEY,
DEAL_ACC_KEY,
GLACC_SYNTHETIC_CODE,
GLTRAN_ID,
INSERTED_EFFECTIVE_DATE,
TRAN_SOURCE_SYSTEM_ID , count(*) from (with gltran
as (select /*+ no_merge materialize full(gltran) use_hash(gltran)*/
gltran.gltran_accounting_date
,gltran.gltran_inserted_effect_date
,gltran.gltran_source_system_id
,gltran.gltran_deal_acc_key
,gltran.gltran_acc_key
,gltran.gltran_acc_other_key
,gltran.gltran_deal_ord_pt_key
,gltran.gltran_id
,gltran.gltran_curr_iso_code
,gltran_glacc_group_key
,gltran.lg_acc_key --gsadici, 27112018
,sum(gltran.gltran_amount_fc) as gltran_amount_fc
from dwh_owner.dwh_gl_transactions gltran
where gltran.gltran_inserted_effect_date = to_date('30.04.2019','dd.mm.yyyy')
and gltran.gltran_tipcoa_code = 'BNR'
and gltran.gltran_comp_code = 'BCR'
and gltran.gltran_pl_mvmt_flag = 'N'
group by gltran.gltran_accounting_date
,gltran.gltran_inserted_effect_date
,gltran.gltran_source_system_id
,gltran.gltran_deal_acc_key
,gltran.gltran_acc_key
,gltran.gltran_acc_other_key
,gltran.gltran_deal_ord_pt_key
,gltran.gltran_id
,gltran.gltran_curr_iso_code
,gltran_glacc_group_key
,gltran.lg_acc_key --gsadici, 27112018
)
,dom
as (select /*+no_merge materialize*/
*
from (select /*+no_merge*/
domval_ref1 as synthetic_code
,(case when sum(case when domval_out2 = 'NII' then 1 else 0 end) over (partition by domval_ref1)
> 0 then 'Y' else 'N' end)
nii_relevant_flag
,(case when sum(case when domval_out2 = 'NTR' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
ntr_relevant_flag
,(case when sum(case when domval_out2 = 'OOR' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
oor_relevant_flag
,(case when sum(case when domval_out2 = 'FV' then 1 else 0 end) over (partition by domval_ref1)
> 0 then 'Y' else 'N' end)
fv_relevant_flag
,(case when sum(case when domval_out2 = 'UWC' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
uwc_relevant_flag
,(case
when sum(case when domval_out2 = 'PROV_PL' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y'
else 'N'
end)
prov_relevant_flag
,(case when sum(case when domval_out2 = 'ILI' then 1 else 0 end) over (partition by domval_ref1)
> 0 then 'Y' else 'N' end)
ili_relevant_flag --AD20190107
,(case when sum(case when domval_out2 = 'MGL' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
mgl_relevant_flag
,row_number() over(partition by domval_ref1 order by domval_out2) rn
from (select /*+no_merge full(a) use_hash(a) */
domval_ref1, domval_out2
from ext_owner.ext_domain_values a
where domval_dom_code = 'PL_SYNTHETICS_MAP'
and to_date('30.04.2019','dd.mm.yyyy') between domval_valid_from_date and
domval_valid_to_date
and domval_deleted_flag = 'N') pl_synthetics)
where rn = 1)
select /*+no_merge use_hash(gltran acc glacc gcoa sect_ec_sb glord acc_princ ) */
gltran.gltran_accounting_date as accounting_date
,gltran.gltran_source_system_id as tran_source_system_id
--,gltran.gltran_deal_acc_key as deal_acc_key
,case --gsadici, 27112018
when nvl(acc_princ.acc_acctp_key, -1) = 7 then decode(gltran.lg_acc_key, -1, gltran.gltran_deal_acc_key,
gltran.lg_acc_key)
else gltran.gltran_deal_acc_key
end
as deal_acc_key
,gltran.gltran_acc_key as acc_key
,gltran.gltran_acc_other_key as acc_other_key
,case
when gltran.gltran_deal_ord_pt_key <> -1
then
gltran.gltran_deal_ord_pt_key
when gltran.gltran_deal_ord_pt_key = -1
and other_acc.acc_pt_key <> -1
and other_pt.pt_source_id <> '1'
then
other_acc.acc_pt_key
else
-1
end
as pt_key
,glacc.glacc_synthetic_code as glacc_synthetic_code
,nvl(gcoa.domval_out1, '999999999') as gcoa_code
,gltran.gltran_id as gltran_id
,gltran.gltran_curr_iso_code as curr_iso_code
,gltran.gltran_amount_fc as amount_fc
,nvl(sect_ec_sb.domval_ref2, 'XNA') as economic_sector_code_bnr
,nvl(sect_ec_sb.clsus_code, 'XNA') as economic_sector_code_group
,nvl(acc_princ.acc_account_number, 'XNA') as deal_acc_account_number
,nvl(dom.nii_relevant_flag, 'N') as nii_relevant_flag
,nvl(dom.ntr_relevant_flag, 'N') as ntr_relevant_flag
,nvl(dom.oor_relevant_flag, 'N') as oor_relevant_flag
,nvl(dom.fv_relevant_flag, 'N') as fv_relevant_flag
,nvl(dom.uwc_relevant_flag, 'N') as uwc_relevant_flag
,nvl(dom.prov_relevant_flag, 'N') as prov_relevant_flag
,nvl(dom.mgl_relevant_flag, 'N') as mgl_relevant_flag
,nvl(glord.glord_source_desc, 'XNA') as gltran_source_desc
,-1 insert_process_key
,sysdate inserted_datetime
,gltran.gltran_inserted_effect_date inserted_effective_date
,-1 update_process_key
,sysdate updated_datetime
,to_date('30.04.2019','dd.mm.yyyy') updated_effect_date
,'N' as deleted_flag
--AD20190107
,nvl(dom.ili_relevant_flag, 'N') as ili_relevant_flag
from gltran
join (select /*+no_merge full(acc) use_hash(acc) */
acc_key, acc_glacc_key
from dwh_owner.dwh_accounts_h acc
where to_date('30.04.2019','dd.mm.yyyy') between acc.acc_valid_from_date and acc.acc_valid_to_date
and acc.acc_deleted_flag = 'N') acc
on (gltran.gltran_acc_key = acc.acc_key)
left join (select /*+no_merge full(acc) use_hash(acc) */
acc_key, acc_glacc_key, acc_pt_key
from dwh_owner.dwh_accounts_h acc
where to_date('30.04.2019','dd.mm.yyyy') between acc.acc_valid_from_date and
acc.acc_valid_to_date
and acc.acc_deleted_flag = 'N'
and acc.acc_acctp_key <> 16) other_acc
on (gltran.gltran_acc_other_key = other_acc.acc_key)
join (select /*+no_merge full(glacc) use_hash(glacc) */
glacc.glacc_synthetic_code, glacc_key
from dwh_owner.dwh_gl_accounts glacc
where glacc.glacc_tipcoa_code = 'BNR'
and glacc.glacc_deleted_flag = 'N'
and (glacc.glacc_synthetic_code like '6%'
or glacc.glacc_synthetic_code like '7%')) glacc
on (acc.acc_glacc_key = glacc.glacc_key)
left join (select /*+no_merge full(pt) use_hash(pt) */
pt_key, pt_source_id
from dwh_owner.dwh_parties_h pt
where to_date('30.04.2019','dd.mm.yyyy') between pt_valid_from_date and pt_valid_to_date
and pt_deleted_flag = 'N') other_pt
on (other_acc.acc_pt_key = other_pt.pt_key)
left join dom on (glacc.glacc_synthetic_code = dom.synthetic_code)
left join (select /*+ no_merge use_hash(clu v)*/
clu.clsus_pt_key
,clu.clsus_comp_key
,v.domval_out1 as clsus_code
,v.domval_ref2
,c.comp_source_code
from (select /*+ no_merge full(clu)*/
clu.clsus_pt_key
,clu.clsus_comp_key
,clu.clsus_clstp_key
,clu.clsus_code
from dwh_owner.dwh_party_classf_usages clu) clu
join (select /*+ no_merge full(clt)*/
clt.clstp_key
from dwh_owner.dwh_classf_types clt
where clt.clstp_source_id = 'PT_SECTOR_ECONOMIC') clt
on (clu.clsus_clstp_key = clt.clstp_key)
join (select /*+ no_merge full(c)*/
c.comp_key, c.comp_source_code
from dwh_owner.dwh_companies c
where c.comp_source_code = 'BCR') c
on (clu.clsus_comp_key = c.comp_key)
join (select /*+ no_merge full(v)*/
v.domval_ref1, v.domval_ref2, v.domval_out1
from ext_owner.economic_sector_gcoa_gdp_v v
where to_date('30.04.2019','dd.mm.yyyy') between v.domval_valid_from_date and
v.domval_valid_to_date) v
on (clu.clsus_code = v.domval_ref1)) sect_ec_sb
on (case
when gltran.gltran_deal_ord_pt_key <> -1
then
gltran.gltran_deal_ord_pt_key
when gltran.gltran_deal_ord_pt_key = -1
and other_acc.acc_pt_key <> -1
and other_pt.pt_source_id <> '1'
then
other_acc.acc_pt_key
else
-1
end = sect_ec_sb.clsus_pt_key)
left join (select glord_id, glord_source_desc, glord_inserted_effect_date
from dwh_owner.dwh_gl_orders
where glord_tipcoa_code = 'BNR'
and glord_comp_code = 'BCR'
and glord_deleted_flag = 'N') glord
on (gltran.gltran_id = glord.glord_id
and gltran.gltran_inserted_effect_date = glord.glord_inserted_effect_date)
left join (select /*+no_merge full(acc) use_hash(acc) */
acc_key
,acc_glacc_key
,acc_account_number
,acc_acctp_key --gsadici, 27112018
from dwh_owner.dwh_accounts_h acc
where to_date('30.04.2019','dd.mm.yyyy') between acc.acc_valid_from_date and
acc.acc_valid_to_date
and acc.acc_deleted_flag = 'N') acc_princ
on (gltran.gltran_deal_acc_key = acc_princ.acc_key)
left join (select /*+no_merge full(a) use_hash(a) */
domval_ref1, domval_ref2, domval_out1
from ext_owner.ext_domain_values a
where domval_dom_code = 'BNR_GCOA_MAP'
and sysdate between domval_valid_from_date and domval_valid_to_date
and domval_deleted_flag = 'N') gcoa
on (glacc.glacc_synthetic_code = gcoa.domval_ref1
and 1 = case when nvl(gcoa.domval_ref2, '%') = '%' then 1 when sect_ec_sb.clsus_code = gcoa.domval_ref2
then 1 else 0 end)
)
group by ACCOUNTING_DATE,
ACC_OTHER_KEY,
DEAL_ACC_KEY,
GLACC_SYNTHETIC_CODE,
GLTRAN_ID,
INSERTED_EFFECTIVE_DATE,
TRAN_SOURCE_SYSTEM_ID
having count(*)>1;

Avem 24 de inregistrari dublate.


select * from (with gltran
as (select /*+ no_merge materialize full(gltran) use_hash(gltran)*/
gltran.gltran_accounting_date
,gltran.gltran_inserted_effect_date
,gltran.gltran_source_system_id
,gltran.gltran_deal_acc_key
,gltran.gltran_acc_key
,gltran.gltran_acc_other_key
,gltran.gltran_deal_ord_pt_key
,gltran.gltran_id
,gltran.gltran_curr_iso_code
,gltran_glacc_group_key
,gltran.lg_acc_key --gsadici, 27112018
,sum(gltran.gltran_amount_fc) as gltran_amount_fc
from dwh_owner.dwh_gl_transactions gltran
where gltran.gltran_inserted_effect_date = to_date('30.04.2019','dd.mm.yyyy')
and gltran.gltran_tipcoa_code = 'BNR'
and gltran.gltran_comp_code = 'BCR'
and gltran.gltran_pl_mvmt_flag = 'N'
group by gltran.gltran_accounting_date
,gltran.gltran_inserted_effect_date
,gltran.gltran_source_system_id
,gltran.gltran_deal_acc_key
,gltran.gltran_acc_key
,gltran.gltran_acc_other_key
,gltran.gltran_deal_ord_pt_key
,gltran.gltran_id
,gltran.gltran_curr_iso_code
,gltran_glacc_group_key
,gltran.lg_acc_key --gsadici, 27112018
)
,dom
as (select /*+no_merge materialize*/
*
from (select /*+no_merge*/
domval_ref1 as synthetic_code
,(case when sum(case when domval_out2 = 'NII' then 1 else 0 end) over (partition by domval_ref1)
> 0 then 'Y' else 'N' end)
nii_relevant_flag
,(case when sum(case when domval_out2 = 'NTR' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
ntr_relevant_flag
,(case when sum(case when domval_out2 = 'OOR' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
oor_relevant_flag
,(case when sum(case when domval_out2 = 'FV' then 1 else 0 end) over (partition by domval_ref1)
> 0 then 'Y' else 'N' end)
fv_relevant_flag
,(case when sum(case when domval_out2 = 'UWC' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
uwc_relevant_flag
,(case
when sum(case when domval_out2 = 'PROV_PL' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y'
else 'N'
end)
prov_relevant_flag
,(case when sum(case when domval_out2 = 'ILI' then 1 else 0 end) over (partition by domval_ref1)
> 0 then 'Y' else 'N' end)
ili_relevant_flag --AD20190107
,(case when sum(case when domval_out2 = 'MGL' then 1 else 0 end) over (partition by
domval_ref1) > 0 then 'Y' else 'N' end)
mgl_relevant_flag
,row_number() over(partition by domval_ref1 order by domval_out2) rn
from (select /*+no_merge full(a) use_hash(a) */
domval_ref1, domval_out2
from ext_owner.ext_domain_values a
where domval_dom_code = 'PL_SYNTHETICS_MAP'
and to_date('30.04.2019','dd.mm.yyyy') between domval_valid_from_date and
domval_valid_to_date
and domval_deleted_flag = 'N') pl_synthetics)
where rn = 1)
select /*+no_merge use_hash(gltran acc glacc gcoa sect_ec_sb glord acc_princ ) */
gltran.gltran_accounting_date as accounting_date
,gltran.gltran_source_system_id as tran_source_system_id
--,gltran.gltran_deal_acc_key as deal_acc_key
,case --gsadici, 27112018
when nvl(acc_princ.acc_acctp_key, -1) = 7 then decode(gltran.lg_acc_key, -1, gltran.gltran_deal_acc_key,
gltran.lg_acc_key)
else gltran.gltran_deal_acc_key
end
as deal_acc_key
,gltran.gltran_acc_key as acc_key
,gltran.gltran_acc_other_key as acc_other_key
,case
when gltran.gltran_deal_ord_pt_key <> -1
then
gltran.gltran_deal_ord_pt_key
when gltran.gltran_deal_ord_pt_key = -1
and other_acc.acc_pt_key <> -1
and other_pt.pt_source_id <> '1'
then
other_acc.acc_pt_key
else
-1
end
as pt_key
,glacc.glacc_synthetic_code as glacc_synthetic_code
,nvl(gcoa.domval_out1, '999999999') as gcoa_code
,gltran.gltran_id as gltran_id
,gltran.gltran_curr_iso_code as curr_iso_code
,gltran.gltran_amount_fc as amount_fc
,nvl(sect_ec_sb.domval_ref2, 'XNA') as economic_sector_code_bnr
,nvl(sect_ec_sb.clsus_code, 'XNA') as economic_sector_code_group
,nvl(acc_princ.acc_account_number, 'XNA') as deal_acc_account_number
,nvl(dom.nii_relevant_flag, 'N') as nii_relevant_flag
,nvl(dom.ntr_relevant_flag, 'N') as ntr_relevant_flag
,nvl(dom.oor_relevant_flag, 'N') as oor_relevant_flag
,nvl(dom.fv_relevant_flag, 'N') as fv_relevant_flag
,nvl(dom.uwc_relevant_flag, 'N') as uwc_relevant_flag
,nvl(dom.prov_relevant_flag, 'N') as prov_relevant_flag
,nvl(dom.mgl_relevant_flag, 'N') as mgl_relevant_flag
,nvl(glord.glord_source_desc, 'XNA') as gltran_source_desc
,-1 insert_process_key
,sysdate inserted_datetime
,gltran.gltran_inserted_effect_date inserted_effective_date
,-1 update_process_key
,sysdate updated_datetime
,to_date('30.04.2019','dd.mm.yyyy') updated_effect_date
,'N' as deleted_flag
--AD20190107
,nvl(dom.ili_relevant_flag, 'N') as ili_relevant_flag
from gltran
join (select /*+no_merge full(acc) use_hash(acc) */
acc_key, acc_glacc_key
from dwh_owner.dwh_accounts_h acc
where to_date('30.04.2019','dd.mm.yyyy') between acc.acc_valid_from_date and acc.acc_valid_to_date
and acc.acc_deleted_flag = 'N') acc
on (gltran.gltran_acc_key = acc.acc_key)
left join (select /*+no_merge full(acc) use_hash(acc) */
acc_key, acc_glacc_key, acc_pt_key
from dwh_owner.dwh_accounts_h acc
where to_date('30.04.2019','dd.mm.yyyy') between acc.acc_valid_from_date and
acc.acc_valid_to_date
and acc.acc_deleted_flag = 'N'
and acc.acc_acctp_key <> 16) other_acc
on (gltran.gltran_acc_other_key = other_acc.acc_key)
join (select /*+no_merge full(glacc) use_hash(glacc) */
glacc.glacc_synthetic_code, glacc_key
from dwh_owner.dwh_gl_accounts glacc
where glacc.glacc_tipcoa_code = 'BNR'
and glacc.glacc_deleted_flag = 'N'
and (glacc.glacc_synthetic_code like '6%'
or glacc.glacc_synthetic_code like '7%')) glacc
on (acc.acc_glacc_key = glacc.glacc_key)
left join (select /*+no_merge full(pt) use_hash(pt) */
pt_key, pt_source_id
from dwh_owner.dwh_parties_h pt
where to_date('30.04.2019','dd.mm.yyyy') between pt_valid_from_date and pt_valid_to_date
and pt_deleted_flag = 'N') other_pt
on (other_acc.acc_pt_key = other_pt.pt_key)
left join dom on (glacc.glacc_synthetic_code = dom.synthetic_code)
left join (select /*+ no_merge use_hash(clu v)*/
clu.clsus_pt_key
,clu.clsus_comp_key
,v.domval_out1 as clsus_code
,v.domval_ref2
,c.comp_source_code
from (select /*+ no_merge full(clu)*/
clu.clsus_pt_key
,clu.clsus_comp_key
,clu.clsus_clstp_key
,clu.clsus_code
from dwh_owner.dwh_party_classf_usages clu) clu
join (select /*+ no_merge full(clt)*/
clt.clstp_key
from dwh_owner.dwh_classf_types clt
where clt.clstp_source_id = 'PT_SECTOR_ECONOMIC') clt
on (clu.clsus_clstp_key = clt.clstp_key)
join (select /*+ no_merge full(c)*/
c.comp_key, c.comp_source_code
from dwh_owner.dwh_companies c
where c.comp_source_code = 'BCR') c
on (clu.clsus_comp_key = c.comp_key)
join (select /*+ no_merge full(v)*/
v.domval_ref1, v.domval_ref2, v.domval_out1
from ext_owner.economic_sector_gcoa_gdp_v v
where to_date('30.04.2019','dd.mm.yyyy') between v.domval_valid_from_date and
v.domval_valid_to_date) v
on (clu.clsus_code = v.domval_ref1)) sect_ec_sb
on (case
when gltran.gltran_deal_ord_pt_key <> -1
then
gltran.gltran_deal_ord_pt_key
when gltran.gltran_deal_ord_pt_key = -1
and other_acc.acc_pt_key <> -1
and other_pt.pt_source_id <> '1'
then
other_acc.acc_pt_key
else
-1
end = sect_ec_sb.clsus_pt_key)
left join (select glord_id, glord_source_desc, glord_inserted_effect_date
from dwh_owner.dwh_gl_orders
where glord_tipcoa_code = 'BNR'
and glord_comp_code = 'BCR'
and glord_deleted_flag = 'N') glord
on (gltran.gltran_id = glord.glord_id
and gltran.gltran_inserted_effect_date = glord.glord_inserted_effect_date)
left join (select /*+no_merge full(acc) use_hash(acc) */
acc_key
,acc_glacc_key
,acc_account_number
,acc_acctp_key --gsadici, 27112018
from dwh_owner.dwh_accounts_h acc
where to_date('30.04.2019','dd.mm.yyyy') between acc.acc_valid_from_date and
acc.acc_valid_to_date
and acc.acc_deleted_flag = 'N') acc_princ
on (gltran.gltran_deal_acc_key = acc_princ.acc_key)
left join (select /*+no_merge full(a) use_hash(a) */
domval_ref1, domval_ref2, domval_out1
from ext_owner.ext_domain_values a
where domval_dom_code = 'BNR_GCOA_MAP'
and sysdate between domval_valid_from_date and domval_valid_to_date
and domval_deleted_flag = 'N') gcoa
on (glacc.glacc_synthetic_code = gcoa.domval_ref1
and 1 = case when nvl(gcoa.domval_ref2, '%') = '%' then 1 when sect_ec_sb.clsus_code = gcoa.domval_ref2
then 1 else 0 end)
)
where ACCOUNTING_DATE=to_date('24.04.2019','dd.mm.yyyy') and
ACC_OTHER_KEY=175341744 and
DEAL_ACC_KEY=-1 and
GLACC_SYNTHETIC_CODE='6111.A31'and
GLTRAN_ID=2019043008182511 and
INSERTED_EFFECTIVE_DATE=to_date('30.04.2019','dd.mm.yyyy') and
TRAN_SOURCE_SYSTEM_ID='SB'

Inregistrarile sunt identice.

Dublurile apar la left join –ul tabela de parametrizari ext_owner.ext_domain_values, fiindca acest sintetic este
parametrizat de doua ori cu acelasi domval_ref1 si domval_ref2.

select * from (select /*+no_merge full(a) use_hash(a) */


domval_ref1, domval_ref2, domval_out1
from ext_owner.ext_domain_values a
where domval_dom_code = 'BNR_GCOA_MAP'
and sysdate between domval_valid_from_date and domval_valid_to_date
and domval_deleted_flag = 'N') gcoa
where gcoa.domval_ref1='6111.A31';

select domval_ref1, domval_ref2, domval_out1,a. *


from ext_owner.ext_domain_values a
where domval_dom_code = 'BNR_GCOA_MAP'
and sysdate between domval_valid_from_date and domval_valid_to_date
and domval_deleted_flag = 'N'
and a.domval_ref1='6111.A31';

Inregistrarile au fost inserate la 17.04.2019 in acelasi timp.

Salut,

Sunt 2 inregistrari care erau marcate initial cu deleted_flag si care au fost inserate in 17.04.2019 iar in parametrizare in mod
eronat ca fiind valabile. A rog sa rulati update-ul de mai jos pt a le marca iar cu deleted_flag=Y dupa care restart de proces:

update(select  domval_ref1, domval_ref2, domval_out1,a. * 
                      from ext_owner.ext_domain_values a
                      where domval_dom_code = 'BNR_GCOA_MAP'
-- and sysdate between domval_valid_from_date and domval_valid_to_date
-- and domval_deleted_flag = 'N'
-- and (a.domval_ref1) in ('6111.A31','9812.c04')
                        and domval_id in ('9812.c04.%.%.NULL.%.%.
%','6111.A31.%.NULL.%.%.%.%')
)set domval_deleted_flag='Y'
,DOMVAL_UPDATE_PROCESS_KEY=­1973
,DOMVAL_UPDATED_DATETIME=sysdate
,DOMVAL_UPDATED_EFFECT_DATE=trunc(sysdate);
 
--2 rows
 
commit;