Problem with IntegerPrecision in the OraClasses.pas module
-
StanislawS
- Posts: 6
- Joined: Thu 19 Jul 2012 15:42
Problem with IntegerPrecision in the OraClasses.pas module
Hello!
Upon migrate from BDE to ODAC there was the following problem. Fields of tables which in ORACLE 10g are defined as NUMBER (10) in Delphi5 with BDE 5.2 are defined as TIntegerField, but with ODAC 7.00.0.3 - as TFloatField. According to FAQ, we changed the value for IntegerPrecision = 10 in the OraClasses.pas module. Didn't help. As before, ODAC maps Oracle NUMBER (10) to TFloatField. Reinstalled ODAC. Didn't help too. What it is a problem and what is possible to make in our case?
Thank You!
Upon migrate from BDE to ODAC there was the following problem. Fields of tables which in ORACLE 10g are defined as NUMBER (10) in Delphi5 with BDE 5.2 are defined as TIntegerField, but with ODAC 7.00.0.3 - as TFloatField. According to FAQ, we changed the value for IntegerPrecision = 10 in the OraClasses.pas module. Didn't help. As before, ODAC maps Oracle NUMBER (10) to TFloatField. Reinstalled ODAC. Didn't help too. What it is a problem and what is possible to make in our case?
Thank You!
Re: Problem with IntegerPrecision in the OraClasses.pas module
hello,
The value of this variable should be set before connection, in this case, the fields with Precision less then the variable value will be determined as TIntegerField.
In There is a new functionality in the new ODAC version 8.2.7 - Data Type Mapping, that allows to set up mapping of all DB field types to any supported Delphi types in both design and run time.
The value of this variable should be set before connection, in this case, the fields with Precision less then the variable value will be determined as TIntegerField.
In There is a new functionality in the new ODAC version 8.2.7 - Data Type Mapping, that allows to set up mapping of all DB field types to any supported Delphi types in both design and run time.
-
StanislawS
- Posts: 6
- Joined: Thu 19 Jul 2012 15:42
Re: Problem with IntegerPrecision in the OraClasses.pas module
Thank you very much for the help and for a quickly reply.
So, the problem consists that the value of Precision should be LESS, instead LESS OR EQUAL, than the value of IntegerPrecision as it is specified in the FAQ. We have increased IntegerPrecision to 11. And now, really, ODAC maps Oracle NUMBER (10) to TIntegerField.
Thank you for the help once again.
So, the problem consists that the value of Precision should be LESS, instead LESS OR EQUAL, than the value of IntegerPrecision as it is specified in the FAQ. We have increased IntegerPrecision to 11. And now, really, ODAC maps Oracle NUMBER (10) to TIntegerField.
Thank you for the help once again.
Re: Problem with IntegerPrecision in the OraClasses.pas module
hello,
We have checked the behaviour of this global variable - everything works correctly like it is described in the help (LESS OR EQUAL). Please specify the exact version of your Oracle server, the server may return Precision fields incorrectly.
We have checked the behaviour of this global variable - everything works correctly like it is described in the help (LESS OR EQUAL). Please specify the exact version of your Oracle server, the server may return Precision fields incorrectly.
-
StanislawS
- Posts: 6
- Joined: Thu 19 Jul 2012 15:42
Re: Problem with IntegerPrecision in the OraClasses.pas module
Hallo,
We have Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Best regards
We have Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Best regards
Re: Problem with IntegerPrecision in the OraClasses.pas module
hello,
We have checked the behaviour when setting this variable - and NUMBER fields with precision LESS OR EQUAL to the IntegerPrecision variable value are defined as TIntegerField.
Please execute the following query to make sure that the server returns the correct Precision value for your field:
SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME = 'TABLE_NAME'
AND OWNER = 'SCHEMA_NAME'
AND COLUMN_NAME = 'COLUM_NNAME'
We have checked the behaviour when setting this variable - and NUMBER fields with precision LESS OR EQUAL to the IntegerPrecision variable value are defined as TIntegerField.
Please execute the following query to make sure that the server returns the correct Precision value for your field:
SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME = 'TABLE_NAME'
AND OWNER = 'SCHEMA_NAME'
AND COLUMN_NAME = 'COLUM_NNAME'
-
StanislawS
- Posts: 6
- Joined: Thu 19 Jul 2012 15:42
Re: Problem with IntegerPrecision in the OraClasses.pas module
Hello,
We have executed the query on several tables and any discrepancies didn't find. The server always returns the correct Precision value.
Thank you.
We have executed the query on several tables and any discrepancies didn't find. The server always returns the correct Precision value.
Thank you.
Re: Problem with IntegerPrecision in the OraClasses.pas module
Hello,
Please try to create a new text table
and check the behaviour of IntegerPrecision variable on it, and inform us of the results.
Please try to create a new text table
Code: Select all
CREATE TABLE T_TEST
(
F_ID NUMBER(10)
);-
StanislawS
- Posts: 6
- Joined: Thu 19 Jul 2012 15:42
Re: Problem with IntegerPrecision in the OraClasses.pas module
Hello,
For problem research we have created a small test table.
As a result of research it was determined that if fields are dynamically created by OraQuery then ODAC maps Oracle NUMBER (10) in full accordance with the criteria specified in documentation. But in Design Modus ODAC maps the NUMBER fields incorrectly. As it was specified earlier, comparing occurs by criterion LESS, instead of LESS OR EQUAL. And NUMBER (10) becomes TFloatField, instead TIntegerField.
For problem research we have created a small test table.
Code: Select all
CREATE TABLE T_TEST
(
F_ID09 NUMBER(9),
F_ID10 NUMBER(10),
F_ID11 NUMBER(11)
);Code: Select all
type
TForm1 = class(TForm)
OraQuery1: TOraQuery;
DBGrid1: TDBGrid;
OraSession1: TOraSession;
OraDataSource1: TOraDataSource;
BitBtn1: TBitBtn;
OraQuery1F_ID09: TIntegerField;
>>> OraQuery1F_ID10: TFloatField; <<<
OraQuery1F_ID11: TFloatField;Re: Problem with IntegerPrecision in the OraClasses.pas module
hello,
Setting local variable values will produce an effect only at run-time, and since persistent fields are created at design-time, then the value of this variable is 9 (the default value). Therefore your fields are created correctly. To change this behaviour, you should either edit our sources (if you have a source code version), or use Data Type Mapping to change field type in design-time.
Setting local variable values will produce an effect only at run-time, and since persistent fields are created at design-time, then the value of this variable is 9 (the default value). Therefore your fields are created correctly. To change this behaviour, you should either edit our sources (if you have a source code version), or use Data Type Mapping to change field type in design-time.
-
StanislawS
- Posts: 6
- Joined: Thu 19 Jul 2012 15:42
Re: Problem with IntegerPrecision in the OraClasses.pas module
Hello,
OK, it is clear.
Thank you for the help.
OK, it is clear.
Thank you for the help.
Re: Problem with IntegerPrecision in the OraClasses.pas module
hello,
If you have any other questions, feel free to contact us.
If you have any other questions, feel free to contact us.