SELECT to_char(ftvv.effective_start_date,'YYYY/MM/DD') effective_start_date,
ftv.tree_name,
haou1.name organization,
DECODE(houcf_org.CLASSIFICATION_CODE,
'DEPARTMENT','Department',
'HCM_DIVISION','Division',
'HCM_PSU','Payroll Statutory Unit',
'FUN_BUSINESS_UNIT','Business Unit',
'HCM_LRU','Legal Reporting Unit',
'ENTERPRISE','Enterprise',
'HCM_LEMP','Legal Entity',
'HCM_TRU','Tax Reporting Unit',
houcf_org.CLASSIFICATION_CODE
) org_classification,
haou2.name parent_organization,
DECODE(houcf_parentorg.CLASSIFICATION_CODE,
'DEPARTMENT','Department',
'HCM_DIVISION','Division',
'HCM_PSU','Payroll Statutory Unit',
'FUN_BUSINESS_UNIT','Business Unit',
'HCM_LRU','Legal Reporting Unit',
'ENTERPRISE','Enterprise',
'HCM_LEMP','Legal Entity',
'HCM_TRU','Tax Reporting Unit',
houcf_parentorg.CLASSIFICATION_CODE
) parentorg_classification,
potnv.tree_code
FROM PER_ORG_TREE_NODE_V potnv,
hr_all_organization_units haou1,
hr_all_organization_units haou2,
FND_TREE_VERSION_VL ftvv,
FND_TREE_VL FTV,
HR_ORG_UNIT_CLASSIFICATIONS_F houcf_org,
HR_ORG_UNIT_CLASSIFICATIONS_F houcf_parentorg
WHERE 1=1
and potnv.organization_id = haou1.organization_id
and potnv.parent_organization_id = haou2.organization_id
and ftvv.tree_structure_code = potnv.tree_structure_code
AND ftvv.status = 'ACTIVE'
AND ftv.tree_code = ftvv.tree_code
and haou1.ORGANIZATION_ID = houcf_org.ORGANIZATION_ID
and haou2.ORGANIZATION_ID = houcf_parentorg.ORGANIZATION_ID
ORDER BY haou2.organization_Id
haou1.name organization,
DECODE(houcf_org.CLASSIFICATION_CODE,
'DEPARTMENT','Department',
'HCM_DIVISION','Division',
'HCM_PSU','Payroll Statutory Unit',
'FUN_BUSINESS_UNIT','Business Unit',
'HCM_LRU','Legal Reporting Unit',
'ENTERPRISE','Enterprise',
'HCM_LEMP','Legal Entity',
'HCM_TRU','Tax Reporting Unit',
houcf_org.CLASSIFICATION_CODE
) org_classification,
haou2.name parent_organization,
DECODE(houcf_parentorg.CLASSIFICATION_CODE,
'DEPARTMENT','Department',
'HCM_DIVISION','Division',
'HCM_PSU','Payroll Statutory Unit',
'FUN_BUSINESS_UNIT','Business Unit',
'HCM_LRU','Legal Reporting Unit',
'ENTERPRISE','Enterprise',
'HCM_LEMP','Legal Entity',
'HCM_TRU','Tax Reporting Unit',
houcf_parentorg.CLASSIFICATION_CODE
) parentorg_classification,
potnv.tree_code
FROM PER_ORG_TREE_NODE_V potnv,
hr_all_organization_units haou1,
hr_all_organization_units haou2,
FND_TREE_VERSION_VL ftvv,
FND_TREE_VL FTV,
HR_ORG_UNIT_CLASSIFICATIONS_F houcf_org,
HR_ORG_UNIT_CLASSIFICATIONS_F houcf_parentorg
WHERE 1=1
and potnv.organization_id = haou1.organization_id
and potnv.parent_organization_id = haou2.organization_id
and ftvv.tree_structure_code = potnv.tree_structure_code
AND ftvv.status = 'ACTIVE'
AND ftv.tree_code = ftvv.tree_code
and haou1.ORGANIZATION_ID = houcf_org.ORGANIZATION_ID
and haou2.ORGANIZATION_ID = houcf_parentorg.ORGANIZATION_ID
ORDER BY haou2.organization_Id
No comments:
Post a Comment