Oracle 11 and Number(x) fieldtype

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
christian.papaux
Posts: 1
Joined: Wed 24 Mar 2010 10:10

Oracle 11 and Number(x) fieldtype

Post by christian.papaux » Wed 24 Mar 2010 10:33

Hi, we have a very strange behaviour of the TOraQuery with Oracle 11:

Odac version: Professional V 6.90.0.52 for Delphi 6

To reproduce the problem:
- Create 2 test tables with this script:

CREATE TABLE TEST1
(
ID NUMBER(10,0),
FLDNUM1 NUMBER(1) DEFAULT 0 NOT NULL
);
COMMIT;


CREATE TABLE TEST2
(
ID NUMBER(10,0)
);
COMMIT;

ALTER TABLE TEST2 ADD FLDNUM1 NUMBER(1) DEFAULT 0 NOT NULL;
COMMIT;

As you can see, we will end up with 2 identical tables, but the field [FLDNUM1] in Test1 is created directly with the table and in Test2 is added to the table afterwards.

Add a TSession and 2 TOraQuery to a project. In the first query add the select statement SELECT FLDNUM1 FROM TEST1 and SELECT FLDNUM1 FROM TEST2 in the second one.

In the 2 queries, open the fields editor and click 'Add all fields'. The field FLDNUM1 will be created.

The problem: in the query working on Test1, the field type is TIntegerField (correct for a number with a precision < 10).
In the query working on Test2, the field type is TFloatField (incorrect).

I can't figure out what the cause of this is (maybe the way used by the component to retrieve the precision / scale of the field)

This behaviour come only with Oracle 11.

Thanks for any help

Best regards

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 25 Mar 2010 12:50

Hello

We checked your issue on different versions of Oracle server. Really this issue is reproduced only on Oracle 11. The Oracle function OCIAttrGet with parameter OCI_ATTR_PRECISION must return precision of the column of the table. But in Oracle 11 this function returns invalid precision for column FLDNUM1 in the table TEST2. So it seems that this is a problem of Oracle 11.

Post Reply