Error with Queries with Order by Clause using MIDAS and persistent fields
Error with Queries with Order by Clause using MIDAS and persistent fields
I am getting problems with queries returning an incorrect order when using an Order by Clause. A problem that did not exist when using the BDE.
The problem is with ODAC queries that
1. Have persistent fields
2. some of these fields have the pfInKey included in ProviderFlags
3. Are used via MIDAS and a dataset Provider
4. Compiled using Delphi 5.
The reason for this is that TOraQuery does not seem to implement the function PSGetDefaultOrder which the provider uses to get records in the required order.
We have fixed the problem by creating a ToraQuery descendant class, but I would rather this was fixed in the standard Toraquery to avoid conflicts in the future.
Can anyone confirm the problem and give estimates for when a fix could be distributed.
Thanks
The problem is with ODAC queries that
1. Have persistent fields
2. some of these fields have the pfInKey included in ProviderFlags
3. Are used via MIDAS and a dataset Provider
4. Compiled using Delphi 5.
The reason for this is that TOraQuery does not seem to implement the function PSGetDefaultOrder which the provider uses to get records in the required order.
We have fixed the problem by creating a ToraQuery descendant class, but I would rather this was fixed in the standard Toraquery to avoid conflicts in the future.
Can anyone confirm the problem and give estimates for when a fix could be distributed.
Thanks
RE: Toraquery order by clause problem when using MIDAS & persistent fields
To the Corlelab team,
Can you confirm that the problem I had identified has been fixed in version 5.55
Thanks
Can you confirm that the problem I had identified has been fixed in version 5.55
Thanks
Still it has a problem: When the ordinance field is a function, the OraProvider does not classify correctly.Alex wrote:Yes, we have included this feature in ODAC 5.50.1.18. If you encounter any problem with it pls. inform us.
Example:
Code: Select all
SELECT AnyDate, AnyType, AnyNumber
FROM AnyTable
ORDER BY Trunc(AnyDate), AnyType
The OraProvider classifies only for the AnyType field.
Error with Queries with Order by Clause using MIDAS - **** FIXED ****
Anonymous wrote:Still it has a problem: When the ordinance field is a function, the OraProvider does not classify correctly.Alex wrote:Yes, we have included this feature in ODAC 5.50.1.18. If you encounter any problem with it pls. inform us.
Example:
Code: Select all
SELECT AnyDate, AnyType, AnyNumber FROM AnyTable ORDER BY Trunc(AnyDate), AnyType
The OraProvider classifies only for the AnyType field.
Already I solved the problem. The error is in the TOraDataSet.PSGetDefaultOrder function in Ora.pas unit.
The corrected function is of the following form:
Code: Select all
function TOraDataSet.PSGetDefaultOrder: TIndexDef;
....
....
begin
if FKeyFields = '' then { Fix }
Result := inherited PSGetDefaultOrder
else { Fix }
begin
if not Assigned(Result) then
if Trim(IndexFieldNames) '' then
Result := GetIndexForIdxNames
else
Result := GetIndexForOrderBy(GetFinalSQL, Self);
end;
end;
Problem reintroduced
In april 2005 I posted a problem with ToraQuery Component and queries using the the Order By Clause when used via MIDAS
The problem was fixed in versin 5.50.18 but seems to have been reintroduced sometime between then and the release of 5.7
I have looked at the difference between the source files and the following lines of code appear to be different for the TOraDataSet.PSGetDefaultOrder function in the Ora.pas unit
VERSION 5.55.18
Result := inherited PSGetDefaultOrder;
if not Assigned(Result) then
if Trim(IndexFieldNames) '' then
Result := GetIndexForIdxNames
else
Result := GetIndexForOrderBy(GetFinalSQL, Self);
VERSION 5.7
if FKeyFields = '' then
Result := inherited PSGetDefaultOrder
else
if Trim(IndexFieldNames) '' then
Result := GetIndexForIdxNames
else
Result := GetIndexForOrderBy(GetFinalSQL, Self);
Can someone confirm that this is a problem and that it will be resolved in a future build.
Thanks in advance.
The problem was fixed in versin 5.50.18 but seems to have been reintroduced sometime between then and the release of 5.7
I have looked at the difference between the source files and the following lines of code appear to be different for the TOraDataSet.PSGetDefaultOrder function in the Ora.pas unit
VERSION 5.55.18
Result := inherited PSGetDefaultOrder;
if not Assigned(Result) then
if Trim(IndexFieldNames) '' then
Result := GetIndexForIdxNames
else
Result := GetIndexForOrderBy(GetFinalSQL, Self);
VERSION 5.7
if FKeyFields = '' then
Result := inherited PSGetDefaultOrder
else
if Trim(IndexFieldNames) '' then
Result := GetIndexForIdxNames
else
Result := GetIndexForOrderBy(GetFinalSQL, Self);
Can someone confirm that this is a problem and that it will be resolved in a future build.
Thanks in advance.