EDIT Sql issue with listagg function

Hello,
I’m using select below for retrieving data from Oracle db … it get out 838 rows but there something dirty in those data because DEbug view goes in crash whnever I hit to see the values … is that the correct sintax to setup in Execute Query acivity ? Tkx.

“select BP, COUNTRY, BP_DESC, INSALREP, ISR_NAME, ISR_MAIL, EXTSALREP, ESR_NAME, ESR_MAIL, Trim(listagg(BP_EMAIL, ‘;’) within group (order by bp_email)) as bp_email, INVSTAT, CSC, PLANTCODE” &
" from v_BPCOMBPC" & i_strPlantId &
" group by BP, COUNTRY, BP_DESC, INSALREP, ISR_NAME, ISR_MAIL, EXTSALREP, ESR_NAME, ESR_MAIL, INVSTAT, CSC, PLANTCODE"

Hi @Meli_Marco ,

Can you please check or validate your query in the below link,

Hope this might help you :slight_smile:

1 Like

Hi Manish,

thanks for your replay and to let me know this tool :slight_smile: … I was quite sure it was good because I’m using sql developer and that’s works BUT seems the error was in the listagg function … so I’ve corrected in this way (see TO_CHAR):

select BP, COUNTRY, BP_DESC, INSALREP, ISR_NAME, ISR_MAIL, EXTSALREP, ESR_NAME, ESR_MAIL, listagg(TO_CHAR(BP_EMAIL), ‘;’) within group (order by BP_EMAIL) as BP_EMAIL, INVSTAT, CSC, PLANTCODE
from v_BPCOMBPC127
group by BP, COUNTRY, BP_DESC, INSALREP, ISR_NAME, ISR_MAIL, EXTSALREP, ESR_NAME, ESR_MAIL, INVSTAT, CSC, PLANTCODE

Thanks.
Br.
Marco.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.