HDL – Delete Element Entries Data

Query to extract Element entry details data in HDL format:

SELECT DATA_ROW
FROM (
SELECT 'METADATA'
|| CHR (124) || 'ElementEntry'
|| CHR (124) || 'ElementEntryId'
|| CHR (124) || 'EffectiveStartDate'
|| CHR (124) || 'SourceSystemId' 
|| CHR (124) || 'SourceSystemOwner'  AS DATA_ROW
FROM DUAL
UNION all
select  'DELETE'
|| CHR (124) || 'ElementEntry'
|| CHR (124) || peef.element_entry_id
|| CHR (124) || to_char(peef.effective_start_date,'RRRR/MM/DD')
|| CHR (124) || hikm.source_system_id
|| CHR (124) || hikm.source_system_owner
FROM PAY_ELEMENT_ENTRIES_F peef,
	 HRC_INTEGRATION_KEY_MAP hikm
WHERE hikm.surrogate_id = peef.element_entry_id

)