DBA Data[Home] [Help]

APPS.XTR_COF_P dependencies on XTR_COST_OF_FUNDS

Line 177: The idea is that the correspondence between an IG deal in XTR_POSITION_HISTORY and XTR_COST_OF_FUNDS

173: /*********************************************/
174: /* For deal manager performance issue for IG */
175: /*********************************************/
176: /* This is a pure preformance hack for the IG deal manager
177: The idea is that the correspondence between an IG deal in XTR_POSITION_HISTORY and XTR_COST_OF_FUNDS
178: is one to one. Therefore it is much more effecient to update XTR_COST_OF_FUNDS at the same time
179: we update XTR_POSITION_HISTORY. Block update. However to do this it was necessicary to duplicate
180: some of the logic from maintain_cof procedure. This procedure is for IG deals and only IG deals.
181: In order to use this hack, the developer must adhere to the following requirements and must not

Line 178: is one to one. Therefore it is much more effecient to update XTR_COST_OF_FUNDS at the same time

174: /* For deal manager performance issue for IG */
175: /*********************************************/
176: /* This is a pure preformance hack for the IG deal manager
177: The idea is that the correspondence between an IG deal in XTR_POSITION_HISTORY and XTR_COST_OF_FUNDS
178: is one to one. Therefore it is much more effecient to update XTR_COST_OF_FUNDS at the same time
179: we update XTR_POSITION_HISTORY. Block update. However to do this it was necessicary to duplicate
180: some of the logic from maintain_cof procedure. This procedure is for IG deals and only IG deals.
181: In order to use this hack, the developer must adhere to the following requirements and must not
182: deviate or modify them. Be careful when making modifications to any of the affected code areas so

Line 218: from XTR_COST_OF_FUNDS

214: V_CPARTY_CODE VARCHAR2,
215: V_DEAL_TYPE VARCHAR2,
216: V_CURRENCY VARCHAR2) is
217: select ROWID,AS_AT_DATE
218: from XTR_COST_OF_FUNDS
219: where AS_AT_DATE >= V_START_DATE
220: and AS_AT_DATE < V_END_DATE
221: and DEAL_TYPE = V_DEAL_TYPE
222: --and DEAL_SUBTYPE = V_DEAL_SUBTYPE /* IG DEAL HAS ONE AND ONLY ONE ENTRY. UPDATE RESPECTIVELY */

Line 261: update XTR_COST_OF_FUNDS

257: END IF;
258: END LOOP;
259:
260: FORALL i in 1..T_COF_AS_AT_DATE.COUNT
261: update XTR_COST_OF_FUNDS
262: set GROSS_PRINCIPAL = L_BASE_REF_AMOUNT,
263: HCE_GROSS_PRINCIPAL = L_HCE_BASE_REF_AMOUNT,
264: WEIGHTED_AVG_PRINCIPAL = L_WEIGHTED_AVG_PRIN,
265: AVG_INTEREST_RATE = L_CONVERT_RATE,

Line 276: insert into XTR_COST_OF_FUNDS

272: PORTFOLIO_CODE = P_PORTFOLIO_CODE
273: where rowid=T_COF_ROWID(i);
274:
275: FORALL i in 1..T_COF_AS_AT_DATE_INS.COUNT
276: insert into XTR_COST_OF_FUNDS
277: (as_at_date,company_code,deal_type,
278: deal_subtype,party_code,portfolio_code,product_type,
279: currency,currency_combination,contra_ccy,
280: account_no,created_on,

Line 1645: from XTR_COST_OF_FUNDS

1641: V_CONTRA_CCY VARCHAR2,
1642: V_CURRENCY_COMBINATION VARCHAR2,
1643: V_ACCOUNT_NO VARCHAR2) is
1644: select ROWID,GROSS_PRINCIPAL
1645: from XTR_COST_OF_FUNDS
1646: where AS_AT_DATE = V_AS_AT_DATE
1647: and DEAL_TYPE = V_DEAL_TYPE
1648: and DEAL_SUBTYPE = V_DEAL_SUBTYPE
1649: and COMPANY_CODE = V_COMPANY_CODE

Line 1709: update XTR_COST_OF_FUNDS

1705: if CHK_LOCK_ROWS%FOUND then
1706: close CHK_LOCK_ROWS;
1707: If NEW_DEAL_TYPE = 'FX' then
1708: -- For FX, adding 3 new columns to calculate avg_interest_rate and avg_base_rate
1709: update XTR_COST_OF_FUNDS
1710: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)+nvl(NEW_BASE_REF_AMOUNT,0),
1711: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)+nvl(NEW_HCE_BASE_REF_AMOUNT,0),
1712: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
1713: +round(nvl(NEW_BASE_REF_AMOUNT,0)*

Line 1734: update XTR_COST_OF_FUNDS

1730: INTEREST = 0,
1731: HCE_INTEREST = 0
1732: where rowid=l_rowid;
1733: else -- For other deal types (TMM, RTMM, CA, IG, ONC, NI, BOND)
1734: update XTR_COST_OF_FUNDS
1735: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)+nvl(NEW_BASE_REF_AMOUNT,0),
1736: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)+nvl(NEW_HCE_BASE_REF_AMOUNT,0),
1737: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
1738: +round(nvl(NEW_BASE_REF_AMOUNT,0)*

Line 1761: insert into XTR_COST_OF_FUNDS

1757: end if;
1758: else
1759: close CHK_LOCK_ROWS;
1760: -- insert new row
1761: insert into XTR_COST_OF_FUNDS
1762: (as_at_date,company_code,deal_type,
1763: deal_subtype,party_code,portfolio_code,product_type,
1764: currency,currency_combination,contra_ccy,
1765: account_no,created_on,

Line 1832: delete from XTR_COST_OF_FUNDS

1828: fetch CHK_LOCK_ROWS into l_rowid,l_gross;
1829: if CHK_LOCK_ROWS%FOUND then
1830: close CHK_LOCK_ROWS;
1831: if OLD_DEAL_TYPE <> 'FX' and nvl(l_gross,0) = nvl(OLD_BASE_REF_AMOUNT,0) then
1832: delete from XTR_COST_OF_FUNDS
1833: where rowid=l_rowid;
1834: else
1835: if OLD_DEAL_TYPE = 'FX' then
1836: update XTR_COST_OF_FUNDS

Line 1836: update XTR_COST_OF_FUNDS

1832: delete from XTR_COST_OF_FUNDS
1833: where rowid=l_rowid;
1834: else
1835: if OLD_DEAL_TYPE = 'FX' then
1836: update XTR_COST_OF_FUNDS
1837: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)-nvl(OLD_BASE_REF_AMOUNT,0),
1838: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)-nvl(OLD_HCE_BASE_REF_AMOUNT,0),
1839: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
1840: -round(nvl(OLD_BASE_REF_AMOUNT,0)*

Line 1861: update XTR_COST_OF_FUNDS

1857: INTEREST = 0,
1858: HCE_INTEREST = 0
1859: where rowid=l_rowid;
1860: else -- deal type TMM, RTMM, NI, BOND, CA, IG
1861: update XTR_COST_OF_FUNDS
1862: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)-nvl(OLD_BASE_REF_AMOUNT,0),
1863: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)-nvl(OLD_HCE_BASE_REF_AMOUNT,0),
1864: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
1865: -round(nvl(OLD_BASE_REF_AMOUNT,0)*

Line 1888: insert into XTR_COST_OF_FUNDS

1884: end if;
1885: else
1886: close CHK_LOCK_ROWS;
1887: -- insert new row
1888: insert into XTR_COST_OF_FUNDS
1889: (as_at_date,company_code,deal_type,
1890: deal_subtype,party_code,portfolio_code,product_type,
1891: currency,currency_combination,contra_ccy,
1892: account_no,created_on,

Line 1964: update XTR_COST_OF_FUNDS

1960: fetch CHK_LOCK_ROWS into l_rowid,l_gross;
1961: if CHK_LOCK_ROWS%FOUND then
1962: close CHK_LOCK_ROWS;
1963: if NEW_DEAL_TYPE = 'FX' then
1964: update XTR_COST_OF_FUNDS
1965: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)+nvl(NEW_BASE_REF_AMOUNT,0),
1966: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)+nvl(NEW_HCE_BASE_REF_AMOUNT,0),
1967: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
1968: +round(nvl(NEW_BASE_REF_AMOUNT,0)*

Line 1989: update XTR_COST_OF_FUNDS

1985: INTEREST = 0,
1986: HCE_INTEREST = 0
1987: where rowid=l_rowid;
1988: else -- deal type TMM, RTMM, NI, BOND, ONC, CA, IG
1989: update XTR_COST_OF_FUNDS
1990: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)+nvl(NEW_BASE_REF_AMOUNT,0),
1991: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)+nvl(NEW_HCE_BASE_REF_AMOUNT,0),
1992: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
1993: +round(nvl(NEW_BASE_REF_AMOUNT,0)*

Line 2016: insert into XTR_COST_OF_FUNDS

2012: end if;
2013: else
2014: close CHK_LOCK_ROWS;
2015: -- insert new row
2016: insert into XTR_COST_OF_FUNDS
2017: (as_at_date,company_code,deal_type,
2018: deal_subtype,party_code,portfolio_code,product_type,
2019: currency,currency_combination,contra_ccy,
2020: account_no,created_on,

Line 2084: delete from XTR_COST_OF_FUNDS

2080: if CHK_LOCK_ROWS%FOUND then
2081: close CHK_LOCK_ROWS;
2082:
2083: if OLD_DEAL_TYPE <> 'FX' and nvl(l_gross,0) = nvl(OLD_BASE_REF_AMOUNT,0) then
2084: delete from XTR_COST_OF_FUNDS
2085: where rowid=l_rowid;
2086: else
2087: If NEW_DEAL_TYPE = 'FX' then
2088: -- For FX, we add 3 columns to calculate correct avg_interest_rate and avg_base_rate

Line 2089: update XTR_COST_OF_FUNDS

2085: where rowid=l_rowid;
2086: else
2087: If NEW_DEAL_TYPE = 'FX' then
2088: -- For FX, we add 3 columns to calculate correct avg_interest_rate and avg_base_rate
2089: update XTR_COST_OF_FUNDS
2090: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)-nvl(OLD_BASE_REF_AMOUNT,0),
2091: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)-nvl(OLD_HCE_BASE_REF_AMOUNT,0),
2092: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
2093: -round(nvl(OLD_BASE_REF_AMOUNT,0)*

Line 2114: update XTR_COST_OF_FUNDS

2110: INTEREST = 0,
2111: HCE_INTEREST = 0
2112: where rowid=l_rowid;
2113: else -- deal type TMM, RTMM, CA, IG, ONC, BOND, NI
2114: update XTR_COST_OF_FUNDS
2115: set GROSS_PRINCIPAL = nvl(GROSS_PRINCIPAL,0)-nvl(OLD_BASE_REF_AMOUNT,0),
2116: HCE_GROSS_PRINCIPAL =nvl(HCE_GROSS_PRINCIPAL,0)-nvl(OLD_HCE_BASE_REF_AMOUNT,0),
2117: WEIGHTED_AVG_PRINCIPAL = nvl(WEIGHTED_AVG_PRINCIPAL,0)
2118: -round(nvl(OLD_BASE_REF_AMOUNT,0)*

Line 2141: insert into XTR_COST_OF_FUNDS

2137: end if;
2138: else
2139: close CHK_LOCK_ROWS;
2140: -- insert new row
2141: insert into XTR_COST_OF_FUNDS
2142: (as_at_date,company_code,deal_type,
2143: deal_subtype,party_code,portfolio_code,product_type,
2144: currency,currency_combination,contra_ccy,
2145: account_no,created_on,

Line 2533: from XTR_COST_OF_FUNDS

2529: and a.deal_no = D.DEAL_NUMBER;
2530:
2531: cursor chk_date_exits is
2532: select 1
2533: from XTR_COST_OF_FUNDS
2534: where as_at_date = l_date;
2535:
2536: cursor bond_total_resale is
2537: select sum(face_value), max(cross_ref_start_date)

Line 3011: FROM xtr_cost_of_funds_v

3007: decode(Sum(gross_principal),0,0,
3008: (sum(interest) * 36500 /(sum(gross_principal)/(p_date_to-p_date_from+1))
3009: /(p_date_to - p_date_from +1))) avg_rate,
3010: Sum(no_of_deals) num_deals
3011: FROM xtr_cost_of_funds_v
3012: WHERE as_at_date BETWEEN p_date_from AND p_date_to
3013: AND company_code = p_company_code
3014: AND deal_type LIKE Nvl(p_deal_type,'%')
3015: AND ( (deal_type = 'NI' AND deal_subtype = 'BUY')

Line 3050: FROM xtr_cost_of_funds_v

3046: decode(Sum(gross_principal),0,0,
3047: (sum(interest) * 36500 /(sum(gross_principal)/(p_date_to-p_date_from+1))
3048: /(p_date_to - p_date_from +1))) avg_rate,
3049: Sum(no_of_deals) num_deals
3050: FROM xtr_cost_of_funds_v
3051: WHERE as_at_date BETWEEN p_date_from AND p_date_to
3052: AND company_code IN (SELECT p.party_code
3053: FROM xtr_parties_v p
3054: WHERE p.party_type = 'C')

Line 3090: FROM xtr_cost_of_funds_v

3086: decode(Sum(gross_principal),0,0,
3087: (sum(interest) * 36500 /(sum(gross_principal)/(p_date_to-p_date_from+1))
3088: /(p_date_to - p_date_from +1))) avg_rate,
3089: Sum(no_of_deals) num_deals
3090: FROM xtr_cost_of_funds_v
3091: WHERE as_at_date BETWEEN p_date_from AND p_date_to
3092: AND company_code = p_company_code
3093: AND deal_type LIKE Nvl(p_deal_type,'%')
3094: AND ( (deal_type = 'NI' AND deal_subtype = 'ISSUE')

Line 3128: FROM xtr_cost_of_funds_v

3124: decode(Sum(gross_principal),0,0,
3125: (sum(interest) * 36500 /(sum(gross_principal)/(p_date_to-p_date_from+1))
3126: /(p_date_to - p_date_from +1))) avg_rate,
3127: Sum(no_of_deals) num_deals
3128: FROM xtr_cost_of_funds_v
3129: WHERE as_at_date BETWEEN p_date_from AND p_date_to
3130: AND company_code IN (SELECT p.party_code
3131: FROM xtr_parties_v p
3132: WHERE p.party_type = 'C')

Line 3166: FROM xtr_cost_of_funds_v

3162: Sum(interest) interest,
3163: Decode(sum(gross_base_amount),0,0, Sum(gross_contra_trans_amount)/Sum(gross_base_amount)) avg_rate,
3164: Sum(no_of_deals) num_deals,
3165: Decode(Sum(gross_base_amount),0,0, Sum(gross_contra_spot_amount)/Sum(gross_base_amount)) avg_spot_rate
3166: FROM xtr_cost_of_funds_v
3167: WHERE as_at_date BETWEEN p_date_from AND p_date_to
3168: AND company_code = p_company_code
3169: AND deal_type LIKE Nvl(p_deal_type,'%')
3170: AND deal_type = 'FX'

Line 3201: FROM xtr_cost_of_funds_v

3197: Sum(interest) interest,
3198: Decode(sum(gross_base_amount),0,0, Sum(gross_contra_trans_amount)/Sum(gross_base_amount)) avg_rate,
3199: Sum(no_of_deals) num_deals,
3200: Decode(Sum(gross_base_amount),0,0, Sum(gross_contra_spot_amount)/Sum(gross_base_amount)) avg_spot_rate
3201: FROM xtr_cost_of_funds_v
3202: WHERE as_at_date BETWEEN p_date_from AND p_date_to
3203: AND company_code IN (SELECT p.party_code
3204: FROM xtr_parties_v p
3205: WHERE p.party_type = 'C')