The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT NULL
FROM OTA_TRAINING_PLANS
WHERE training_plan_id <> NVL(p_training_plan_id, -1)
AND ( (p_organization_id IS NOT NULL AND organization_id = p_organization_id )
OR (p_person_id IS NOT NULL AND person_id = p_person_id) )
AND time_period_id = p_time_period_id;
SELECT business_group_id
FROM HR_ALL_ORGANIZATION_UNITS
WHERE organization_id = p_organization_id;
SELECT business_group_id
FROM PER_ALL_PEOPLE_F
WHERE person_id = p_person_id;
selected person can be from a business group other than
the one set up in the profiles.
ELSIF l_business_group_id <> p_business_group_id THEN
CLOSE csr_person_id;
SELECT NULL
FROM PER_TIME_PERIODS
WHERE time_period_id = p_time_period_id;
SELECT NULL
FROM OTA_TRAINING_PLAN_MEMBERS
WHERE training_plan_id = p_training_plan_id;
SELECT start_date, end_date
FROM PER_TIME_PERIODS
WHERE time_period_id = p_time_period_id;
SELECT NULL
FROM PER_TIME_PERIODS ptp
,OTA_TRAINING_PLANS tps
WHERE ( (p_person_id IS NOT NULL AND tps.person_id = p_person_id )
OR (p_organization_id IS NOT NULL AND tps.organization_id = p_organization_id) )
AND (NVL(p_training_plan_id, -1) <> training_plan_id)
AND tps.plan_status_type_id <> 'CANCELLED'
AND tps.time_period_id = ptp.time_period_id
AND ( (l_start_date >= ptp.start_date
AND
l_start_date <= ptp.end_date)
OR
(l_end_date >= ptp.start_date
AND
l_end_date <= ptp.end_date)
OR
(l_start_date <= ptp.start_date
AND
l_end_date >= ptp.end_date)
);
SELECT NULL
FROM FND_CURRENCIES
WHERE currency_code = p_budget_currency;
SELECT NULL
FROM OTA_TRAINING_PLANS
WHERE NVL(p_training_plan_id, -1) <> training_plan_id
AND name = p_name
AND business_group_id = p_business_group_id;
SELECT NULL
FROM OTA_TRAINING_PLANS
WHERE NVL(p_training_plan_id, -1) <> training_plan_id
AND name = p_name
-- Modified for bug#3855813
AND ((p_person_id IS NOT NULL AND person_id = p_person_id)
OR (p_contact_id IS NOT NULL AND contact_id = p_contact_id))
AND business_group_id = p_business_group_id;
SELECT NULL
FROM OTA_TRAINING_PLAN_MEMBERS tpm
WHERE tpm.training_plan_id = p_training_plan_id
UNION
SELECT NULL
FROM OTA_TRAINING_PLAN_COSTS tpc
WHERE tpc.training_plan_id = p_training_plan_id
UNION
SELECT NULL
FROM PER_BUDGET_ELEMENTS pbe
WHERE pbe.training_plan_id = p_training_plan_id;
SELECT training_plan_member_id
FROM ota_training_plan_members
WHERE training_plan_id = p_training_plan_id
AND ( earliest_start_date < p_start_date
OR ( p_end_date IS NOT NULL AND target_completion_date > p_end_date) )
and member_status_type_id <>'CANCELLED'
AND ROWNUM = 1;
SELECT max(target_completion_date)
FROM ota_training_plan_members
WHERE training_plan_id = p_training_plan_id
and member_status_type_id <>'CANCELLED';