Monday, 1 May 2023

Print Multiple selected Parameters In Template

 SELECT

NVL((select LISTAGG(NVL(PERIOD_NAME,'ALL'),',') from gl_periods where PERIOD_NAME IN(:PERIOD_FROM)),'ALL') as PERIOD_FROM

,NVL((select LISTAGG(NVL(PERIOD_NAME,'ALL'),',') from gl_periods where PERIOD_NAME IN(:PERIOD_TO)),'ALL') as PERIOD_TO

,NVL((select LISTAGG(distinct NVL(segment1,'ALL'),',') from gl_code_combinations where segment1 in(:company)),'ALL') as company

,NVL((select LISTAGG(distinct segment2,',') from gl_code_combinations where segment2 in(:Business_Unit)),'ALL') as Business_Unit

,NVL((select LISTAGG(distinct NVL(segment5,'ALL'),',') from gl_code_combinations where segment5 in(:Department)),'ALL') as Department

,NVL((select LISTAGG(distinct NVL(segment4,'ALL'),',') from gl_code_combinations where segment4 in(:ACCOUNT)),'ALL') as ACCOUNT

,NVL((select LISTAGG(distinct NVL(segment3,'ALL'),',') from gl_code_combinations where segment3 in(:INTER_COMPANY)),'ALL') as INTER_COMPANY

,NVL((select LISTAGG(distinct NVL(segment6,'ALL'),',') from gl_code_combinations where segment6 in(:Future1)),'ALL') as Future1

,NVL((select LISTAGG(distinct NVL(segment7,'ALL'),',') from gl_code_combinations where segment7 in(:Future2)),'ALL') as Future2

,NVL((select LISTAGG(distinct NVL(name,'ALL'),',') from GL_LEDGERS where name in(:Ledger)),'ALL') as Ledger

,NVL((select LISTAGG(distinct NVL(LEGAL_ENTITY_NAME,'ALL'),',') from gl_ledger_le_v where LEGAL_ENTITY_NAME in(:P_LEGAL_ENTITY)),'ALL') as P_LEGAL_ENTITY

FROM DUAL

No comments:

Post a Comment