暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle PivotImpl和FLOAT数据类型

ASKTOM 2021-03-10
642

问题描述

当玩众所周知的PivotImpl和我自己的衍生物时,我发现一个奇怪的行为OCDITableDescribeOCDITableStart当查询包含FLOAT列时:

FLOAT(正确) 检测为NUMBERODCITabeDecribePivotImpl的实现:CASE desc_tab(i).col_type返回2...
CASE type_codeODCITableStart返回4!
(and 4 is not documented anywhere as far as I was able to search在的doc...).
And of course 的outside call fails with a ORA-06595: CASE not found while executing CASE statement.

When looking a 的generated TYPE ”ST000...” for 的OBJECT, it contains a FLOAT(126):
how possible if 的CASEODCITableDescribe将其定义为DBMS_TYPE.TYPECODE_NUMBER... ????

人们可以认为只需添加一个“WHEN 4”在的various CASE在Describe, Prepare, Fetch...
Well first在Describe it never returns 4 but 2 for NUMBER of which FLOAT is a subtype,
then在Prepare if you add a WHEN 4和call dbms_sql.define_column用一个“CAST(NULL as NUMBER)
it pass this step but you still get a problem在Fetch:
in 的”WHEN 4” you may add try to do a outset.setnumber,又提出了一个ERR:
ORA-22626, ORA-06512 ”Type Mismatch while constructing or accessing OCIAnyData
Cause: Type supplied is not matching 的type of 的AnyData”.

So except rewriting 的queries (views, ...) to CAST AS NUMBER all 的met FLOAT...
(I don't control 的data model generated by a 4G...)
我还没有找到任何解决办法。

有什么想法吗?