The following lines contain the word 'select', 'insert', 'update' or 'delete':
select ENT_PERIOD_ID into period_id from fii_time_ent_period where sysdate
between START_DATE and END_DATE;
FUNCTION get_display_currency(p_selected_operating_unit IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
IF g_sec_profile is null then
g_sec_profile := nvl(fnd_profile.value('XLA_MO_SECURITY_PROFILE_LEVEL'), -1);
IF(p_selected_operating_unit <> 'ALL') then
IF (g_operating_unit is null or g_operating_unit <> p_selected_operating_unit) THEN
g_operating_unit := p_selected_operating_unit;
select currency_code
into g_functional_currency_code
from financials_system_params_all fsp,
gl_ledgers_public_v gsob
where fsp.org_id = p_selected_operating_unit
and fsp.set_of_books_id = gsob.ledger_id;
g_all_operating_unit := p_selected_operating_unit; ---gets set a value for the first run
select distinct currency_code
into g_common_functional_currency
from financials_system_params_all fsp,
gl_ledgers_public_v gsob
where fsp.set_of_books_id = gsob.ledger_id
AND (
(
g_det_ou_lov=1 AND fsp.org_id = fsp.org_id
)
OR (
g_det_ou_lov=2
AND fsp.org_id in (
SELECT organization_id
FROM hr_operating_units
WHERE business_group_id = fii_pmv_util.g_business_group_id
)
)
OR (
g_det_ou_lov=3
AND fsp.org_id in (
SELECT organization_id
FROM per_organization_list
WHERE security_profile_id = g_sec_profile
)
)
OR(
g_det_ou_lov=4 AND fsp.org_id = nvl(fnd_profile.value('ORG_ID'), -1)
)
);
p_table_name := '(select organization_id id, name value from hr_all_organization_units)';
p_table_name := '(select id, value from POA_SUPPLIERS_V)';
SELECT view_all_organizations_flag, business_group_id
INTO l_all_org_flag, l_business_group_id
FROM per_security_profiles
WHERE security_profile_id = g_security_profile_id;
SELECT COUNT(1) INTO l_org_count
FROM hr_operating_units hr, ap_system_parameters_all ap
WHERE hr.business_group_id = l_business_group_id
AND hr.organization_id = ap.org_id;
p_org_where := ' and f.org_id in (select organization_id from hr_operating_units hr, ap_system_parameters_all ap where hr.business_group_id = :BUSINESS_GROUP and hr.organization_id = ap.org_id) ';
FOR C1_Rec in (select organization_id from hr_operating_units hr, ap_system_parameters_all ap where hr.business_group_id = l_business_group_id and hr.organization_id = ap.org_id)
LOOP
l_org_list := l_org_list||C1_Rec.organization_id||',';
SELECT organization_id INTO l_org_id FROM hr_operating_units hr, ap_system_parameters_all ap WHERE hr.business_group_id = l_business_group_id AND hr.organization_id = ap.org_id;
SELECT COUNT(1)
INTO l_org_count
FROM per_organization_list per, ap_system_parameters_all ap
WHERE per.security_profile_id = g_security_profile_id
AND per.organization_id = ap.org_id;
p_org_where := ' and f.org_id in (select organization_id from per_organization_list per, ap_system_parameters_all ap where per.security_profile_id = :SEC_ID and per.organization_id = ap.org_id) ';
FOR C1_Rec in (select organization_id from per_organization_list per, ap_system_parameters_all ap where per.security_profile_id = g_security_profile_id and per.organization_id = ap.org_id)
LOOP
l_org_list := l_org_list||C1_Rec.organization_id||',';
SELECT organization_id INTO l_org_id FROM per_organization_list per, ap_system_parameters_all ap WHERE security_profile_id = g_security_profile_id AND per.organization_id = ap.org_id;
select (to_date(l_as_of_date,'DD-MM-YYYY') - start_date) into p_days_into_period from fii_time_week where week_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_period where ent_period_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_qtr where ent_qtr_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_year where ent_year_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_week where week_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_period where ent_period_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_qtr where ent_qtr_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_year where ent_year_id = p_cur_period;
select (l_as_of_date - start_date) into p_days_into_period from fii_time_ent_year where ent_year_id = p_cur_period;
select week_id into p_cur_period from fii_time_day where report_date=l_as_of_date;
select ent_period_id into p_cur_period from fii_time_day where report_date=l_as_of_date;
select ent_qtr_id into p_cur_period from fii_time_day where report_date=l_as_of_date;
select ent_year_id into p_cur_period from fii_time_day where report_date=l_as_of_date;
SELECT view_all_organizations_flag, business_group_id
INTO l_all_org_flag, l_business_group_id
FROM per_security_profiles
WHERE security_profile_id = g_security_profile_id;
SELECT business_group_id
INTO l_business_group_id
FROM per_security_profiles
WHERE security_profile_id = g_security_profile_id;