In previous version (6.1.5) it works perfectly.
In version 6.6.0 beta I can't set SortedFields like this:
SortedFields:='OP_DATE DESC,OP_NUMBER';
When I check in debugger content of this property after this
line I see this:
'OP_DATE'
I checked code of ZAbstractRODataset and this is what I saw in
procedure SetOrderFields
{removing ASC or DESC behind space}
if Pos(' ',Value)>0 then
Value:=Copy(Value,1,Pos(' ',Value)-1); {bangfauzan addition}
This code REMOVES ALL TEXT AFTER SPACE!!!,
regardless with or without ASC or DESC in text.
Including FIELDS!!! (i.e. 'OP_DATE, OP_NUMBER')
After that procedure sets the sort type on base FIndexFieldNames (???),
than sets FindexFieldsNames with that sort type on the end.
Interesting idea.
For example:
SortType:=stDescending;
SotedFields:='OP_DATE';
Result-> FIndexFieldNames='OP_DATE Desc'
but after
SortedFields:='OP_DATE,OP_NUMBER';
Result-> FIndexFieldNames='OP_DATE,OP_NUMBER Desc'
BAD SORT ORDER!!! LAST FIELD IS SORTED DESCENDING!!!
(Why? Because SortType is set to stDescending)
and after
SortedFields:='OP_DATE DESC,OP_NUMBER';
Result-> FIndexFieldNames='OP_DATE Desc'
BAD SORT ORDER!!! ONLY FIRST FIELD IS ON LIST!!!
(Why? Because there is a Space after this field)
In my opinion in this version there is no method to
set the proper order with many fields in this dataset.
I must use the previous version of this file.
[bug_fixed] Bug in ZAbstractRODataset (6.6.0 beta version)
Moderators: EgonHugeist, mdaems
I am little bit lost here.
I did not test all of this "sorted fields" issues but looking at the source I am under impression that the only construction possible is like this:
.... ORDER BY Field1,Field2,Field3,Field4 ASC
but what about this one:
.... ORDER BY Field1 ASC, Field2 DESC, Field3 ASC, Field4 DESC
i.e. sorting direction different for every field?
I for myself construct SQL queries manualy and never hit this case but.. now I'll check it.
Plamen
I did not test all of this "sorted fields" issues but looking at the source I am under impression that the only construction possible is like this:
.... ORDER BY Field1,Field2,Field3,Field4 ASC
but what about this one:
.... ORDER BY Field1 ASC, Field2 DESC, Field3 ASC, Field4 DESC
i.e. sorting direction different for every field?
I for myself construct SQL queries manualy and never hit this case but.. now I'll check it.
Plamen
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi,
In the meantime this behaviour has changed. See testing and trunk snapshots available here.
I'll close this bug report. If there's still an error and it's not in an other bugreport we can reopen this one. Fauzan is still reviewing his code for some other bugs, however.
Mark
In the meantime this behaviour has changed. See testing and trunk snapshots available here.
I'll close this bug report. If there's still an error and it's not in an other bugreport we can reopen this one. Fauzan is still reviewing his code for some other bugs, however.
Mark