The following lines contain the word 'select', 'insert', 'update' or 'delete':
t_delete_org_id OrgidTab;
SELECT per.organization_id organization_id
, hr.NAME name
FROM per_organization_list per
, hr_operating_units hr
WHERE per.security_profile_id = to_number(p_sp_id_char)
AND hr.organization_id = per.organization_id
AND hr.usable_flag is null;
SELECT hr.organization_id organization_id
, hr.name name
FROM hr_operating_units hr
WHERE hr.organization_id = to_number(p_org_id_char)
AND hr.usable_flag is null;
SELECT hr.organization_id organization_id
, hr.name name
FROM hr_operating_units hr
WHERE hr.business_group_id = X_bg_id
AND hr.usable_flag is null;
SELECT hr.organization_id organization_id
, hr.name name
FROM hr_operating_units hr
WHERE hr.usable_flag is null;
SELECT organization_id
FROM fnd_mo_sp_preferences
WHERE USER_ID = FND_GLOBAL.USER_ID
AND RESP_ID = FND_GLOBAL.RESP_ID;
SELECT security_profile_name
, business_group_id
, view_all_organizations_flag
INTO l_sp_name
, l_bg_id
, p_view_all_org
FROM per_security_profiles
WHERE security_profile_id = to_number(p_sp_id_char);
t_delete_org_id(l) := t_pref_org_id(i);
IF (t_delete_org_id.COUNT > 0) THEN
FORALL m IN t_delete_org_id.FIRST .. t_delete_org_id.LAST
delete from FND_MO_SP_PREFERENCES
where user_id = FND_GLOBAL.USER_ID
and resp_id = FND_GLOBAL.RESP_ID
and organization_id = t_delete_org_id(m);
IF(sync_ind = 'Y') AND ( t_delete_org_id.COUNT < t_pref_org_id.COUNT) THEN
FOR i IN t_common_org_id.FIRST .. t_common_org_id.LAST LOOP
INSERT
INTO mo_glob_org_access_tmp
(organization_id
, organization_name)
VALUES (t_common_org_id(i)
, t_common_ou_name(i));
INSERT
INTO mo_glob_org_access_tmp
(organization_id
, organization_name)
VALUES (t_org_id(i)
, t_ou_name(i));
'fnd.plsql.MO_GLOBAL.POPULATE_ORGS.temp_table_insert',
'Inserted '||g_ou_count||' record(s) into MO_GLOB_ORG_ACCESS_TMP');
PROCEDURE delete_orgs
IS
BEGIN
--
-- Remove all entries from the session specific temporary table.
-- Without this, when you switch responsibility you get ORA error
-- since the repopulation fails because of the unique constraint
-- violation.
--
IF (FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
FND_LOG.STRING(FND_LOG.LEVEL_EVENT,
'fnd.plsql.MO_GLOBAL.DELETE_ORGS.begin',
'Before flushing MO_GLOB_ORG_ACCESS_TMP');
DELETE FROM mo_glob_org_access_tmp;
'fnd.plsql.MO_GLOBAL.DELETE_ORGS.end',
'MO_GLOB_ORG_ACCESS_TMP was flushed');
generic_error('MO_GLOBAL.DELETE_ORGS', sqlcode, sqlerrm);
END delete_orgs;
SELECT nvl(multi_org_flag, 'N')
INTO g_multi_org_flag
FROM fnd_product_groups;
SELECT nvl(mpi.status, 'N')
INTO l_access_ctrl_enabled
FROM fnd_mo_product_init mpi
WHERE mpi.application_short_name = p_appl_short_name;
delete_orgs;
'fnd.plsql.MO_GLOBAL.SET_ORG_ACCESS.after_delete',
'Returning from PL/SQL procedure '||
'MO_GLOBAL.DELETE_ORGS ');
RETURN 'EXISTS (SELECT 1
FROM mo_glob_org_access_tmp oa
WHERE oa.organization_id = org_id)';
SELECT 'Y'
INTO l_org_exists
FROM mo_glob_org_access_tmp
WHERE organization_id = p_org_id;
SELECT organization_name
INTO l_ou_name
FROM mo_glob_org_access_tmp
WHERE organization_id = p_org_id;
RETURN '(EXISTS (SELECT 1
FROM mo_glob_org_access_tmp oa
WHERE oa.organization_id = org_id))
OR (org_id = -3116)';
PROCEDURE delete_organizations
IS
BEGIN
delete_orgs;
END delete_organizations;