Typ mismatch expected integer actual float - strange problem

NDzubiel

Member²
Hi @all,

I have a strange problem:

using: Oracle 10.2.0.1.0
DOA 4.0.7.1
Delphi 6 - all patches.

Okay, I defined a field "position" as number (9).
I am developing on 10.1.0.3.0 - everything runs
fine. When I try the same query on productive
Oracle database 10.2.0.1.0 I get the error message
"Typ mismatch expected integer actual float "
When I do a "descr" on the the table it says "number (9)"

Soooooooooooo can anybody help ?

Thank you

Nils
 
No view, union nothing.
Just a plain table.

Trace:

Call Stack Information:
----------------------------------------------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
----------------------------------------------------------------------------------------------------------------------------
| Exception Thread: ID=7476; Priority=0; Class=; [Main] |
|--------------------------------------------------------------------------------------------------------------------------|
|004ECE82|aes32!32-Test.exe|DB.pas | |DatabaseError |2350[2] |
|004ECE18|aes32!32-Test.exe|DB.pas | |DatabaseError |2348[0] |
|004ECF0B|aes32!32-Test.exe|DB.pas | |DatabaseErrorFmt |2357[1] |
|004ECED0|aes32!32-Test.exe|DB.pas | |DatabaseErrorFmt |2356[0] |
|004FE025|aes32!32-Test.exe|DB.pas |TDataSet |CheckFieldCompatibility |9092[4] |
|004FE2A0|aes32!32-Test.exe|DB.pas | |DoBindFields |9136[26] |
|004FE0D8|aes32!32-Test.exe|DB.pas | |DoBindFields |9110[0] |
|004FE3A1|aes32!32-Test.exe|DB.pas |TDataSet |BindFields |9161[4] |
|004FE374|aes32!32-Test.exe|DB.pas |TDataSet |BindFields |9157[0] |
|004FD706|aes32!32-Test.exe|DB.pas |TDataSet |DoInternalOpen |8858[2] |
|004FD6E4|aes32!32-Test.exe|DB.pas |TDataSet |DoInternalOpen |8856[0] |
|004FD7D6|aes32!32-Test.exe|DB.pas |TDataSet |OpenCursor |8887[4] |
|004FD671|aes32!32-Test.exe|DB.pas |TDataSet |SetActive |8840[12] |
|004FD46E|aes32!32-Test.exe|DB.pas |TDataSet |Open |8796[1] |
|004FD460|aes32!32-Test.exe|DB.pas |TDataSet |Open |8795[0] |
|0115D802|aes32!32-Test.exe|Kalkulationsblatt.pas|TKalkulationsBlattForm|Enter |862[30] |
|0115D648|aes32!32-Test.exe|Kalkulationsblatt.pas|TKalkulationsBlattForm|Enter |832[0] |
 
The scale or precision of this field is apparently different on the 10.2 database. Either the precision is more than 9 digits, ot the scale is non-zero. Otherwise it would be represented by a TIntegerField.

As a test you could run a TOracleQuery on this table.column and check TOracleQuery.FieldScale and TOracleQuery.FieldPrecision, on both databases.
 
Sorry,

we thought that the problem was gone.
Still the same problem. I think we have to
move back to Oracle 10gR1

Nils
 
If the problem is limited to a specific table/column, you could modify the SQL of the dataset to force the field to a TFloatField. Just add a dummy calculation. Instead of:

select * from dept

You can use

select deptno + 0 as deptno, dname, loc from dept

Now the deptno field is represented by a TFloatField.
 
hmmm,
no problem is that the field is an integer an I want it to be an integer - not a float. Anyway I will try
a cast number (9) and see what is happening.

Nils
 
You can solve this problem by using TOracleDataSet. Just remove the Fields und recreate them connected to a 10.2-Database, and it will work.

Guido
 
Back
Top