Opened 11 years ago
Last modified 11 years ago
#882 new defect
Error with operation on Number without scale
Reported by: | bscott | Owned by: | haris |
---|---|---|---|
Priority: | minor | Milestone: | 3.8.0 |
Component: | KingOracle Provider | Version: | 3.8.0 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description
Lets say you have a table with Col1 and col2 define as number without scale. I know it is not a good habit of doing that but it's not my database:-(
If i try a sql statement like this "Select col1 + col2 from MyTable" This make the provider throw an exception
I have found the problem and i'v attached a little patch oci return a 0 scale and the provider try to fit a big double into an int16... boom
It would be great if we could include this patch into the 3.9 time frame
Attachments (1)
Change History (3)
by , 11 years ago
Attachment: | Number0.patch added |
---|
comment:1 by , 11 years ago
comment:2 by , 11 years ago
This scale value is used in a function c_FdoOra_API3::OraTypeToFdoDataType If the oci type is either numer or decimal the function test the scale if the scale <= 0 then its an int (either 16,32 or 64 according to the precision) otherwise its a decimal
So defaulting the scale to 9999 forces the translation to FdoDataType_Decimal on Oracle NUMBER()
there maybe a better way of doing this, but we would have to change the c_FdoOra_API3::OraTypeToFdoDataType
re: ub4 col_scale = 9999;
Why set the scale to the upper limit?