我创建了一个返回组织VPHR的函数: -
XX_HR_GENERAL_PKG.XX_GET_SPOC(P_ORG_ID IN NUMBER
,P_SPOC IN VARCHAR2
,P_DATE IN DATE
,P_STRING IN VARCHAR2);
其中p_org_id是organization_id,p_spoc是VPHR,P_DATE是trunc(sysdate),p_string是'employee_number'
SELECT DISTINCT aou.name parent_org,
aou.organization_id organization_id,
level
FROM PER_ORG_STRUCTURE_ELEMENTS OSE,
HR_ALL_ORGANIZATION_UNITS AOU
where aou.organization_id = ose.organization_id_child
and aou.organization_id not in (:p_org_id)
start with organization_id_child = :p_org_id
connect by organization_id_child = prior organization_id_parent
order by level;
输出: -
Parent Org Organization_id Level
Serviced Portfolio PR 330 2
PR Operations 106 3
现在我希望我使用这个函数XX_HR_GENERAL_PKG.XX_GET_SPOC(P_ORG_ID IN NUMBER,P_SPOC IN VARCHAR2,P_DATE IN DATE,P_STRING IN VARCHAR2),这样我上面得到的organization_id可以在这个函数中使用,如下所示:
SELECT DISTINCT aou.name parent_org,
aou.organization_id organization_id,
level,
XX_HR_GENERAL_PKG.XX_GET_SPOC(:P_ORG_ID
,'VPHR'
,TRUNC(SYSDATE)
,'emp_num');
FROM PER_ORG_STRUCTURE_ELEMENTS OSE,
HR_ALL_ORGANIZATION_UNITS AOU
where aou.organization_id = ose.organization_id_child
and aou.organization_id not in (:p_org_id)
start with organization_id_child = :p_org_id
connect by organization_id_child = prior organization_id_parent
order by level;
错误获取:-ORA-06553:PLS-307:'XX_GET_SPOC'的声明太多与此调用匹配06553. 00000 - "PLS-%s: %s" *原因:
*行动: