#1 2016-12-29 07:32:58

KevinChen
Member
Registered: 2016-09-10
Posts: 10

Incorrect Oracle "NUMBER" convert in ColumnTypeNativeToDBOracle

Oracle datatype "NUMBER" is different from "NUMBER(n)".
Neither of them have Scale but "NUMBER" should be converted to ftDouble, not ftInt64.

procedure ColumnTypeNativeToDBOracle;
begin
  if PosEx('CHAR',aNativeType)>0 then
    result := ftUTF8 else
  if aNativeType = 'NUMBER' then
    result := ftDouble else
  if IdemPropNameU(aNativeType,'NUMBER') then
  ... 

Offline

#2 2016-12-29 08:23:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Incorrect Oracle "NUMBER" convert in ColumnTypeNativeToDBOracle

IdemPropNameU(aNativeType,'NUMBER') is in fact a case-insensitive comparison of string.
So your fix won't work as expected.

In our ORM, we map Int64 with NUMBER(22,0) and currency with NUMBER(19,4).

In fact, sounds like if it returns NULL as data_scale column for plain NUMBER field:
https://asktom.oracle.com/pls/apex/f?p= … 9134729306

I've ensured that ColumnScale contains -1 if the SQL metadata request returns NULL.
So that plain NUMBER will be handled as ftDouble, not ftInt64.
See http://synopse.info/fossil/info/9a04825171

Offline

Board footer

Powered by FluxBB