SELECT XEP.NAME
INTO LEGAL_ENTITY_NAME
FROM XLE_ENTITY_PROFILES XEP
WHERE LEGAL_ENTITY_ID = (SELECT DISTINCT DEFAULT_LEGAL_CONTEXT_ID
FROM HR_OPERATING_UNITS
WHERE NAME = 'XX_OPERATING_UNIT')
INTO LEGAL_ENTITY_NAME
FROM XLE_ENTITY_PROFILES XEP
WHERE LEGAL_ENTITY_ID = (SELECT DISTINCT DEFAULT_LEGAL_CONTEXT_ID
FROM HR_OPERATING_UNITS
WHERE NAME = 'XX_OPERATING_UNIT')