The following lines contain the word 'select', 'insert', 'update' or 'delete':
:= 'SUCCESS:'||'DATA_LAST_UPDATE_DATE='
|| get_last_updated_date_msg(get_mv_last_refresh_date('HRI_MDP_SUP_WRKFC_JX_MV'));
SELECT last_refresh_date
FROM dba_mviews
WHERE mview_name = p_mv_name
AND owner = g_schema ;
** "Data Last Updated: DD-MON-YYYY"
**/
FUNCTION get_last_updated_date_msg (p_date_token DATE) RETURN VARCHAR2
IS
BEGIN
fnd_message.set_name('BIS', 'BIS_PMV_LAST_UPDATE_DATE');
END get_last_updated_date_msg;
SELECT 1
FROM hri_cs_suph suph
WHERE trunc(p_effective_date) BETWEEN suph.effective_start_date AND effective_end_date
AND suph.sup_person_id = p_top_mgr_person_id
AND suph.sub_person_id = p_lower_mgr_person_id
AND suph.sub_invalid_flag_code = 'N';
'SELECT' || g_rtn ||
'SUPERVISOR_PERSON_ID' || ' SUPERVISOR_PERSON_ID' || g_rtn ||
',JOB_ID' || ' JOB_ID' || g_rtn ||
',''' || p_parameter_rec.currency_code_to || '''' || ' SAL_CURRENCY_CODE'|| g_rtn ||
',SUM(fact.total_headcount) TOTAL_HEADCOUNT' || g_rtn ||
',MIN(hri_oltp_view_currency.convert_currency_amount(
fact.anl_slry_currency,
''' || p_parameter_rec.currency_code_to || ''',
to_date(''' || p_parameter_rec.effective_date || ''',''MM/DD/YYYY''),
fact.min_anl_slry,
'''||g_curr_conv_rate_type||''')) MIN_ANL_SLRY'|| g_rtn ||
',MAX(hri_oltp_view_currency.convert_currency_amount(
fact.anl_slry_currency,
''' || p_parameter_rec.currency_code_to || ''',
to_date(''' || p_parameter_rec.effective_date || ''',''MM/DD/YYYY''),
fact.max_anl_slry,
'''||g_curr_conv_rate_type||''')) MAX_ANL_SLRY'|| g_rtn ||
',SUM(hri_oltp_view_currency.convert_currency_amount(
fact.anl_slry_currency,
''' || p_parameter_rec.currency_code_to || ''',
to_date(''' || p_parameter_rec.effective_date || ''',''MM/DD/YYYY''),
fact.total_anl_slry,
'''||g_curr_conv_rate_type||''')) TOTAL_ANL_SLRY' || g_rtn ||
-- bug 4888622 - check for invalid currency conversions
',SUM(CASE WHEN(hri_oltp_view_currency.convert_currency_amount(
fact.anl_slry_currency,
''' || p_parameter_rec.currency_code_to || ''',
to_date(''' || p_parameter_rec.effective_date || ''',''MM/DD/YYYY''),
fact.total_anl_slry,
'''||g_curr_conv_rate_type||''') = -1)
THEN 1 END) INVALID_CURR_CONV_IND';
'SELECT ' || g_rtn ||
l_decode_label ||
',qry.supervisor_person_id SUPERVISOR_PERSON_ID
,qry.job_id JOB_ID' || g_rtn ||
',''' || p_parameter_rec.currency_code_to || '''' || ' SAL_CURRENCY_CODE'|| g_rtn ||
',TO_CHAR(qry.total_headcount) TOTAL_HEADCOUNT
,TO_CHAR(DECODE(qry.INVALID_CURR_CONV_IND, 1, -1,qry.max_anl_slry),'''||g_sal_amount_fmt||''') MAX_ANL_SLRY
,TO_CHAR(DECODE(qry.INVALID_CURR_CONV_IND, 1, -1,qry.min_anl_slry),'''||g_sal_amount_fmt||''') MIN_ANL_SLRY
,TO_CHAR(DECODE(qry.INVALID_CURR_CONV_IND, 1, -1,qry.total_anl_slry),'''||g_sal_amount_fmt||''') TOTAL_ANL_SLRY
,TO_CHAR(DECODE(qry.INVALID_CURR_CONV_IND, 1, -1,
DECODE(qry.total_headcount, 0, 0
,(qry.total_anl_slry/qry.total_headcount))
),'''||g_sal_amount_fmt||''') WEIGHTED_AVG_SAL' || g_rtn ||
'FROM' || g_rtn;