DBA Data[Home] [Help]

VIEW: APPS.HRI_CS_PER_ORGCC_V

Source

View Text - Preformatted

SELECT oi1.organization_id organization_id , DECODE(substr(oi3.org_information1 , (instr(oi3.org_information1,'|',1,3)+1)) ,'','NA_EDW' ,substr(oi3.org_information1, (instr(oi3.org_information1,'|',1,3)+1))) cost_centre_code ,NVL(to_number(oi2.org_information2),-1) cc_mngr_person_id ,NVL(fnd_date.canonical_to_date(oi2.org_information3) ,hr_general.start_of_time) effective_start_date ,NVL(fnd_date.canonical_to_date(oi2.org_information4) ,hr_general.end_of_time) effective_end_date ,DECODE(substr(oi3.org_information1,(instr(oi3.org_information1,'|',1,1)+1) ,( (instr(oi3.org_information1,'|',1,2)) - (instr(oi3.org_information1,'|',1,1)+1)) ) ,'','NA_EDW' ,substr(oi3.org_information1,(instr(oi3.org_information1,'|',1,1)+1) ,( (instr(oi3.org_information1,'|',1,2)) - (instr(oi3.org_information1,'|',1,1)+1)) )) company_code , NVL(oi2.org_information1,'NA_EDW') reporting_name , GREATEST( NVL(oi1.last_update_date, to_date('01-01-2000','DD-MM-YYYY')), NVL(oi2.last_update_date, to_date('01-01-2000','DD-MM-YYYY')), NVL(oi3.last_update_date, to_date('01-01-2000','DD-MM-YYYY')) ) last_change_date FROM hr_organization_information oi1 , hr_organization_information oi2 , hr_organization_information oi3 WHERE oi1.org_information_context = 'CLASS' AND oi1.org_information1 = 'CC' AND oi1.org_information2 = 'Y' AND oi2.org_information_context (+) = 'Organization Name Alias' AND oi3.org_information_context (+) = 'Company Cost Center' AND oi2.org_information3 IS NOT NULL AND oi1.organization_id = oi2.organization_id (+) AND oi1.organization_id = oi3.organization_id (+) WITH READ ONLY
View Text - HTML Formatted

SELECT OI1.ORGANIZATION_ID ORGANIZATION_ID
, DECODE(SUBSTR(OI3.ORG_INFORMATION1
, (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 3)+1))
, ''
, 'NA_EDW'
, SUBSTR(OI3.ORG_INFORMATION1
, (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 3)+1))) COST_CENTRE_CODE
, NVL(TO_NUMBER(OI2.ORG_INFORMATION2)
, -1) CC_MNGR_PERSON_ID
, NVL(FND_DATE.CANONICAL_TO_DATE(OI2.ORG_INFORMATION3)
, HR_GENERAL.START_OF_TIME) EFFECTIVE_START_DATE
, NVL(FND_DATE.CANONICAL_TO_DATE(OI2.ORG_INFORMATION4)
, HR_GENERAL.END_OF_TIME) EFFECTIVE_END_DATE
, DECODE(SUBSTR(OI3.ORG_INFORMATION1
, (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 1)+1)
, ( (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 2)) - (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 1)+1)) )
, ''
, 'NA_EDW'
, SUBSTR(OI3.ORG_INFORMATION1
, (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 1)+1)
, ( (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 2)) - (INSTR(OI3.ORG_INFORMATION1
, '|'
, 1
, 1)+1)) )) COMPANY_CODE
, NVL(OI2.ORG_INFORMATION1
, 'NA_EDW') REPORTING_NAME
, GREATEST( NVL(OI1.LAST_UPDATE_DATE
, TO_DATE('01-01-2000'
, 'DD-MM-YYYY'))
, NVL(OI2.LAST_UPDATE_DATE
, TO_DATE('01-01-2000'
, 'DD-MM-YYYY'))
, NVL(OI3.LAST_UPDATE_DATE
, TO_DATE('01-01-2000'
, 'DD-MM-YYYY')) ) LAST_CHANGE_DATE
FROM HR_ORGANIZATION_INFORMATION OI1
, HR_ORGANIZATION_INFORMATION OI2
, HR_ORGANIZATION_INFORMATION OI3
WHERE OI1.ORG_INFORMATION_CONTEXT = 'CLASS'
AND OI1.ORG_INFORMATION1 = 'CC'
AND OI1.ORG_INFORMATION2 = 'Y'
AND OI2.ORG_INFORMATION_CONTEXT (+) = 'ORGANIZATION NAME ALIAS'
AND OI3.ORG_INFORMATION_CONTEXT (+) = 'COMPANY COST CENTER'
AND OI2.ORG_INFORMATION3 IS NOT NULL
AND OI1.ORGANIZATION_ID = OI2.ORGANIZATION_ID (+)
AND OI1.ORGANIZATION_ID = OI3.ORGANIZATION_ID (+) WITH READ ONLY