字符串缓冲区太小
我有 select:
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
但我收到错误 ORA-06502: PL/SQL: : 如果我要删除一个字符串,则字符串缓冲区太小,因为有时(当 v.accs= 3570 时) count(*) = 215 但是当我尝试跳过使用 wm_concat for v.accs= 3570 例如这样:
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 have select:
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 string buffer too small if i'll remove one string, because sometimes (when v.accs= 3570) count(*) = 215
but when i try to skip using wm_concat for v.accs= 3570 for example this way:
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您连接查询的结果。此查询可能会产生很多行,因此最终您将用完字符串长度。也许连接不是这里的方法。当然取决于你想要实现什么。
You concatenate results from a query. This query can result in a lot of rows so eventually you will run out of string length. Maybe concatenation is not the way to go here. Depends on what you want to achieve of course.
为什么?因为您仍然使用 wm_concat 表示 accs=3570...交换 CASE 表达式的 THEN 和 ELSE 部分
Why? Because you still use wm_concat for accs=3570... swap the THEN and ELSE part of your CASE expression
首先,正如前面所说,您必须在查询中切换
then
和else
子句。然后,我想您也应该类似地处理第二个
wm_concat
,即与ids
一起使用的那个。最后,为什么您认为只有
v.accs = 3570
能够在您面前带来 06502 错误?我想你应该处理所有这些。First, as it has already been told, you have to switch
then
andelse
clauses in your query.Then, I guess you should also similarily process your second
wm_concat
, the one that works withids
.And, finally, why do you think that only
v.accs = 3570
is able to bring 06502 error in front of you? I suppose you should handle all of them.