Query To Fetch Code Combination Name


select  poh.segment1 po_num,pol.item_id,pol.quantity,gl_flexfields_pkg.get_description_sql
                                        (glc.chart_of_accounts_id,
                                         1,
                                         glc.segment1
                                        ) seg1_desc,
       glc.segment1,
       gl_flexfields_pkg.get_description_sql
                                        (glc.chart_of_accounts_id,
                                         2,
                                         glc.segment2
                                        ) seg2_desc,
       glc.segment2 ,
       gl_flexfields_pkg.get_description_sql
                                        (glc.chart_of_accounts_id,
                                         3,
                                         glc.segment3
                                        ) seg3_desc,
       glc.segment3 ,
       gl_flexfields_pkg.get_description_sql
                                        (glc.chart_of_accounts_id,
                                         4,
                                         glc.segment4
                                        ) seg4_desc,
       glc.segment4 ,
       gl_flexfields_pkg.get_description_sql
                                        (glc.chart_of_accounts_id,
                                         5,
                                         glc.segment5
                                        ) seg5_desc,
       glc.segment5
        from po_headers_all poh , po_lines_all pol, po_distributions_all pod , gl_code_combinations glc
 where poh.segment1='2521'
and poh.po_header_id=pol.po_header_id
and pol.po_line_id=pod.po_line_id
and pod.code_combination_id=glc.code_combination_id
and poh.org_id=996;