The following lines contain the word 'select', 'insert', 'update' or 'delete':
CURSOR cCol IS SELECT forecast_column_id, column_number, days_from, days_to
FROM ce_forecast_columns
WHERE forecast_header_id = XTR_CASH_FCST.G_rp_forecast_header_id;
SELECT gps.period_name
INTO history_period
FROM gl_periods gps,
gl_periods gp,
gl_period_types gpt
WHERE gps.period_num =DECODE(LEAST(gp.period_num-XTR_CASH_FCST.G_roll_forward_period,1),
1,gp.period_num - XTR_CASH_FCST.G_roll_forward_period,
gpt.number_per_fiscal_year +
mod(gp.period_num-XTR_CASH_FCST.G_roll_forward_period,gpt.number_per_fiscal_year))
AND gps.period_year = gp.period_year +
DECODE(LEAST(gp.period_num-XTR_CASH_FCST.G_roll_forward_period,1),1,0,
DECODE(mod(gp.period_num-XTR_CASH_FCST.G_roll_forward_period,gpt.number_per_fiscal_year),0,
FLOOR((gp.period_num -XTR_CASH_FCST.G_roll_forward_period)/gpt.number_per_fiscal_year)-1,
FLOOR((gp.period_num -XTR_CASH_FCST.G_roll_forward_period)/gpt.number_per_fiscal_year)))
AND gp.period_set_name = gps.period_set_name
AND gps.period_type = gp.period_type
AND gpt.period_type = gp.period_type
AND gp.period_name = XTR_CASH_FCST.G_rp_forecast_start_period
AND gp.period_set_name = CEFC_VIEW_CONST.get_period_set_name;
SELECT period_number,
level_of_summary,
length_of_period,
length_type
FROM xtr_forecast_periods_v
ORDER BY period_number;
DELETE FROM xtr_forecast_period_temp;
XTR_DEBUG_PKG.DEBUG('EXCEPTION:populate_temp_buckets-->delete');
INSERT INTO xtr_forecast_period_temp(forecast_period_temp_id, start_date, end_date, level_of_summary)
VALUES (l_period_id, l_start_date, l_start, 'D');
INSERT INTO xtr_forecast_period_temp(forecast_period_temp_id, start_date, end_date, level_of_summary)
VALUES (l_period_id, l_od_start, l_start, 'D');
INSERT INTO xtr_forecast_period_temp(forecast_period_temp_id, start_date, end_date, level_of_summary)
VALUES (l_period_id, l_start_date, l_end, 'W');
INSERT INTO xtr_forecast_period_temp(forecast_period_temp_id, start_date, end_date, level_of_summary)
VALUES (l_period_id, l_start_date, l_end, 'M');
CURSOR C1 IS select forecast_period_temp_id, start_date, end_date
from xtr_forecast_period_temp;
select max(transaction_date)+1
into new_start_date
from gl_transaction_dates
where transaction_calendar_id = XTR_CASH_FCST.G_transaction_calendar_id
and transaction_date < start_date
and business_day_flag = 'Y';
select max(transaction_date)
into new_end_date
from gl_transaction_dates
where transaction_calendar_id = XTR_CASH_FCST.G_transaction_calendar_id
and transaction_date <= end_date
and business_day_flag = 'Y';
UPDATE xtr_forecast_period_temp
SET start_date = new_start_date,
end_date = new_end_date
WHERE forecast_period_temp_id = fid;
delete from xtr_forecast_period_temp;
XTR_DEBUG_PKG.DEBUG('EXCEPTION:clear_aging_buckets-->delete');
| Get Select Clause |
| |
| DESCRIPTION |
| Builds Select clause and returns it to calling procedure |
| CALLED BY |
| Build_XXX_Query |
| REQUIRES |
| |
| HISTORY |
| 19-AUG-1996 Created Bidemi Carrol |
--------------------------------------------------------------------- */
FUNCTION Get_Select_Clause RETURN VARCHAR2 IS
select_clause VARCHAR2(300);
select_clause := '
SELECT cab.forecast_period_temp_id,
src.currency_code,
SUM(src.amount),
src.bank_account_id ';
select_clause := '
SELECT cab.forecast_period_temp_id,
src.currency_code,
SUM(src.amount) ';
xtr_debug_pkg.debug(select_clause);
return select_clause;
END Get_Select_Clause;
SELECT nvl(derive_type, 'NONE')
FROM gl_currencies
WHERE currency_code(+) = p_cur;
SELECT end_date,
level_of_summary
FROM xtr_forecast_period_temp
WHERE forecast_period_temp_id = p_pid;
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id,
XTR_CASH_FCST.G_rp_forecast_header_id, XTR_CASH_FCST.G_forecast_row_id,
'GL_JE_INVALID_CONVERSION_INFO', error_msg);
INSERT INTO xtr_external_cashflows(amount_date,
amount,
currency,
company_code,
trx_type,
ap_bank_account_id,
level_of_summary)
VALUES (amount_date,
nvl(forecast_amount,0),
currency,
XTR_CASH_FCST.G_party_code,
XTR_CASH_FCST.G_trx_type,
bank_account_id,
level_of_summary);
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
UPDATE ce_forecasts
SET error_status = 'E'
WHERE forecast_id = CE_CASH_FCST.G_forecast_id;
CE_FORECAST_ERRORS_PKG.insert_row(
CE_CASH_FCST.G_forecast_id,
CE_CASH_FCST.G_rp_forecast_header_id,
CE_CASH_FCST.G_forecast_row_id,
'CE_NO_HIST_START_PERIOD',
error_msg);
main_query := select_clause || from_clause || where_clause || group_clause;
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
main_query := select_clause || from_clause || where_clause || group_clause;
select_clause varchar2(500);
select_clause := ' SELECT cab.forecast_period_temp_id,
src.currency_code,
SUM(src.amount-src.dispute_amount) ';
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
xtr_debug_pkg.debug(select_clause);
main_query := select_clause || from_clause || where_clause ||group_clause;
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
UPDATE ce_forecasts
SET error_status = 'E'
WHERE forecast_id = CE_CASH_FCST.G_forecast_id;
CE_FORECAST_ERRORS_PKG.insert_row(
CE_CASH_FCST.G_forecast_id,
CE_CASH_FCST.G_rp_forecast_header_id,
CE_CASH_FCST.G_forecast_row_id,
'CE_NO_HIST_START_PERIOD',
error_msg);
main_query := select_clause || from_clause || where_clause ||group_clause;
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
UPDATE ce_forecasts
SET error_status = 'E'
WHERE forecast_id = CE_CASH_FCST.G_forecast_id;
CE_FORECAST_ERRORS_PKG.insert_row(
CE_CASH_FCST.G_forecast_id,
CE_CASH_FCST.G_rp_forecast_header_id,
CE_CASH_FCST.G_forecast_row_id,
'CE_NO_HIST_START_PERIOD',
error_msg);
main_query := select_clause || from_clause || where_clause || group_clause;
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
main_query := select_clause || from_clause || where_clause || group_clause;
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
main_query := select_clause || from_clause || where_clause || group_clause;
select_clause varchar2(300);
select_clause := Get_Select_Clause;
xtr_debug_pkg.debug('Built Select Clause');
main_query := select_clause || from_clause || where_clause || group_clause;
SELECT external_source_view, db_link_name
INTO source_view, db_link
FROM ce_forecast_ext_views
WHERE external_source_type = XTR_CASH_FCST.G_external_source_type;
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id, XTR_CASH_FCST.G_rp_forecast_header_id,
XTR_CASH_FCST.G_forecast_row_id, 'CE_FC_EXT_SOURCE_UNDEFINED', error_msg);
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id, XTR_CASH_FCST.G_rp_forecast_header_id,
XTR_CASH_FCST.G_forecast_row_id, ''CE_FC_RMT_MISSING_VIEW_EXPT'', error_msg);
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id, XTR_CASH_FCST.G_rp_forecast_header_id,
XTR_CASH_FCST.G_forecast_row_id, ''CE_FC_RMT_INVALID_VIEW_EXPT'', error_msg);
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id, XTR_CASH_FCST.G_rp_forecast_header_id,
XTR_CASH_FCST.G_forecast_row_id, ''CE_FC_RMT_EXCEPTION'', error_msg);
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id, XTR_CASH_FCST.G_rp_forecast_header_id,
XTR_CASH_FCST.G_forecast_row_id, 'CE_FC_RMT_DB_EXCEPTION', error_msg);
CE_FORECAST_ERRORS_PKG.insert_row(XTR_CASH_FCST.G_forecast_id, XTR_CASH_FCST.G_rp_forecast_header_id,
XTR_CASH_FCST.G_forecast_row_id, 'CE_FC_RMT_EXCEPTION', error_msg);