SQL to Extract Chart Of Accounts Mapping Records-
SELECT DISTINCT GL_FV.flex_value source_flex_value,
CFH.parent_flex_value,
CFH.child_flex_value_low,
CFH.child_flex_value_high,
GL_CSM.single_value target_flex_value,
‘N’ summary_flag
FROM apps.fnd_flex_values GL_FV,
apps.gl_cons_flex_hierarchies CFH,
apps.gl_cons_segment_map GL_CSM
WHERE GL_CSM.coa_mapping_id = 1320 –enter the appropriate coa_mapping_id
AND GL_CSM.to_application_column_name = ‘SEGMENT5’
AND GL_CSM.segment_map_id = CFH.segment_map_id
AND GL_CSM.single_value = CFH.parent_flex_value
AND GL_CSM.segment_map_type = ‘R’
AND GL_FV.flex_value_set_id = GL_CSM.from_value_set_id
AND GL_FV.summary_flag = ‘N’
AND GL_FV.flex_value BETWEEN CFH.child_flex_value_low
AND CFH.child_flex_value_high ;