The following lines contain the word 'select', 'insert', 'update' or 'delete':
* The checking of the last_update_date of pa_org_hierarchy_denorm is
* to find if the the organization hierarchy changed during the run.
*/
SELECT max(LAST_UPDATE_DATE)
INTO l_orghier_date_before
FROM pa_org_hierarchy_denorm
WHERE pa_org_use_type = 'REPORTING'
AND NVL(org_id, -99) = pa_rep_util_glob.G_implementation_details.G_org_id
AND ORG_HIERARCHY_VERSION_ID = pa_rep_util_glob.G_implementation_details.G_org_structure_version_id
;
PA_DEBUG.g_err_stage := '310 : Max Last_Update_Date of pa_org_hierarchy_denorm before the run is <'||l_orghier_date_before||'>';
SELECT max(LAST_UPDATE_DATE)
INTO l_orghier_date_after
FROM pa_org_hierarchy_denorm
WHERE pa_org_use_type = 'REPORTING'
AND NVL(org_id, -99) = pa_rep_util_glob.G_implementation_details.G_org_id
AND ORG_HIERARCHY_VERSION_ID = pa_rep_util_glob.G_implementation_details.G_org_structure_version_id
;
PA_DEBUG.g_err_stage := '310 : Max Last_Update_Date of pa_org_hierarchy_denorm after the run is <'||l_orghier_date_after||'>';
* The checking of the last_update_date of pa_org_hierarchy_denorm is
* to find if the the organization hierarchy changed during the run.
*/
SELECT max(LAST_UPDATE_DATE)
INTO l_orghier_date_before
FROM pa_org_hierarchy_denorm
WHERE pa_org_use_type = 'REPORTING'
AND NVL(org_id, -99) = pa_rep_util_glob.G_implementation_details.G_org_id
AND ORG_HIERARCHY_VERSION_ID = pa_rep_util_glob.G_implementation_details.
G_org_structure_version_id
;
PA_DEBUG.g_err_stage := '300 : Max Last_Update_Date of pa_org_hierarchy_denorm before the run is <'||l_orghier_date_before||'>';
SELECT max(LAST_UPDATE_DATE)
INTO l_orghier_date_after
FROM pa_org_hierarchy_denorm
WHERE pa_org_use_type = 'REPORTING'
AND NVL(org_id, -99) = pa_rep_util_glob.G_implementation_details.G_org_id
AND ORG_HIERARCHY_VERSION_ID = pa_rep_util_glob.G_implementation_details.G_org_structure_version_id
;
PA_DEBUG.g_err_stage := '310 : Max Last_Update_Date of pa_org_hierarchy_denorm after the run is <'||l_orghier_date_after||'>';
SELECT (g.period_year*10000) + g.period_num
INTO effective_start_period_num
FROM gl_date_period_map map
,gl_periods g
-- WHERE g.period_set_name = G_implementation_details.G_period_set_name
WHERE g.period_set_name = p_period_set_name --bug 3434019
AND g.period_name = map.period_name
AND map.accounting_date = p_start_date
AND map.period_type = p_period_type
-- AND map.period_set_name = G_implementation_details.G_period_set_name;
G_who_columns.G_last_updated_by := FND_GLOBAL.USER_ID;
G_who_columns.G_last_update_date := G_who_columns.G_creation_date;
G_who_columns.G_last_update_login := FND_GLOBAL.LOGIN_ID;
PA_DEBUG.g_err_stage := '200 : Before Selecting Implementation Details';
SELECT NVL(imp.org_id,-99)
,imp.org_structure_version_id
,imp.start_organization_id
,imp.pa_period_type
,sob.accounted_period_type
,sob.period_set_name
,imp.period_set_name --bug 3434019
INTO G_implementation_details.G_org_id
,G_implementation_details.G_org_structure_version_id
,G_implementation_details.G_start_organization_id
,G_implementation_details.G_pa_period_type
,G_implementation_details.G_gl_period_type
,G_implementation_details.G_gl_period_set_name --bug 3434019
,G_implementation_details.G_pa_period_set_name --bug 3434019
FROM pa_implementations imp
,gl_sets_of_books sob
WHERE sob.set_of_books_id = imp.set_of_books_id ;
PA_DEBUG.g_err_stage := '250 : After Selecting Implementation Details';
SELECT pa_period_flag
,gl_period_flag
,global_exp_period_flag
,forecast_thru_date
,actuals_thru_date
INTO G_util_option_details.G_pa_period_flag
,G_util_option_details.G_gl_period_flag
,G_util_option_details.G_ge_period_flag
,G_util_option_details.G_forecast_thru_date
,G_util_option_details.G_actuals_thru_date
FROM pa_utilization_options;
SELECT actuals_last_run_date
,forecast_last_run_date
INTO G_last_run_when.G_ac_last_run_date
,G_last_run_when.G_fc_last_run_date
FROM pa_utilization_options;
PROCEDURE update_util_cache
IS
l_global_week_start_day PLS_INTEGER;
PA_DEBUG.Set_Curr_Function( p_function => 'Update_Util_Cache');
PA_DEBUG.g_err_stage := '50 : Entering PA_REP_UTIL_GLOB.update_util_cache';
PA_DEBUG.g_err_stage := '200 : Before Selecting Implementation Details';
SELECT NVL(imp.org_id,-99)
,imp.org_structure_version_id
,imp.start_organization_id
,imp.pa_period_type
,sob.accounted_period_type
,sob.period_set_name
,imp.period_set_name
INTO l_org_id
,l_org_structure_version_id
,l_start_organization_id
,l_pa_period_type
,l_gl_period_type
-- ,l_period_set_name
,l_gl_period_set_name -- bug 3434019
,l_pa_period_set_name -- bug 3434019
FROM pa_implementations imp
,gl_sets_of_books sob
WHERE sob.set_of_books_id = imp.set_of_books_id ;
PA_DEBUG.g_err_stage := '250 : After Selecting Implementation Details';
G_who_columns.G_last_updated_by := FND_GLOBAL.USER_ID;
G_who_columns.G_last_update_date := G_who_columns.G_creation_date;
G_who_columns.G_last_update_login := FND_GLOBAL.LOGIN_ID;
SELECT pa_period_flag
,gl_period_flag
,global_exp_period_flag
,forecast_thru_date
,actuals_thru_date
,actuals_last_run_date
,forecast_last_run_date
INTO G_util_option_details.G_pa_period_flag
,G_util_option_details.G_gl_period_flag
,G_util_option_details.G_ge_period_flag
,G_util_option_details.G_forecast_thru_date
,G_util_option_details.G_actuals_thru_date
,G_last_run_when.G_ac_last_run_date
,G_last_run_when.G_fc_last_run_date
FROM pa_utilization_options;
PA_DEBUG.g_err_stage := '500 : Exiting PA_REP_UTIL_GLOB.update_util_cache';
END update_util_cache;