The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT name, segment1
FROM pa_projects_all
WHERE project_id = p_project_id;
SELECT team_template_name
FROM pa_team_templates
WHERE team_template_id = l_team_template_id;
SELECT pa_apply_team_template_wf_s.nextval
INTO l_nextval
FROM dual;
UPDATE pa_team_templates
SET workflow_in_progress_flag = 'Y'
WHERE team_template_id = p_team_template_id_tbl(l_index).team_template_id;
UPDATE PA_TEAM_TEMPLATES
SET workflow_in_progress_flag = 'N'
WHERE team_template_id = l_team_template_id
AND NOT EXISTS(
SELECT 'Y'
FROM wf_item_activity_statuses_v
WHERE item_type = p_item_type
AND substr(item_key, 1, instr(item_key, '-')) = substr(p_item_key, 1, instr(p_item_key, '-'))
AND ((activity_status_code = 'DEFERRED' AND item_key <> p_item_key) OR
(activity_name='START_APPLY_TEAM_TEMPLATE_WF' AND activity_status_code = 'ACTIVE' AND item_key <> p_item_key)))
;
PA_WORKFLOW_UTILS.Insert_WF_Processes
(p_wf_type_code => 'APPLY_TEAM_TEMPLATE'
,p_item_type => p_item_type
,p_item_key => p_item_key
,p_entity_key1 => to_char(l_project_id)
,p_description => NULL
,p_err_code => l_err_code
,p_err_stage => l_err_stage
,p_err_stack => l_err_stack);
SELECT calendar_id, location_id
FROM pa_projects_all
WHERE project_id = p_project_id;
SELECT assignment_name
,'OPEN_ASSIGNMENT'
,assignment_type
,status_code
,staffing_priority_code
,project_role_id
,description
,start_date
,end_date
,extension_possible
,min_resource_job_level
,max_resource_job_level
,additional_information
,location_id
,work_type_id
,expense_owner
,expense_limit
,expense_limit_currency_code
,expenditure_org_id
,expenditure_organization_id
,expenditure_type_class
,expenditure_type
,calendar_type
,calendar_id
,assignment_id --used for source_assignment_id
,assignment_template_id --used to tieback to the team template the requirement was created from
,attribute_category
,attribute1
,attribute2
,attribute3
,attribute4
,attribute5
,attribute6
,attribute7
,attribute8
,attribute9
,attribute10
,attribute11
,attribute12
,attribute13
,attribute14
,attribute15
FROM pa_project_assignments
WHERE assignment_template_id = p_team_template_id
AND template_flag = 'Y';
SELECT name
FROM pa_project_subteams
WHERE object_type = 'PA_TEAM_TEMPLATES'
AND object_id = p_team_template_id;
SELECT team_start_date
FROM pa_team_templates
WHERE team_template_id = p_team_template_id;
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATE_PVT.Create_Team_Template.calling_insert_row'
,x_msg => 'calling pa_team_templates.insert_row.'
,x_log_level => 5);
PA_TEAM_TEMPLATES_PKG.Insert_Row(
p_team_template_name => l_team_template_rec.team_template_name,
p_description => l_team_template_rec.description,
p_start_date_active => l_team_template_rec.start_date_active,
p_end_date_active => l_team_template_rec.end_date_active,
p_calendar_id => l_team_template_rec.calendar_id,
p_work_type_id => l_team_template_rec.work_type_id,
p_role_list_id => l_team_template_rec.role_list_id,
p_team_start_date => l_team_template_rec.team_start_date,
x_team_template_id => x_team_template_id,
x_return_status => x_return_status);
PROCEDURE Update_Team_Template
( p_team_template_rec IN PA_TEAM_TEMPLATES_PUB.team_template_rec
,p_commit IN VARCHAR2 := FND_API.G_FALSE
,p_validate_only IN VARCHAR2 := FND_API.G_TRUE
,x_return_status OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
)
IS
l_msg_count NUMBER;
PA_DEBUG.set_err_stack('PA_TEAM_TEMPLATE_PVT.Update_Team_Template');
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATES_PVT.Update_Team_Template.begin'
,x_msg => 'Beginning of the PVT Update_Team_Template'
,x_log_level => 5);
SAVEPOINT ASGN_PVT_Update_TEAM_TEMPLATE;
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATE_PVT.Update_Team_Template.calling_update_row'
,x_msg => 'calling pa_team_templates.update_row.'
,x_log_level => 5);
PA_TEAM_TEMPLATES_PKG.Update_Row(
p_team_template_id => l_team_template_rec.team_template_id,
p_team_template_name => l_team_template_rec.team_template_name,
p_record_version_number => l_team_template_rec.record_version_number,
p_description => l_team_template_rec.description,
p_start_date_active => l_team_template_rec.start_date_active,
p_end_date_active => l_team_template_rec.end_date_active,
p_calendar_id => l_team_template_rec.calendar_id,
p_work_type_id => l_team_template_rec.work_type_id,
p_role_list_id => l_team_template_rec.role_list_id,
p_team_start_date => l_team_template_rec.team_start_date,
p_workflow_in_progress_flag => l_team_template_rec.workflow_in_progress_flag,
x_return_status => x_return_status);
ROLLBACK TO ASGN_PVT_UPDATE_TEAM_TEMPLATE;
FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_TEAM_TEMPLATE_PVT.Update_Team_Template'
,p_procedure_name => PA_DEBUG.G_Err_Stack );
END Update_Team_Template;
PROCEDURE Delete_Team_Template
( p_team_template_id IN pa_team_templates.team_template_id%TYPE
,p_record_version_number IN NUMBER
,p_commit IN VARCHAR2 := FND_API.G_FALSE
,x_return_status OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
)
IS
l_return_status VARCHAR2(1);
SELECT 'X'
FROM pa_project_assignments
WHERE assignment_template_id = p_team_template_id
AND template_flag <> 'Y';
SELECT assignment_id,
record_version_number,
assignment_type
FROM pa_project_assignments
WHERE assignment_template_id = p_team_template_id
AND template_flag = 'Y';
PA_DEBUG.init_err_stack('PA_TEAM_TEMPLATE_PVT.Delete_Assignment');
SAVEPOINT ASGN_PVT_DELETE_TEAM_TEMPLATE;
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATE_PVT.Delete_Team_Template.begin'
,x_msg => 'Beginning of Delete Team Template PVT.'
,x_log_level => 5);
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATE_PVT.Delete_Team_Template'
,x_msg => 'calling delete subteam'
,x_log_level => 5);
PA_PROJECT_SUBTEAMS_PUB.Delete_Subteam_By_Obj
(p_init_msg_list => FND_API.G_FALSE,
p_validate_only => FND_API.G_FALSE,
p_object_type => 'PA_TEAM_TEMPLATES',
p_object_id => p_team_template_id,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATE_PVT.Delete_Team_Template'
,x_msg => 'calling delete assignment (template req)'
,x_log_level => 5);
PA_ASSIGNMENTS_PUB.Delete_Assignment(
p_assignment_id => l_template_requirements.assignment_id,
p_record_version_number => l_template_requirements.record_version_number,
p_assignment_type => l_template_requirements.assignment_type,
p_calling_module => 'TEMPLATE_REQUIREMENT',
p_validate_only => FND_API.G_FALSE,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
PA_DEBUG.write_log (x_module => 'pa.plsql.PA_TEAM_TEMPLATE_PVT.Delete_Team_Template'
,x_msg => 'calling delete_row'
,x_log_level => 5);
PA_TEAM_TEMPLATES_PKG.Delete_Row(p_team_template_id => p_team_template_id
,p_record_version_number => p_record_version_number
,x_return_status => x_return_status);
ROLLBACK TO ASGN_PVT_DELETE_ASSIGNMENTT;
FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_TEAM_TEMPLATE_PVT.Delete_Team_Template'
,p_procedure_name => PA_DEBUG.G_Err_Stack );
END Delete_Team_Template;