Avoid Duplication of History Data's
Hi all,
I have written the following package,
CREATE OR REPLACE PACKAGE BODY SUMMARY.INSERT_PILLAR3_PCK
AS
P_JOB_INFO_ID NUMBER;
P_SUBMITED_BY VARCHAR2(100);
Description: Package SUMMARY.PKG_INSERT_PILLAR3 used to Populate Data to PILLAR3 Table
Version: V1.0
MODIFICATION HISTORY
Person Date Comments
Kumaran Systems 21-Mar-2009 Initial Version
PROCEDURE LOAD_PILLAR3_ADMIN_PRC
AS
-- Description: This procedure is used to Populate the Value to Pillar3 Table by ADMIN.
BEGIN
SELECT WEB_JOB_INFO_ID, SUBMITED_BY
INTO P_JOB_INFO_ID, P_SUBMITED_BY
FROM CONTROL.WEB_JOB_INFO
WHERE JOB_NAME = 'PILLAR3 DATA PROCESS'
AND STATUS_CODE = 'RUNN' AND END_DT IS NULL;
CONTROL.PKG_ERRORLOG_DETAILS.JOB_LOGS_PRC(P_JOB_INFO_ID,
1,
SYSTIMESTAMP
|| 'LOAD_PILLAR3_ADMIN STARTED'
/* Deleting the Current Month Data from PILLAR3 table */
DELETE FROM SUMMARY.PILLAR3
WHERE SNAP_SHOT_DATE = (SELECT MAX(MONTH_END_DT) FROM CONTROL.CTL_BATCH_CONTROL);
COMMIT;
/* Inserting the values into the PILLAR3 table */
INSERT INTO /*+ APPEND */ SUMMARY.PILLAR3
(SELECT VBCAR.MONTH_END_DATE,
VBCAR.SOURCE_SYSTEM,
RF1.PILLAR3_EXPOSURE_CLASS_CODE,
VBCAR.EXPOSURE_CODE,
VBCAR.EXPOSURE_CLASS_CODE,
CASE
WHEN VBCAR.SOURCE_SYSTEM = 'ML' THEN 'Margin_Lending'
WHEN VBCAR.SOURCE_SYSTEM = 'ICBS' THEN 'Amicus'||VBCAR.CCIS_PRODUCT_GROUP
WHEN VBCAR.SOURCE_SYSTEM IN ('ACBS','ASNEMP') THEN 'Other'
WHEN VBCAR.SOURCE_SYSTEM = 'CLSORG' THEN 'CBNF_Excalibur'
WHEN VBCAR.SOURCE_SYSTEM = 'TARGET' AND VBCAR.EXPOSURE_CODE = 'UNDRAW' AND
VBCAR.ACC_RK = -1 THEN 'CBNF_Target'
WHEN VBCAR.SOURCE_SYSTEM = 'PCL' AND VBCAR.EXPOSURE_CLASS_CODE = 'REVOLV' AND
VBCAR.EXPOSURE_CODE = 'UNDRAW' THEN 'PLC_Unsecured'
ELSE VBCAR.CCIS_PRODUCT_GROUP
END AS LINE_OF_BUSINESS,
VBCAR.CCIS_PRODUCT,
VBCAR.PD_VALUE,
VBCAR.LGD_RATE,
RF2.PD_BAND,
RF2.PD_BAND_DESCRIPTION,
RF3.RESIDUAL_MATURITY_TERM,
SUM(VBCAR.PRE_SEC_EAD_AMT) AS EAD_PRE_SEC_PRE_CRM,
SUM(VBCAR.POST_SEC_EAD_AMT) AS EAD_POST_SEC_PRE_CRM,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.EXPOSURE_CODE = 'DRAWN'
AND (VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') OR VBCAR.ACC_SECURITIZED_IND = 'E') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_EAD_AMT
ELSE VBCAR.POST_SEC_EAD_AMT
END) AS EAD_POST_SEC_POST_CRM,
CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE ='REMORT' AND
VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT = 0 THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT > 0 THEN 'PARTIALLY INSURED'
ELSE 'NOT INSURED'
END AS INSURED_IND,
CASE
WHEN VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY SECURITIZED'
WHEN VBCAR.SOURCE_SYSTEM ='TSYS'
AND VBCAR.PRE_SEC_EAD_AMT > VBCAR.POST_SEC_EAD_AMT
THEN 'PARTIALLY SECURITIZED'
ELSE 'NOT SECURITIZED'
END AS SECURITIZED_IND,
VBCAR.NOTIONAL_PRINCIPAL_AMT,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_RWA_AMT
ELSE VBCAR.POST_SEC_RWA_AMT
END) AS RWA,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_EL_AMT
ELSE VBCAR.POST_SEC_EL_AMT
END) AS EL,
VBCAR.POST_SEC_RWA_AMT * .08 AS CAPITAL,
RF4.GEO_SECTION,
COUNT(1),
VBCAR.PD_MODEL_ID,
SYSDATE,
SYSDATE,
'PILLAR3'
FROM RCDWSTG.V_BCAR_DETAIL_ADJ VBCAR,
RCDWSTG.STG_FIN_ACC STFC,
RCDWSTG.STG_FIN_ACC_PARTY_SRC SRC,
RCDWSTG.STG_PARTY_SRC PRTY,
(SELECT MAX(PARTY_SRC_RK) AS PARTY_SRC_RK, ACC_RK
FROM RCDWSTG.STG_FIN_ACC_PARTY_SRC
GROUP BY ACC_RK) MXP,
REFERENCE.REF_P3_BCAR_EXPOSURE_CLASS_CD RF1,
REFERENCE.REF_PD_BAND RF2,
REFERENCE.REF_MATURITY_TERM RF3,
REFERENCE.REF_GEO_SECTION RF4
WHERE VBCAR.ACC_RK = STFC.ACC_RK
AND VBCAR.SOURCE_SYSTEM = STFC.SOURCE_SYSTEM
AND MXP.ACC_RK = STFC.ACC_RK
AND SRC.ACC_RK = STFC.ACC_RK
AND VBCAR.EXPOSURE_CLASS_CODE = RF1.BCAR_EXPOSURE_CLASS_CODE
AND VBCAR.PD_BAND = RF2.PD_BAND
AND PRTY.COUNTRY_CD = RF4.COUNTRY_CODE
AND STFC.SOURCE_SYSTEM = SRC.SOURCE_SYSTEM
AND STFC.SOURCE_SYSTEM = PRTY.SOURCE_SYSTEM
AND SRC.PARTY_SRC_RK = PRTY.PARTY_SRC_RK
AND SRC.SOURCE_SYSTEM = PRTY.SOURCE_SYSTEM
AND MXP.PARTY_SRC_RK = SRC.PARTY_SRC_RK
AND SRC.PARTY_ROLE_CD = 'BOR'
GROUP BY VBCAR.MONTH_END_DATE,
VBCAR.SOURCE_SYSTEM,
RF1.PILLAR3_EXPOSURE_CLASS_CODE,
VBCAR.EXPOSURE_CODE,
VBCAR.EXPOSURE_CLASS_CODE,
CASE
WHEN VBCAR.SOURCE_SYSTEM = 'ML' THEN 'Margin_Lending'
WHEN VBCAR.SOURCE_SYSTEM = 'ICBS' THEN 'Amicus'||VBCAR.CCIS_PRODUCT_GROUP
WHEN VBCAR.SOURCE_SYSTEM IN ('ACBS','ASNEMP') THEN 'Other'
WHEN VBCAR.SOURCE_SYSTEM = 'CLSORG' THEN 'CBNF_Excalibur'
WHEN VBCAR.SOURCE_SYSTEM = 'TARGET' AND VBCAR.EXPOSURE_CODE = 'UNDRAW' AND
VBCAR.ACC_RK = -1 THEN 'CBNF_Target'
WHEN VBCAR.SOURCE_SYSTEM = 'PCL' AND VBCAR.EXPOSURE_CLASS_CODE = 'REVOLV' AND
VBCAR.EXPOSURE_CODE = 'UNDRAW' THEN 'PLC_Unsecured'
ELSE VBCAR.CCIS_PRODUCT_GROUP
END,
VBCAR.CCIS_PRODUCT,
VBCAR.PD_VALUE,
VBCAR.LGD_RATE,
RF2.PD_BAND,
RF2.PD_BAND_DESCRIPTION,
RF3.RESIDUAL_MATURITY_TERM,
CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE ='REMORT' AND
VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT = 0 THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT > 0 THEN 'PARTIALLY INSURED'
ELSE 'NOT INSURED'
END,
CASE
WHEN VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY SECURITIZED'
WHEN VBCAR.SOURCE_SYSTEM ='TSYS'
AND VBCAR.PRE_SEC_EAD_AMT > VBCAR.POST_SEC_EAD_AMT
THEN 'PARTIALLY SECURITIZED'
ELSE 'NOT SECURITIZED'
END,
VBCAR.NOTIONAL_PRINCIPAL_AMT,
(VBCAR.POST_SEC_RWA_AMT * .08),
RF4.GEO_SECTION,
VBCAR.PD_MODEL_ID
COMMIT;
CONTROL.PKG_ERRORLOG_DETAILS.JOB_LOGS_PRC(P_JOB_INFO_ID,
1,
SYSTIMESTAMP
|| 'LOAD_PILLAR3_ADMIN COMPLETED'
EXCEPTION
WHEN OTHERS THEN
CONTROL.PKG_ERRORLOG_DETAILS.JOB_ERRORS_PRC
(P_JOB_INFO_ID,
1,
NULL,
'LOAD_PILLAR3_ADMIN',
SQLCODE || SQLERRM,
NULL
CONTROL.PKG_ERRORLOG_DETAILS.UPDATE_JOB_INFO_PRC(P_JOB_INFO_ID, 'FWRR');
END LOAD_PILLAR3_ADMIN_PRC;
end;
When i execute this package first time
The History + Current Month data inserting into a table
When i execute second time History + History + current month data's inserting into the table.
But i dont want the duplication of history data in the table,
Can anyone suggest me how to do this.
Thanks
Radha K
I have written the following merge stmt
MERGE INTO PILLAR3
USING
(SELECT VBCAR.MONTH_END_DATE,
VBCAR.SOURCE_SYSTEM,
RF1.PILLAR3_EXPOSURE_CLASS_CODE,
VBCAR.EXPOSURE_CODE,
VBCAR.EXPOSURE_CLASS_CODE,
CASE
WHEN VBCAR.SOURCE_SYSTEM = 'ML' THEN 'Margin_Lending'
WHEN VBCAR.SOURCE_SYSTEM = 'ICBS' THEN 'Amicus'||VBCAR.CCIS_PRODUCT_GROUP
WHEN VBCAR.SOURCE_SYSTEM IN ('ACBS','ASNEMP') THEN 'Other'
WHEN VBCAR.SOURCE_SYSTEM = 'CLSORG' THEN 'CBNF_Excalibur'
WHEN VBCAR.SOURCE_SYSTEM = 'TARGET' AND VBCAR.EXPOSURE_CODE = 'UNDRAW' AND
VBCAR.ACC_RK = -1 THEN 'CBNF_Target'
WHEN VBCAR.SOURCE_SYSTEM = 'PCL' AND VBCAR.EXPOSURE_CLASS_CODE = 'REVOLV' AND
VBCAR.EXPOSURE_CODE = 'UNDRAW' THEN 'PLC_Unsecured'
ELSE VBCAR.CCIS_PRODUCT_GROUP
END AS LINE_OF_BUSINESS,
VBCAR.CCIS_PRODUCT,
VBCAR.PD_VALUE,
VBCAR.LGD_RATE,
RF2.PD_BAND,
RF2.PD_BAND_DESCRIPTION,
RF3.RESIDUAL_MATURITY_TERM,
SUM(VBCAR.PRE_SEC_EAD_AMT) AS EAD_PRE_SEC_PRE_CRM,
SUM(VBCAR.POST_SEC_EAD_AMT) AS EAD_POST_SEC_PRE_CRM,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.EXPOSURE_CODE = 'DRAWN'
AND (VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') OR VBCAR.ACC_SECURITIZED_IND = 'E') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_EAD_AMT
ELSE VBCAR.POST_SEC_EAD_AMT
END) AS EAD_POST_SEC_POST_CRM,
CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE ='REMORT' AND
VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT = 0 THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT > 0 THEN 'PARTIALLY INSURED'
ELSE 'NOT INSURED'
END AS INSURED_IND,
CASE
WHEN VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY SECURITIZED'
WHEN VBCAR.SOURCE_SYSTEM ='TSYS'
AND VBCAR.PRE_SEC_EAD_AMT > VBCAR.POST_SEC_EAD_AMT
THEN 'PARTIALLY SECURITIZED'
ELSE 'NOT SECURITIZED'
END AS SECURITIZED_IND,
VBCAR.NOTIONAL_PRINCIPAL_AMT,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_RWA_AMT
ELSE VBCAR.POST_SEC_RWA_AMT
END) AS RWA,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_EL_AMT
ELSE VBCAR.POST_SEC_EL_AMT
END) AS EL,
VBCAR.POST_SEC_RWA_AMT * .08 AS CAPITAL,
RF4.GEO_SECTION,
COUNT(1),
VBCAR.PD_MODEL_ID,
SYSDATE,
SYSDATE,
'PILLAR3'
FROM RCDWSTG.V_BCAR_DETAIL_ADJ VBCAR,
RCDWSTG.STG_FIN_ACC STFC,
RCDWSTG.STG_FIN_ACC_PARTY_SRC SRC,
RCDWSTG.STG_PARTY_SRC PRTY,
(SELECT MAX(PARTY_SRC_RK) AS PARTY_SRC_RK, ACC_RK
FROM RCDWSTG.STG_FIN_ACC_PARTY_SRC
GROUP BY ACC_RK) MXP,
REFERENCE.REF_P3_BCAR_EXPOSURE_CLASS_CD RF1,
REFERENCE.REF_PD_BAND RF2,
REFERENCE.REF_MATURITY_TERM RF3,
REFERENCE.REF_GEO_SECTION RF4
WHERE VBCAR.ACC_RK = STFC.ACC_RK
AND VBCAR.SOURCE_SYSTEM = STFC.SOURCE_SYSTEM
AND MXP.ACC_RK = STFC.ACC_RK
AND SRC.ACC_RK = STFC.ACC_RK
AND VBCAR.EXPOSURE_CLASS_CODE = RF1.BCAR_EXPOSURE_CLASS_CODE
AND VBCAR.PD_BAND = RF2.PD_BAND
AND PRTY.COUNTRY_CD = RF4.COUNTRY_CODE
AND STFC.SOURCE_SYSTEM = SRC.SOURCE_SYSTEM
AND STFC.SOURCE_SYSTEM = PRTY.SOURCE_SYSTEM
AND SRC.PARTY_SRC_RK = PRTY.PARTY_SRC_RK
AND SRC.SOURCE_SYSTEM = PRTY.SOURCE_SYSTEM
AND MXP.PARTY_SRC_RK = SRC.PARTY_SRC_RK
AND SRC.PARTY_ROLE_CD = 'BOR'
GROUP BY VBCAR.MONTH_END_DATE,
VBCAR.SOURCE_SYSTEM,
RF1.PILLAR3_EXPOSURE_CLASS_CODE,
VBCAR.EXPOSURE_CODE,
VBCAR.EXPOSURE_CLASS_CODE,
CASE
WHEN VBCAR.SOURCE_SYSTEM = 'ML' THEN 'Margin_Lending'
WHEN VBCAR.SOURCE_SYSTEM = 'ICBS' THEN 'Amicus'||VBCAR.CCIS_PRODUCT_GROUP
WHEN VBCAR.SOURCE_SYSTEM IN ('ACBS','ASNEMP') THEN 'Other'
WHEN VBCAR.SOURCE_SYSTEM = 'CLSORG' THEN 'CBNF_Excalibur'
WHEN VBCAR.SOURCE_SYSTEM = 'TARGET' AND VBCAR.EXPOSURE_CODE = 'UNDRAW' AND
VBCAR.ACC_RK = -1 THEN 'CBNF_Target'
WHEN VBCAR.SOURCE_SYSTEM = 'PCL' AND VBCAR.EXPOSURE_CLASS_CODE = 'REVOLV' AND
VBCAR.EXPOSURE_CODE = 'UNDRAW' THEN 'PLC_Unsecured'
ELSE VBCAR.CCIS_PRODUCT_GROUP
END,
VBCAR.CCIS_PRODUCT,
VBCAR.PD_VALUE,
VBCAR.LGD_RATE,
RF2.PD_BAND,
RF2.PD_BAND_DESCRIPTION,
RF3.RESIDUAL_MATURITY_TERM,
CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE ='REMORT' AND
VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT = 0 THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT > 0 THEN 'PARTIALLY INSURED'
ELSE 'NOT INSURED'
END,
CASE
WHEN VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY SECURITIZED'
WHEN VBCAR.SOURCE_SYSTEM ='TSYS'
AND VBCAR.PRE_SEC_EAD_AMT > VBCAR.POST_SEC_EAD_AMT
THEN 'PARTIALLY SECURITIZED'
ELSE 'NOT SECURITIZED'
END,
VBCAR.NOTIONAL_PRINCIPAL_AMT,
(VBCAR.POST_SEC_RWA_AMT * .08),
RF4.GEO_SECTION,
VBCAR.PD_MODEL_ID) TMP_PILLAR3
ON (a.MONTH_END_DATE = b.MONTH_END_DATE)
WHEN matched THEN
UPDATE SET a.update_time = SYSDATE + 2
WHEN NOT MATCHED THEN
INSERT INTO PILLAR3(SNAP_SHOT_DATE,
SOURCE_SYSTEM,
PILLAR3_EXPOSURE_CLASS_CODE ,
EXPOSURE_TYPE ,
BCAR_EXPOSURE_CLASS_CODE ,
LINE_OF_BUSINESS ,
CCIS_PRODUCT ,
PD_VALUE ,
LGD_RATE ,
PILLAR3_PD_BAND,
PD_BAND_DESCRIPTION,
RESIDUAL_MATURITY_TERM,
EAD_PRE_SEC_PRE_CRM,
EAD_POST_SEC_PRE_CRM,
EAD_POST_SEC_POST_CRM,
INSURED_IND,
SECURITIZED_IND,
NOTIONAL_PRINCIPLE,
RWA,
EL,
CAPITAL,
GEO_SECTION ,
COUNT_OF_ACCOUNTS,
PD_ASSESSMENT_RATING_GRADE,
LOAD_DATE,
UPDATE_DATE ,
UPDATE_USERID
VALUES
(VBCAR.MONTH_END_DATE,
VBCAR.SOURCE_SYSTEM,
RF1.PILLAR3_EXPOSURE_CLASS_CODE,
VBCAR.EXPOSURE_CODE,
VBCAR.EXPOSURE_CLASS_CODE,
CASE
WHEN VBCAR.SOURCE_SYSTEM = 'ML' THEN 'Margin_Lending'
WHEN VBCAR.SOURCE_SYSTEM = 'ICBS' THEN 'Amicus'||VBCAR.CCIS_PRODUCT_GROUP
WHEN VBCAR.SOURCE_SYSTEM IN ('ACBS','ASNEMP') THEN 'Other'
WHEN VBCAR.SOURCE_SYSTEM = 'CLSORG' THEN 'CBNF_Excalibur'
WHEN VBCAR.SOURCE_SYSTEM = 'TARGET' AND VBCAR.EXPOSURE_CODE = 'UNDRAW' AND
VBCAR.ACC_RK = -1 THEN 'CBNF_Target'
WHEN VBCAR.SOURCE_SYSTEM = 'PCL' AND VBCAR.EXPOSURE_CLASS_CODE = 'REVOLV' AND
VBCAR.EXPOSURE_CODE = 'UNDRAW' THEN 'PLC_Unsecured'
ELSE VBCAR.CCIS_PRODUCT_GROUP
END AS LINE_OF_BUSINESS,
VBCAR.CCIS_PRODUCT,
VBCAR.PD_VALUE,
VBCAR.LGD_RATE,
RF2.PD_BAND,
RF2.PD_BAND_DESCRIPTION,
RF3.RESIDUAL_MATURITY_TERM,
SUM(VBCAR.PRE_SEC_EAD_AMT) AS EAD_PRE_SEC_PRE_CRM,
SUM(VBCAR.POST_SEC_EAD_AMT) AS EAD_POST_SEC_PRE_CRM,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.EXPOSURE_CODE = 'DRAWN'
AND (VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') OR VBCAR.ACC_SECURITIZED_IND = 'E') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_EAD_AMT
ELSE VBCAR.POST_SEC_EAD_AMT
END) AS EAD_POST_SEC_POST_CRM,
CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE ='REMORT' AND
VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT = 0 THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT > 0 THEN 'PARTIALLY INSURED'
ELSE 'NOT INSURED'
END AS INSURED_IND,
CASE
WHEN VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY SECURITIZED'
WHEN VBCAR.SOURCE_SYSTEM ='TSYS'
AND VBCAR.PRE_SEC_EAD_AMT > VBCAR.POST_SEC_EAD_AMT
THEN 'PARTIALLY SECURITIZED'
ELSE 'NOT SECURITIZED'
END AS SECURITIZED_IND,
VBCAR.NOTIONAL_PRINCIPAL_AMT,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_RWA_AMT
ELSE VBCAR.POST_SEC_RWA_AMT
END) AS RWA,
SUM(CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE = 'REMORT' AND VBCAR.INSURER_TYPE_CD IN ('GVN','PRI') THEN 0
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans' THEN VBCAR.POST_GOV_EL_AMT
ELSE VBCAR.POST_SEC_EL_AMT
END) AS EL,
VBCAR.POST_SEC_RWA_AMT * .08 AS CAPITAL,
RF4.GEO_SECTION,
COUNT(1),
VBCAR.PD_MODEL_ID,
SYSDATE,
SYSDATE,
'PILLAR3'
FROM RCDWSTG.V_BCAR_DETAIL_ADJ VBCAR,
RCDWSTG.STG_FIN_ACC STFC,
RCDWSTG.STG_FIN_ACC_PARTY_SRC SRC,
RCDWSTG.STG_PARTY_SRC PRTY,
(SELECT MAX(PARTY_SRC_RK) AS PARTY_SRC_RK, ACC_RK
FROM RCDWSTG.STG_FIN_ACC_PARTY_SRC
GROUP BY ACC_RK) MXP,
REFERENCE.REF_P3_BCAR_EXPOSURE_CLASS_CD RF1,
REFERENCE.REF_PD_BAND RF2,
REFERENCE.REF_MATURITY_TERM RF3,
REFERENCE.REF_GEO_SECTION RF4
WHERE VBCAR.ACC_RK = STFC.ACC_RK
AND VBCAR.SOURCE_SYSTEM = STFC.SOURCE_SYSTEM
AND MXP.ACC_RK = STFC.ACC_RK
AND SRC.ACC_RK = STFC.ACC_RK
AND VBCAR.EXPOSURE_CLASS_CODE = RF1.BCAR_EXPOSURE_CLASS_CODE
AND VBCAR.PD_BAND = RF2.PD_BAND
AND PRTY.COUNTRY_CD = RF4.COUNTRY_CODE
AND STFC.SOURCE_SYSTEM = SRC.SOURCE_SYSTEM
AND STFC.SOURCE_SYSTEM = PRTY.SOURCE_SYSTEM
AND SRC.PARTY_SRC_RK = PRTY.PARTY_SRC_RK
AND SRC.SOURCE_SYSTEM = PRTY.SOURCE_SYSTEM
AND MXP.PARTY_SRC_RK = SRC.PARTY_SRC_RK
AND SRC.PARTY_ROLE_CD = 'BOR'
GROUP BY VBCAR.MONTH_END_DATE,
VBCAR.SOURCE_SYSTEM,
RF1.PILLAR3_EXPOSURE_CLASS_CODE,
VBCAR.EXPOSURE_CODE,
VBCAR.EXPOSURE_CLASS_CODE,
CASE
WHEN VBCAR.SOURCE_SYSTEM = 'ML' THEN 'Margin_Lending'
WHEN VBCAR.SOURCE_SYSTEM = 'ICBS' THEN 'Amicus'||VBCAR.CCIS_PRODUCT_GROUP
WHEN VBCAR.SOURCE_SYSTEM IN ('ACBS','ASNEMP') THEN 'Other'
WHEN VBCAR.SOURCE_SYSTEM = 'CLSORG' THEN 'CBNF_Excalibur'
WHEN VBCAR.SOURCE_SYSTEM = 'TARGET' AND VBCAR.EXPOSURE_CODE = 'UNDRAW' AND
VBCAR.ACC_RK = -1 THEN 'CBNF_Target'
WHEN VBCAR.SOURCE_SYSTEM = 'PCL' AND VBCAR.EXPOSURE_CLASS_CODE = 'REVOLV' AND
VBCAR.EXPOSURE_CODE = 'UNDRAW' THEN 'PLC_Unsecured'
ELSE VBCAR.CCIS_PRODUCT_GROUP
END,
VBCAR.CCIS_PRODUCT,
VBCAR.PD_VALUE,
VBCAR.LGD_RATE,
RF2.PD_BAND,
RF2.PD_BAND_DESCRIPTION,
RF3.RESIDUAL_MATURITY_TERM,
CASE
WHEN VBCAR.EXPOSURE_CLASS_CODE ='REMORT' AND
VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT = 0 THEN 'FULLY INSURED'
WHEN VBCAR.CCIS_PRODUCT_GROUP = 'Student_Loans'
AND VBCAR.POST_GOV_EAD_AMT > 0 THEN 'PARTIALLY INSURED'
ELSE 'NOT INSURED'
END,
CASE
WHEN VBCAR.ACC_SECURITIZED_IND = 'E' THEN 'FULLY SECURITIZED'
WHEN VBCAR.SOURCE_SYSTEM ='TSYS'
AND VBCAR.PRE_SEC_EAD_AMT > VBCAR.POST_SEC_EAD_AMT
THEN 'PARTIALLY SECURITIZED'
ELSE 'NOT SECURITIZED'
END,
VBCAR.NOTIONAL_PRINCIPAL_AMT,
(VBCAR.POST_SEC_RWA_AMT * .08),
RF4.GEO_SECTION,
VBCAR.PD_MODEL_ID
but its showing missing values keyboard.
Similar Messages
-
How will avoid "duplication records" in to info cube
hi friends
what is tha proccesor to avoid duplication records in to info cube
send me notes ...
i will waiting for urs replyHi,
1. Set DSO before cube, because DSO has overwrite functionality.
2..Select the check box "ignore duplicate records at infopackage level", while loading data
Regards
CSM Reddy -
How to avoid duplication of vendor name and vendor account group
Let me know the menu path for setting in SAP - controlling / avoid duplication vendor name and vendor account group in one purchasing organisation during creation of vendor / uploading mass data.
with regards
vvHi,
See vendor code is unique no. But the name is not at all unique. so system allow to create duplicate record.
by giving authorization to single person only you can do it.
system discipline is actually required -
How to avoid duplication of mails on Mac book and I phone
Am using Apple mail on Mac Book Lion version & I phone 4 with IOS.
Am using corporate mail server ie [email protected]
Despite having done the mail settngs with the option - Delete mail immediately on removing the mail from Inbox, the same mail gets downloaded on the other device. That is, i receive all mails on both my devices Mac Book and I phone even if its deleted from Inbox in one device.
i am looking for an option of avoiding duplication of mails - that is mails deleted shouldnt come again on the other device.
pl help.
thanksDepends on what passwords you are talking about. Most passwords you have the option to change whenever you want.
-
Hello,
in my vi I have a chart with 5 Plots displaying measurement data.
The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
I use LabVIEW 7.1
Johannes
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Solved!
Go to Solution.Gerd,
thank you for the quick response and the easy solution.
Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
Johannes
Message Edited by johanneshoer on 04-28-2009 10:39 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Attachments:
SaveChartHistory.JPG 57 KB
SaveChartHistory.JPG 57 KB -
How can avoid mandatory fields in data transfer
hai
please respond me
how can avoid mandatory fields in data transfer like bdchi,
u have to pass values for mandatory fields in bdc method, u have to prepare u r bdc data such a way that all the mandatory fields are filled, other wise it will give error -
I added Icloud to join my calendar on my phone to another person. It erased all history date from previous months. how do I get that data back?
i found the answer to the first part: reboot and keep hold of command+r
this gave me a list of options
one of them was to reinstall lion from fresh
i went for this
dont know why... but all forum posts i read said u should delete hard disc? theres an option for this
which is the right option?
any suggesstion where i go to register new mac would be great
thanks -
Hi,
In which table the Purchase Order History data or Purchase Order Document Flow Data is being stored. (Just the like the Sales Order Document Flow Data is being stored in table VBFA).
Regards,
VishalHi,
In EKBE table contains history of Purchase documents.
reward if useful.
Regards,
Narasimha -
Dividing payment history data (KNB4) under sales area of a customer..
Hello Everybody,
I need to divide the payment history data available in KNB4 table according to divisions which are available under one customer. But payment history data is automatically updated when we are posting the payments ( If "payment history record" check box is checked in the company code details of a customer).
Is it possible to customize this filtering?
Please answer for this Question as soon as possible..
Thanks in Advance..
Regards
SwathiHi Swathi,
A custom report need to be developed to achieve this.
For a particulat customer, Need to pick up the billing documents in the month and at billing item divisions needs to be considered.
Regs,
Sai -
Hi All.
I have some data loaded in BW flow from Nov 13 to Till date.Its a daily load.Now the client wants the data before Nov. 13 also.One month data has above 2 crore records.Its an FIGL Load.As its a daily load,i have a small window of time to load the history data before the daily data load happens.So i plan to load data for 1 month at a time.
How to go about this.Repair Full i need to do?Have not done it before,can anyone guide?Any chance of PSA getting corrupt?How will delta work
?Will it affect the daily load?Do i need to make the history request red in PSA to load and then load into my flow maually when the daily chain is not going as the FIGL load goes into many other flows.Its in the Production so if anything goes wrong.Everything will be impacted.
Thanks
AdityaMy understanding was this:
You enhanced BW cube with 2 fields, move to prod. everything was fine.
On BPC Side you loaded data from BW Enhanced cube by usig DM pkges as-usual. But your BPC cube was doubled after this load.
If yes then, Check as suggested above.
One more major point here. You did bw cube enhanced as your business in BW only(guess). For added fields you may be loaded historical data. am i right.think so.
So now your BW cube have historical data till now. When coming BPC cube, you may not be deleted data from BPC Cube (old data) which you loaded,because its not necessary. If your BPC have some data before this load, then after this load its may doubled. because BW Cube have historical data. BPC Cube old data was lied in bw historical data, whatever option you used at DM pkg, you get double.
Even if you loaded delta pkg at BPC side also you will get doubled. because source bw cube have old data in new request form.
for BW enhancement - BW deleted data and reloaded
For BPC - didn't deleted,without deletion, data requested from bw cube, so bpc data will be double.
Work around: if above my points are right then you just delete BPC cube data and reload whole again.
When enhancing BW cubes which are used in BPC models. need to remember about this data issue.
Thanks. -
ExcelToCI not loading correct history data.
We are using ExcelToCI to load history data on JOB_DATA component. The action used is UPDATE as the data is loaded at Scroll - Level 1. The row is intended to be added between 2 rows i.e. between CURRENT and HISTORY (or between 2 history rows) and only a few fields need to change. The row gets inserted, however the problem is that the data in the newly inserted row is from the succedding/ current row rather than previous/ history row.
Following is the expected behaviour of the system as per the excerpt from Administer Workforce PeopleBook 9.0 page 553:
__When you enter a new data row, the system copies the contents of the previous row into the new row—thus__
__you do not have to retype any information that stays the same. (Ensure that you position the cursor on the__
__data row that you want to copy before you insert the new row.) The only new information is the effective__
__date, which is set by default to the system date (usually today’s date).__
The above is the normal system behaviour but the ExcelToCI is not conforming to that. Has someone faced the same issue?
FarazExcelToCI is not really designed for and is certainly not guaranteed to work with large, complex CIs. They don't come much larger or more complex than JOB_DATA, so it shouldn't be too much of a surprise that it isn't working as expected.
Look for the ExcelToCI_Troubleshooting_Guide.doc on Oracle Support, and/or read the "Using the Excel to Component Interface Utility" chapter in the PeopleTools Component Interfaces PeopleBook. The PeopleBook description of the Action setting has some specific advice on handling effective dated rows.
Regards,
Bob -
can any one tell me how to find user logon history date:
i am able to find last logon date in table usr02,
can any one tell m ehow to use the funaction module to find logon history of user RSAU_READ_FILE.
Thanks in advance,use below Function module
CALL FUNCTION 'RSAU_READ_FILE'.
Go through below link...
regarding Shortdump "CALL FUNCTION 'RSAU_READ_FILE"
Hope it will solve your problem...
=====================================
Use <b>BAPIS</b> there are very useful BAPIS to get the user's info.
BAPI_USER_CHANGE Change User
BAPI_USER_CLONE Create User with Template in Another System
BAPI_USER_CREATE Create a User
BAPI_USER_CREATE1 Create a User
BAPI_USER_DELETE BAPI to Delete a User
BAPI_USER_DISPLAY Display users
BAPI_USER_EXISTENCE_CHECK Check a user exists
BAPI_USER_GET_DETAIL Read User Details
BAPI_USER_LOCACTGROUPS_ASSIGN Change Activity Group Assignment for Dependent Systems from Central System
BAPI_USER_LOCACTGROUPS_DELETE Delete Activity Group Assignments in the Dependent Systems
BAPI_USER_LOCK Lock User
BAPI_USER_LOCPROFILES_ASSIGN Change Profile Assignment for Dependent Systems from Central System
BAPI_USER_LOCPROFILES_DELETE Delete Profile Assignments for Dependent Systems
BAPI_USER_PROFILES_ASSIGN User: Assign profiles
BAPI_USER_PROFILES_DELETE User: Delete All Profile Assignments
BAPI_USER_UNLOCK Unlock user
===================================
U can see tables:
USR01 User master record (runtime data)
USR02 Logon data
USR03 User address data
USR05 User Master Parameter ID
USR12 User master authorization values
<b>Reward points if it is useful..</b>
Thanks & Regards
ilesh 24x7 -
Clear the History Data Automatically in Production Planning Table MF50
Dear Friends,
I have the problem to set the Production Planning Table (Txn MF50) to
clear the history data automatically. Currently, all the history data
in the planning table has to be cleared manually.
Appreciate your help.
Rgds
Zahari Yusofinstead of just removing the whole history like private browsing do, i just want to remove browsing/download history and form&search. i didn't want to remove cookies and active logins, heheh. thank you
-
10.1.3.3 on MySQL - Wrong SQL to fill history date field
Hello,
I'm using ADF 10.1.3.3 with MySQL database. In most of my EOs, I'm putting history fields of type date. When creating new row, ADF BC issued "select sysdate from dual" that failed on MySQL, which Im assuming that it is an effort to fill those history date field.
Are there any known fix or workaround to this problem?
Thanks
Rgds,
RudiBy the way, I'm aware of the fact that I can always override create() on the EO and set the createdDate there. This is purely out of curiousity. Is there anyway to make ADF BC issues the right SQL syntax for different database.
-
"HISTORY DATA"tab in address menu on customer overview page
Hi,
In sap crm 6.0 system after you confirm the customer and go on to the customer overview page under the address menu, there is a tab "HISTORY DATA" which gives the details of all the addresses stored for the customer till date.
In sap crm 7.0 system, that tab is missing. Could anyone please help me in activating the same tab "HISTORY DATA" in 7.0 system.Please let me know what changes needs to be done. ThanksRight-click a blank part of any toolbar, and de-select '''Menu Bar'''.
Maybe you are looking for
-
Can DPS be used for internal apps?
Hello, I'm interested in using DPS to create internal applications - i.e. publishing internal (sensitive) content for an organisation to an application distributed solely by that organisation to it's staff. We have an enterprise Apple account allowin
-
How to display the velocity template in browser
Hi All, Am new to vm. Can anyone help me, how to display the content of .vm file in browser ? Am able to display the content of .vm file in console. Whether this is because of any path issues ? Thanks in Advance.
-
How to convince my parents to get me an iPhone?
Here are my circumstances: I am a responsible child I get incredibly good grades I babysit (reinforcing my responsibility) I have a very good relationship with my mother and father I bought and paid for my own iPad Air last year which neither of my p
-
Need to Call VB DLL from Oracle forms 6i. Please help.
Dear Friends, I am having a DLL which is created in VB. DLL having one function, that function having some IN parameters and it will return Char or Number. Please tell me how to call, send IN Parameter and Get out value. Advance Thanks. Best Regards,
-
Reg: Material Availability Date
Dear All, I find difficult to understand the logic behing arriving Material Availability Date. It is not a basic question. Because I know the Availability check process and Backward scheduling process. But I am not able to understand the link between