TOraSession.UseNumbers := True does not work properly if you use ODAC in conjunction with DevExpress Grids and define grid totals such as SUM below the grid. You will get an error like cannot convert OleStr to Double.
I need long numbers only for one query. The totals are needed for a bunch of other queries. Thats why I would like to have UseNumbers as a property of the dataset rather than of the session. My idea for a workaround was to change the session property temporarily to true while the appropriate query is beeing opened and the turn it back to false.
My questions are:
- Can this have any side effects?
- Would you consider to adding a new property UseNumbers to TOraDataset in a future version?
- An alternative would be that you could reconcile the TOraNumber data type with OleStr and make it working together with DevExpress grid totals computation.
Regards,
Holger
Change UseNumbers dynamically
-
heidenbluth
- Posts: 56
- Joined: Mon 08 Nov 2004 19:01
- Location: Germany
A value of TOraNumberField can be returned only as variant of string type because any Delphi numeric type does not have enough precision. So that the sum cannot be calculated for TOraNumberField.
You can set EnableNumbers option of TOraSession before opening a query. This should not have side effects. So that there is no need to add such property to dataset.
You can also try to use Int64 fields instead of Number fields, if your long numbers do not have a fractional part. These fields should work in the total calculations. To enable Int64 fields, set LargeIntPrecision variable from OraClasses unit in initialization part of one of your program units.
But you cannot create TLargeintField fields at design-time with Fields Editor.
You can set EnableNumbers option of TOraSession before opening a query. This should not have side effects. So that there is no need to add such property to dataset.
You can also try to use Int64 fields instead of Number fields, if your long numbers do not have a fractional part. These fields should work in the total calculations. To enable Int64 fields, set LargeIntPrecision variable from OraClasses unit in initialization part of one of your program units.
Code: Select all
initialization
LargeIntPrecision := 38;
end;