---- 项目关联项目经理
DECLARE
p_project_id NUMBER := 155233;
l_project_role_id NUMBER := '';
p_employee_id NUMBER := 10994;
p_effective_date DATE := SYSDATE - 1;
l_end_date_active DATE := SYSDATE + 1;
x_project_party_id NUMBER;
x_resource_id NUMBER;
x_assignment_id NUMBER;
x_wf_type VARCHAR2(240);
x_wf_item_type VARCHAR2(240);
x_wf_process VARCHAR2(240);
x_return_status VARCHAR2(240);
x_msg_count NUMBER;
x_msg_data VARCHAR2(30000);
BEGIN
fnd_global.apps_initialize(user_id => 23806
,resp_id => 52998
,resp_appl_id => 275);
mo_global.init('M');
SELECT prt.project_role_id
INTO l_project_role_id
FROM pa.pa_project_role_types_b prt
WHERE prt.project_role_type = 'PROJECT MANAGER';
pa_project_parties_pub.create_project_party(p_validate_only => 'F'
,
/* p_validation_level => NULL,*/p_debug_mode => ''
,p_object_id => p_project_id
,p_object_type => 'PA_PROJECTS'
,p_project_role_id => l_project_role_id
,p_project_role_type => 'PROJECT MANAGER'
,p_resource_source_id => p_employee_id
, --from HR_EMPLOYEES
p_start_date_active => p_effective_date
,p_calling_module => NULL
,p_end_date_active => l_end_date_active
,p_project_id => p_project_id
,x_project_party_id => x_project_party_id
,x_resource_id => x_resource_id
,x_assignment_id => x_assignment_id
,x_wf_type => x_wf_type
,x_wf_item_type => x_wf_item_type
,x_wf_process => x_wf_process
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data);
dbms_output.put_line('x_project_party_id: ' || x_project_party_id);
dbms_output.put_line('x_resource_id: ' || x_resource_id);
dbms_output.put_line('x_assignment_id: ' || x_assignment_id);
dbms_output.put_line('x_wf_process: ' || x_wf_process);
dbms_output.put_line('x_msg_data: ' || x_msg_data);
dbms_output.put_line('x_return_status: ' || x_return_status);
dbms_output.put_line('x_msg_count: ' || x_msg_count);
END;