The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'FI-' || TO_CHAR(wf_forecast_item_gen_s.NEXTVAL)
INTO l_item_key
FROM DUAL;
SELECT project_id INTO l_project_id
FROM pa_project_assignments
WHERE assignment_id = p_assignment_id;
-- In delete assignment the assignment will not exist
-- in pa_project_assignments
l_project_id := null;
-- Selecting orgnization name to initialize the work flow attribute
BEGIN
/* Bug remmed out for bug 1777250 due to perf team request
SELECT name
INTO l_name
FROM pa_organizations_expend_v
WHERE organization_id = ( select expenditure_organization_id
FROM pa_project_assignments
WHERE assignment_id = p_assignment_id);
and instead used the select statement below note that also called the org_name
translation function.
*/
select pa_expenditures_utils.GetOrgTlName(expenditure_organization_id)
into l_name
from pa_project_assignments
where assignment_id = p_assignment_id;
SELECT pa_expenditures_utils.GetOrgTlName(resource_organization_id)
INTO l_name
from pa_resources_denorm
WHERE resource_Id = p_resource_id
AND rownum = 1
AND ((trunc(p_start_date) BETWEEN
trunc(resource_effective_start_date) AND
NVL(resource_effective_end_date,SYSDATE+1))
OR (trunc( p_end_date) BETWEEN
trunc(resource_effective_start_date) AND
NVL(resource_effective_end_date,SYSDATE+1))
OR ( trunc(p_start_date) <
trunc(resource_effective_start_date) AND
trunc(p_end_date) >
NVL(resource_effective_end_date,SYSDATE+1)))
ORDER BY resource_effective_start_date;
SELECT pa_expenditures_utils.GetOrgTlName(resource_organization_id)
INTO l_name
FROM pa_resources_denorm
WHERE resource_Id = p_resource_id
AND rownum = 1
AND trunc(p_start_date) BETWEEN trunc(resource_effective_start_date)
AND NVL(resource_effective_end_date,SYSDATE+1)
ORDER BY resource_effective_start_date;
PA_WORKFLOW_UTILS.Insert_WF_Processes
(p_wf_type_code => l_wf_type_code
,p_item_type => l_item_type
,p_item_key => l_item_key
,p_entity_key1 => to_char(l_project_id)
,p_entity_key2 => to_char(p_assignment_id)
,p_description => NULL
,p_err_code => l_err_code
,p_err_stage => l_err_stage
,p_err_stack => l_err_stack
);
PA_WORKFLOW_UTILS.Insert_WF_Processes
(p_wf_type_code => l_wf_type_code
,p_item_type => l_item_type
,p_item_key => l_item_key
,p_entity_key1 => to_char(-99)
,p_entity_key2 => to_char(p_resource_id)
,p_description => NULL
,p_err_code => l_err_code
,p_err_stage => l_err_stage
,p_err_stack => l_err_stack
);
IF (l_process_mode = 'DELETE') THEN
-- Call the Forecast Deletion API.
PA_FORECASTITEM_PVT.Delete_Forecast_Item(p_assignment_id => l_assignment_id,
p_resource_id => l_resource_id,
p_start_date => l_asgmt_start_date,
p_end_date => l_asgmt_end_date,
x_return_status => l_x_return_status,
x_msg_count => l_x_msg_count,
x_msg_data => l_x_msg_data );