SELECT gcc.code_combination_id
,gcc.segment1
,apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,1,gcc.segment1) SEGMENT1_DESC
,gcc.segment2
,apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,2,gcc.segment2) SEGMENT2_DESC
,gcc.segment3
,apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,3,gcc.segment3) SEGMENT3_DESC
,gcc.segment4
,apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,4,gcc.segment4) SEGMENT4_DESC
,gcc.segment5
,apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,5,gcc.segment5) SEGMENT5_DESC
,gcc.segment6
,apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,6,gcc.segment6) SEGMENT6_DESC
FROM gl_code_combinations gcc
WHERE gcc.code_combination_id = 100000
Here gl_flexfields_pkg.get_description_sql has below parameters:
- Chart of Account ID
- Number of the Segment
- Segment value for which we need Description