The character string buffer is too small

I chose:

select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,wm_concat(ids) npx_IDS,
wm_concat(px_dtct) npx_DTCT 
from table v
group by accs, currency, amount, drcr_ind

      

but i get error ORA-06502: PL / SQL :: character buffer too string if i delete one line because sometimes (when v.accs = 3570) count (*) = 215 but when i try to skip using wm_concat for v.accs = 3570, for example like this:

select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,wm_concat(ids) npx_IDS,
(case when v.accs = 3570 then wm_concat(px_dtct) else 'too many' end) npx_DTCT 
from table v
group by accs, currency, amount, drcr_ind

      

I still have the same error message. But why?

0


a source to share


3 answers


You are concatenating the query results. This query can result in many lines, so you end up with a line. Maybe concatenation is not the way to go here. Depending on what you want to achieve, of course.



+1


a source


Why? Since you are still using wm_concat for accs = 3570 ... replace the THEN and ELSE part of your CASE expression



select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,wm_concat(ids) npx_IDS,
       (case when v.accs = 3570 then 'too many' else wm_concat(px_dtct) end) npx_DTCT
  from table v group by accs, currency, amount, drcr_ind

      

0


a source


First, as has been said, you need to change the offer then

and else

in its request. Then, I think you should also handle the second wm_concat

one that works with ids

.

select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,
(case when v.accs = 3570 then 'too many' else wm_concat(ids) end) npx_IDS,
(case when v.accs = 3570 then 'too many' else wm_concat(px_dtct) end) npx_DTCT 
from table v
group by accs, currency, amount, drcr_ind

      

And finally, why do you think that you v.accs = 3570

can only convey error 06502 to you? I suppose you should deal with them.

0


a source







All Articles