【发布时间】:2016-09-05 07:38:28
【问题描述】:
(使用 Oracle 11.2)
我有一个相当复杂的 SQL,比如
wm_concat( distinct abc )
预计会返回一些varchar2(4000) 兼容的结果。
它会导致 ORA-00932: inconsistent datatypes 在我的选择中用于某些 coalesce( some_varchar_col, wm_concat( ... ) )。
所以我尝试通过两种不同的方法投射它:
dbms_lob.substr( ..., 4000 ) -- L) tried even with 3000 in case of "unicode byte blow-up"
cast( ... as varchar2(4000)) -- C) tried even with 3000 in case of "unicode byte blow-up"
(在视图中使用,但玩弄它表明,它与视图无关)
根据列和其他运算符,我得到 N) 无结果或 O) ORA-22922:
select * from view_with_above_included where rownum <= 100
N) 我的 Eclipse Data Explorer JDBC 连接返回没有任何结果(没有没有结果的列,没有
(0 rows effected),只有查询时间统计信息)。 (这可能是一个内部异常没有被这样对待?)-
O)
ORA-22922: nonexistent LOB value ORA-06512: in "SYS.DBMS_LOB", line 1092 ORA-06512: in line 1
奇怪的是,以下测试查询有效:
-- rownum <= 100 would already cause the above problems
select * from view_with_above_included where rownum <= 10
或
select * from view_with_above_included
但查看实际聚合数据并不会显示长度超过 1000 个字符的聚合数据。
【问题讨论】:
标签: oracle11g casting wm-concat