INTEGER inside user-defined datatype gives overflow if values > 2147483647
Posted: Wed 07 Oct 2020 19:00
Hello Devart,
If I create a table like this, then Oracle has no problems with the large integer and neither does ODAC.
If the INTEGER datatypes are inside a user-defined type, TSmartQuery has no problem as long as the values are less than 2147483647.
However, If I add a value greater than 2147483647, TSmartQuery now throws errors when I try to select the value and display it in a TDBGrid:
I have tried mapping oraInteger to ftLargeInt but that did not help.
It seems like a safe fix is to comment out lines 1199....1203 in OraObjects.pas, so that Attribute.Datatype is set to dtLargeInt instead of dtInteger in TOraType.DescribeAttribute.
Is that safe?
Thank you.
If I create a table like this, then Oracle has no problems with the large integer and neither does ODAC.
Code: Select all
CREATE TABLE A_INT_TEST
(
COL1 NUMBER,
COL2 INTEGER
);
Insert into A_INT_TEST
(COL1, COL2)
Values
(3, 2147483648);
COMMIT;
Code: Select all
drop TABLE A_MSG_IN purge;
drop type T_ID_OBJ;
CREATE OR REPLACE TYPE T_ID_OBJ is object
( id integer,
id_type_id integer,
bu_id integer);
/
CREATE TABLE A_MSG_IN
(
COL1 NUMBER,
COL2 T_ID_OBJ
);
SET DEFINE OFF;
Insert into A_MSG_IN
(COL1, COL2)
Values
(1, T_ID_OBJ(1,2,3));
Insert into A_MSG_IN
(COL1, COL2)
Values
(2, T_ID_OBJ(2,2147483647,2147483647));
COMMIT;
Code: Select all
Insert into A_MSG_IN
(COL1, COL2)
Values
(3, T_ID_OBJ(4,2147483648,2147483648));
COMMIT;
It seems like a safe fix is to comment out lines 1199....1203 in OraObjects.pas, so that Attribute.Datatype is set to dtLargeInt instead of dtInteger in TOraType.DescribeAttribute.
Is that safe?
Thank you.