The following lines contain the word 'select', 'insert', 'update' or 'delete':
select nvl(max(event_num), 0) + 1 from pa_events
where project_id = P_Project_ID
and task_id is null;
select nvl(max(event_num), 0) + 1 from pa_events
where project_id = P_Project_ID
and task_id = P_Task_ID;
| This Private Procedure Check_Create_Update_Event validates the funding lvl |
| and also if the event number is unique or not. |
+----------------------------------------------------------------------------*/
Procedure Check_Event_Action ( P_Project_Id IN NUMBER,
P_Task_ID IN NUMBER,
P_Event_Num IN NUMBER,
P_Event_Id IN NUMBER,
P_Event_Action IN VARCHAR2,
P_Action_Name IN VARCHAR2,
P_Init_Msg_List IN VARCHAR2,
P_Event_Num_Chg IN VARCHAR2,
P_Rec_Ver_Num IN NUMBER,
P_Mcb_Enabled_Flag IN VARCHAR2,
P_Pfc_Rate_Date_Code IN VARCHAR2,
P_Pc_Rate_Date_Code IN VARCHAR2,
P_Fc_Rate_Date_Code IN VARCHAR2,
P_Projfunc_Curr_Code IN VARCHAR2,
P_Project_Curr_Code IN VARCHAR2,
P_Bill_Trans_Curr_Code IN VARCHAR2,
P_Pfc_Rate_Type IN VARCHAR2,
P_Pc_Rate_Type IN VARCHAR2,
P_Fc_Rate_Type IN VARCHAR2,
P_Pfc_Rate_Date IN DATE,
P_Pc_Rate_Date IN DATE,
P_Fc_Rate_Date IN DATE,
P_Pfc_Excg_Rate IN NUMBER,
P_Pc_Excg_Rate IN NUMBER,
P_Fc_Excg_Rate IN NUMBER,
P_Event_Type IN VARCHAR2,
P_Bill_Txn_Cur IN VARCHAR2,
P_Invoice_Amt IN NUMBER,
P_Revenue_Amt IN NUMBER,
P_Event_Org IN NUMBER,
X_Msg_Data OUT NOCOPY VARCHAR2, --File.Sql.39 bug 4440895
X_Msg_Count OUT NOCOPY NUMBER, --File.Sql.39 bug 4440895
X_Return_Status OUT NOCOPY VARCHAR2) --File.Sql.39 bug 4440895
AS
Invalid_event_action exception; /* Added for bug 3850381 */
If P_Event_Action = 'Delete'
Then
l_event_processed :=PA_EVENT_UTILS.CHECK_EVENT_PROCESSED
(P_event_id => P_Event_Id );
If P_Event_Action = 'Update'
Then
Begin
select record_version_number
into l_rec_ver_num
from pa_events
where event_id = p_event_id;
SELECT event_id
INTO l_event_id
FROM pa_events
WHERE project_id = P_Project_Id
AND deliverable_id = P_Deliverable_Id
AND action_id = P_Action_Id;
Procedure Delete_Delv_Event ( P_Project_Id IN NUMBER,
P_Deliverable_Id IN NUMBER,
P_Action_Id IN NUMBER,
P_Action_Name IN VARCHAR2,
X_Return_Status OUT NOCOPY VARCHAR2) --File.Sql.39 bug 4440895
AS
l_tmp_return_status varchar2(1) := null;
select rowid from pa_events
where project_id = P_Project_Id
and deliverable_id = P_Deliverable_Id
and action_id = P_Action_Id;
PA_EVENTS_PKG.Delete_Row (X_RowId => l_tmp_rowid);
END Delete_Delv_Event;
SELECT to_char(o.organization_id),
o.name
INTO X_Org_ID,
X_Org_Name
FROM pa_projects p, hr_organization_units o
WHERE p.carrying_out_organization_id = o.organization_id
AND p.project_id = P_Project_ID;
select element_version_id
into l_Deliverable_Id
from pa_proj_element_versions
where proj_element_id = p_dlv_element_id
and object_type = 'PA_DELIVERABLES'
and project_id = p_project_id;
Select count(*)
into l_Dlv_Count
from pa_events e
where e.project_id = p_project_id
and e.deliverable_id = l_deliverable_id;
Update PA_EVENTS
set Completion_Date = trunc(P_Event_Date)
Where deliverable_id = P_Deliverable_Id
and action_id = P_Action_Id;