DBA Data[Home] [Help]

APPS.QRM_PA_CALCULATION_P dependencies on QRM_DEAL_CALCULATIONS

Line 198: FROM qrm_deal_calculations

194:
195: CURSOR deal_threshold_ok(p_deal_no NUMBER,p_trans_no NUMBER,mds VARCHAR2,
196: p_threshold_date DATE) IS
197: SELECT deal_calc_id
198: FROM qrm_deal_calculations
199: WHERE deal_no = p_deal_no AND transaction_no = p_trans_no AND
200: market_data_set = mds AND
201: last_md_calc_date >= p_threshold_date;
202:

Line 206: FROM qrm_deal_calculations

202:
203: CURSOR deal_calculated(p_deal_no NUMBER, p_trans_no NUMBER,
204: mds VARCHAR2) IS
205: SELECT *
206: FROM qrm_deal_calculations
207: WHERE deal_no = p_deal_no AND transaction_no = p_trans_no AND
208: market_data_set = mds;
209:
210: CURSOR get_sequence_no IS

Line 1814: -- for qrm_deal_calculations table only

1810:
1811: FOR i IN p_deal_no_temp.count ..n_num_rows_fetched LOOP -- extend the temp tables
1812: -- END BUG 2945198 - sql binding
1813:
1814: -- for qrm_deal_calculations table only
1815: p_deal_no_temp.EXTEND;
1816: p_company_code_temp.EXTEND;
1817: p_transaction_no_temp.EXTEND;
1818: p_market_data_set_temp.EXTEND;

Line 6067: --- INSERT into QRM_DEAL_CALCULATIONS

6063:
6064: -- hit db iff no unhandled exceptions
6065: IF (retcode <> '2') THEN
6066: -- perform database DML
6067: --- INSERT into QRM_DEAL_CALCULATIONS
6068: IF (g_state_level>=g_debug_level) THEN --bug 3236479
6069: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to insert');
6070: for j in 1..p_insert_counter loop
6071: v_log := p_seq_nos(j)||';'||

Line 6081: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 1',v_log,

6077: p_foreign_amount_sob_insert(j)||';'|| p_domestic_amount_usd_insert(j)||';'||
6078: p_domestic_amount_sob_insert(j)||';'|| p_buy_amount_usd_insert(j)||';'||
6079: p_buy_amount_sob_insert(j)||';'|| p_sell_amount_usd_insert(j)||';'||
6080: p_sell_amount_sob_insert(j)||';'|| p_days_insert(j);
6081: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 1',v_log,
6082: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6083: v_log := p_fx_reval_rate_insert(j)||';'||p_mm_reval_rate_insert(j)||';'||
6084: p_fx_trans_rate_insert(j)||';'|| p_mm_trans_rate_insert(j)||';'||
6085: p_fair_value_insert(j)||';'|| p_fair_value_usd_insert(j)||';'||

Line 6092: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 2',v_log,

6088: p_maturity_amount_insert(j)||';'|| p_maturity_amount_usd_insert(j)||';'||
6089: p_maturity_amount_sob_insert(j)||';'|| p_premium_amount_usd_insert(j)||';'||
6090: p_premium_amount_sob_insert(j)||';'|| p_accrued_interest_insert(j)||';'||
6091: p_accrued_interest_usd_insert(j)||';'|| p_accrued_interest_sob_insert(j);
6092: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 2',v_log,
6093: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6094: v_log := p_duration_insert(j)||';'|| p_mod_duration_insert(j)||';'||
6095: p_convexity_insert(j)||';'|| p_delta_insert(j)||';'|| p_gamma_insert(j)||';'||
6096: p_theta_insert(j)||';'|| p_rho_insert(j)||';'|| p_rho_base_insert(j)||';'||

Line 6108: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 3',v_log,

6104: p_pos_rho_insert(j)||';'|| p_pos_rho_usd_insert(j)||';'||
6105: p_pos_rho_sob_insert(j)||';'|| p_pos_rho_base_insert(j)||';'||
6106: p_pos_rho_base_usd_insert(j)||';'|| p_pos_rho_base_sob_insert(j)||';'||
6107: p_pos_rho_contra_insert(j)||';'|| p_pos_rho_contra_usd_insert(j);
6108: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 3',v_log,
6109: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6110: v_log := p_pos_rho_contra_sob_insert(j)||';'|| p_pos_rho_for_insert(j)||';'||
6111: p_pos_rho_for_usd_insert(j)||';'|| p_pos_rho_for_sob_insert(j)||';'||
6112: p_pos_rho_dom_insert(j)||';'|| p_pos_rho_dom_usd_insert(j)||';'||

Line 6120: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 4',v_log,

6116: p_gap_date_insert(j)||';'|| p_reval_price_insert(j)||';'||
6117: p_reval_price_usd_insert(j)||';'|| p_reval_price_sob_insert(j)||';'||
6118: p_trans_price_insert(j)||';'|| p_trans_price_usd_insert(j)||';'||
6119: p_trans_price_sob_insert(j)||';'|| p_ref_datetime;
6120: XTR_RISK_DEBUG_PKG.dlog('INSERT QRM_DEAL_CALCULATIONS Line 4',v_log,
6121: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6122: end loop;
6123: END IF;
6124:

Line 6126: INSERT INTO qrm_deal_calculations (deal_calc_id, deal_no,

6122: end loop;
6123: END IF;
6124:
6125: FORALL j IN 1..p_insert_counter
6126: INSERT INTO qrm_deal_calculations (deal_calc_id, deal_no,
6127: transaction_no, market_data_set, deal_ccy, sob_ccy,
6128: base_ccy_amount_usd, base_ccy_amount_sob, contra_ccy_amount_usd,
6129: contra_ccy_amount_sob, foreign_amount_usd, foreign_amount_sob,
6130: domestic_amount_usd, domestic_amount_sob, buy_amount_usd,

Line 6204: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_CALCULATIONS',

6200: FND_GLOBAL.conc_request_id, FND_GLOBAL.prog_appl_id,
6201: FND_GLOBAL.conc_program_id, p_ref_datetime);
6202:
6203: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6204: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_CALCULATIONS',
6205: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6206: END IF;
6207:
6208: --- UPDATE QRM_DEAL_CALCULATIONS

Line 6208: --- UPDATE QRM_DEAL_CALCULATIONS

6204: XTR_RISK_DEBUG_PKG.dlog('DML','INSERTED QRM_DEAL_CALCULATIONS',
6205: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6206: END IF;
6207:
6208: --- UPDATE QRM_DEAL_CALCULATIONS
6209: IF (g_state_level>=g_debug_level) THEN --bug 3236479
6210: --XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'about to update');
6211: XTR_RISK_DEBUG_PKG.dlog('run_analysis: ' || 'p_update_counter: '|| p_update_counter);
6212: for j in 1..p_update_counter loop

Line 6221: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 1',v_log,

6217: p_foreign_amount_sob_update(j)||';'|| p_domestic_amount_usd_update(j)||';'||
6218: p_domestic_amount_sob_update(j)||';'|| p_buy_amount_usd_update(j)||';'||
6219: p_buy_amount_sob_update(j)||';'|| p_sell_amount_usd_update(j)||';'||
6220: p_sell_amount_sob_update(j)||';'|| p_days_update(j);
6221: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 1',v_log,
6222: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6223: v_log := p_fx_reval_rate_update(j)||';'||p_mm_reval_rate_update(j)||';'||
6224: p_fx_trans_rate_update(j)||';'|| p_mm_trans_rate_update(j)||';'||
6225: p_fair_value_update(j)||';'|| p_fair_value_usd_update(j)||';'||

Line 6232: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 2',v_log,

6228: p_maturity_amount_update(j)||';'|| p_maturity_amount_usd_update(j)||';'||
6229: p_maturity_amount_sob_update(j)||';'|| p_premium_amount_usd_update(j)||';'||
6230: p_premium_amount_sob_update(j)||';'|| p_accrued_interest_update(j)||';'||
6231: p_accrued_interest_usd_update(j)||';'|| p_accrued_interest_sob_update(j);
6232: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 2',v_log,
6233: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6234: v_log := p_duration_update(j)||';'|| p_mod_duration_update(j)||';'||
6235: p_convexity_update(j)||';'|| p_delta_update(j)||';'|| p_gamma_update(j)||';'||
6236: p_theta_update(j)||';'|| p_rho_update(j)||';'|| p_rho_base_update(j)||';'||

Line 6248: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 3',v_log,

6244: p_pos_rho_update(j)||';'|| p_pos_rho_usd_update(j)||';'||
6245: p_pos_rho_sob_update(j)||';'|| p_pos_rho_base_update(j)||';'||
6246: p_pos_rho_base_usd_update(j)||';'|| p_pos_rho_base_sob_update(j)||';'||
6247: p_pos_rho_contra_update(j)||';'|| p_pos_rho_contra_usd_update(j);
6248: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 3',v_log,
6249: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6250: v_log := p_pos_rho_contra_sob_update(j)||';'|| p_pos_rho_for_update(j)||';'||
6251: p_pos_rho_for_usd_update(j)||';'|| p_pos_rho_for_sob_update(j)||';'||
6252: p_pos_rho_dom_update(j)||';'|| p_pos_rho_dom_usd_update(j)||';'||

Line 6260: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 4',v_log,

6256: p_gap_date_update(j)||';'|| p_reval_price_update(j)||';'||
6257: p_reval_price_usd_update(j)||';'|| p_reval_price_sob_update(j)||';'||
6258: p_trans_price_update(j)||';'|| p_trans_price_usd_update(j)||';'||
6259: p_trans_price_sob_update(j)||';'|| p_ref_datetime;
6260: XTR_RISK_DEBUG_PKG.dlog('update QRM_DEAL_CALCULATIONS Line 4',v_log,
6261: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_state_level);
6262: end loop;
6263: END IF;
6264:

Line 6266: UPDATE qrm_deal_calculations

6262: end loop;
6263: END IF;
6264:
6265: FORALL j IN 1..p_update_counter
6266: UPDATE qrm_deal_calculations
6267: SET
6268: deal_ccy=p_deal_ccy_update(j), sob_ccy=p_sob_ccy_update(j),
6269: base_ccy_amount_usd= p_base_ccy_amount_usd_update(j),
6270: base_ccy_amount_sob=p_base_ccy_amount_sob_update(j),

Line 6356: XTR_RISK_DEBUG_PKG.dlog('DML','UPDATED QRM_DEAL_CALCULATIONS',

6352: program_update_date=p_ref_datetime
6353: WHERE deal_calc_id = p_deal_calc_id_update(j);
6354:
6355: IF (g_event_level>=g_debug_level) THEN --bug 3236479
6356: XTR_RISK_DEBUG_PKG.dlog('DML','UPDATED QRM_DEAL_CALCULATIONS',
6357: 'QRM_PA_CALCULATION_P.RUN_ANALYSIS',g_event_level);
6358: END IF;
6359:
6360: -- UPDATE QRM_DEALS_ANALYSES

Line 7055: FROM qrm_deal_calculations

7051:
7052: -- get calculated deals that have matured
7053: CURSOR get_expired_ids IS
7054: SELECT deal_calc_id, deal_no, transaction_no
7055: FROM qrm_deal_calculations
7056: WHERE (deal_no, transaction_no) IN
7057: (SELECT deal_no, transaction_no
7058: FROM qrm_current_deals_v
7059: WHERE nvl(end_date, p_ref_date+1) < p_ref_date);

Line 7064: FROM qrm_deal_calculations

7060:
7061: -- get calculated deals are no longer open
7062: /* CURSOR get_old_deal_ids IS
7063: SELECT deal_calc_id, deal_no, transaction_no
7064: FROM qrm_deal_calculations
7065: WHERE (deal_no, transaction_no) NOT IN
7066: (SELECT deal_no, transaction_no
7067: FROM qrm_current_deals_v); Bug 4965436 */
7068:

Line 7072: FROM qrm_deal_calculations qdc

7068:
7069: -- get calculated deals are no longer open
7070: CURSOR get_old_deal_ids IS
7071: SELECT deal_calc_id, deal_no, transaction_no
7072: FROM qrm_deal_calculations qdc
7073: WHERE NOT EXISTS ( select 'x'
7074: from qrm_current_deals_v qcdv
7075: where qcdv.deal_no = qdc.deal_no
7076: and qcdv.transaction_no = qdc.transaction_no ) ;

Line 7107: FROM qrm_deal_calculations

7103: END LOOP;
7104:
7105: FORALL i IN 1..p_deal_calc_ids.COUNT
7106: DELETE
7107: FROM qrm_deal_calculations
7108: WHERE deal_calc_id=p_deal_calc_ids(i);
7109:
7110: FORALL i IN 1..p_deal_nos.COUNT
7111: DELETE