Page 1 of 1
Error with Queries with Order by Clause using MIDAS and persistent fields
Posted: Tue 12 Apr 2005 09:20
by Andew
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
Posted: Wed 13 Apr 2005 08:30
by Alex
We will include this functionality in the next ODAC build.
Posted: Fri 15 Apr 2005 08:43
by Guest
Thanks Alex for your quick response and resolution.
I'll look forward to the new build
Andrew
RE: Toraquery order by clause problem when using MIDAS & persistent fields
Posted: Mon 06 Jun 2005 09:25
by Andew
To the Corlelab team,
Can you confirm that the problem I had identified has been fixed in version 5.55
Thanks
Posted: Wed 08 Jun 2005 06:06
by Alex
Yes, we have included this feature in ODAC 5.50.1.18. If you encounter any problem with it pls. inform us.
Posted: Tue 18 Oct 2005 17:24
by Guest
Alex wrote:Yes, we have included this feature in ODAC 5.50.1.18. If you encounter any problem with it pls. inform us.
Still it has a problem: When the ordinance field is a function, the OraProvider does not classify correctly.
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 ****
Posted: Tue 18 Oct 2005 18:59
by F.Silva
Anonymous wrote:Alex wrote:Yes, we have included this feature in ODAC 5.50.1.18. If you encounter any problem with it pls. inform us.
Still it has a problem: When the ordinance field is a function, the OraProvider does not classify correctly.
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;
Posted: Thu 20 Oct 2005 13:46
by Alex
Thank you for support.
We will include such fix in then next ODAC build.
Problem reintroduced
Posted: Thu 01 Jun 2006 14:38
by Andew
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.
Posted: Mon 05 Jun 2006 07:57
by Alex
We cannot reproduce the problem. Please send to ODAC support address complete sample that
demonstrates the problem and include script to create server objects.