The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT start_date_active, end_date_active, name
FROM cn_comp_groups
WHERE comp_group_id = p_group_id;
SELECT cscg.salesrep_id,
cscg.comp_group_id,
intel.period_id,
greatest(cscg.start_date_active, intel.start_date) start_date,
decode(cscg.end_date_active, null, intel.end_date,
Least(cscg.end_date_active, intel.end_date)) end_date
FROM cn_srp_comp_groups_v cscg,
cn_srp_intel_periods intel
WHERE cscg.comp_group_id = p_group_id
and intel.salesrep_id = cscg.salesrep_id
and cscg.start_date_active <= intel.end_date
and (cscg.end_date_active is null or cscg.end_date_active >= intel.start_date);
SELECT p.period_id,
greatest(p_start_date, p.start_date) start_date,
Decode(p_end_date, NULL, p.end_date, Least(p_end_date, p.end_date)) end_date
FROM cn_srp_intel_periods p
WHERE p.salesrep_id = p_salesrep_id
AND (p_end_date IS NULL OR p.start_date <= p_end_date)
AND (p.end_date >= p_start_date);
select ct.name name,
ct.comp_team_id team_id,
greatest(cg.start_date_active, ct.start_date_active) start_date,
Least(nvl(ct.end_date_active, l_max_date), nvl(cg.end_date_active, l_max_date)) end_date
from cn_srp_comp_teams_v srt, cn_comp_teams ct, cn_comp_groups cg
where srt.salesrep_id = p_salesrep_id
and srt.comp_team_id = ct.comp_team_id
and cg.comp_group_id = p_group_id
and (cg.start_date_active <= ct.start_date_active
or cg.start_date_active between ct.start_date_active and nvl (ct.end_date_active, cg.start_date_active))
and nvl(cg.end_date_active, ct.start_date_active) >= ct.start_date_active;
SELECT org_id FROM cn_repositories_all WHERE status = 'A';
l_srp_tbl.DELETE;
/* Vertcal Industry Procedure for pre processing in case of delete resource group usage */
PROCEDURE delete_group_usage_pre
(P_GROUP_ID IN NUMBER,
P_USAGE IN VARCHAR2,
X_RETURN_STATUS OUT NOCOPY VARCHAR2
) IS
l_event_log_id NUMBER;
l_api_name VARCHAR2(30) := 'delete_group_usage_pre';
SELECT start_date_active, end_date_active, name
FROM cn_comp_groups
WHERE comp_group_id = p_group_id;
SELECT cscg.salesrep_id,
cscg.comp_group_id,
intel.period_id,
greatest(cscg.start_date_active, intel.start_date) start_date,
decode(cscg.end_date_active, null, intel.end_date,
Least(cscg.end_date_active, intel.end_date)) end_date
FROM cn_srp_comp_groups_v cscg,
cn_srp_intel_periods intel
WHERE cscg.comp_group_id = p_group_id
and intel.salesrep_id = cscg.salesrep_id
and cscg.start_date_active <= intel.end_date
and (cscg.end_date_active is null or cscg.end_date_active >= intel.start_date);
SELECT p.period_id,
greatest(p_start_date, p.start_date) start_date,
Decode(p_end_date, NULL, p.end_date, Least(p_end_date, p.end_date)) end_date
FROM cn_srp_intel_periods p
WHERE p.salesrep_id = p_salesrep_id
AND (p_end_date IS NULL OR p.start_date <= p_end_date)
AND (p.end_date >= p_start_date);
select ct.name name,
ct.comp_team_id team_id,
greatest(cg.start_date_active, ct.start_date_active) start_date,
Least(nvl(ct.end_date_active, l_max_date), nvl(cg.end_date_active, l_max_date)) end_date
from cn_srp_comp_teams_v srt, cn_comp_teams ct, cn_comp_groups cg
where srt.salesrep_id = p_salesrep_id
and srt.comp_team_id = ct.comp_team_id
and cg.comp_group_id = p_group_id
and (cg.start_date_active <= ct.start_date_active
or cg.start_date_active between ct.start_date_active and nvl (ct.end_date_active, cg.start_date_active))
and nvl(cg.end_date_active, ct.start_date_active) >= ct.start_date_active;
SELECT org_id FROM cn_repositories_all WHERE status = 'A';
( p_event_name => 'CHANGE_CP_HIER_DELETE',
p_object_name => l_group_name,
p_object_id => p_group_id,
p_start_date => l_start_date,
p_start_date_old => NULL,
p_end_date => l_end_date,
p_end_date_old => NULL,
x_event_log_id => l_event_log_id,
p_org_id => o.org_id);
p_action => 'DELETE_DEST_XROLL',
p_action_link_id => NULL,
p_base_salesrep_id => NULL,
p_base_comp_group_id => NULL,
p_event_log_id => l_event_log_id,
x_action_link_id => l_action_link_id,
p_org_id => o.org_id);
p_action => 'DELETE_SOURCE',
p_action_link_id => NULL,
p_base_salesrep_id => NULL,
p_base_comp_group_id => p_group_id,
p_event_log_id => l_event_log_id,
x_action_link_id => l_action_link_id,
p_org_id => o.org_id);
l_srp_tbl.DELETE;
END delete_group_usage_pre;
/* Vertcal Industry Procedure for post processing in case of delete resource group usage */
PROCEDURE delete_group_usage_post
(P_GROUP_ID IN NUMBER,
P_USAGE IN VARCHAR2,
X_RETURN_STATUS OUT NOCOPY VARCHAR2
) IS
BEGIN
x_return_status := fnd_api.g_ret_sts_success;
END delete_group_usage_post;