abby13
16th August 2010, 16:11
hi,


If i dont use order by in baan query and also not in report, how is the sorting determined.

When i run the query(which has no order by defined and also no sorting in report) it gives me different sorting in different databases.

In one it gives me the sorted o/p on report , on the other one it is random.

Any idea what could cause this?

Regards,

abby13

bdittmar
16th August 2010, 19:48
hi,


If i dont use order by in baan query and also not in report, how is the sorting determined.

When i run the query(which has no order by defined and also no sorting in report) it gives me different sorting in different databases.

In one it gives me the sorted o/p on report , on the other one it is random.

Any idea what could cause this?

Regards,

abby13

Hello,

afaik the sort order is the start index (Main) of the table.

Regards

abby13
17th August 2010, 17:38
hi Bernd,

thanks for the update.
Yes , if no sort order is defined then it should be sorted on the primary index.

But in my case, for one database the o/p is sorted on primary index on the baan report.
however on other database , the same report is not sorted at all.

the primary index is same in both databases.

is there any internal setting in baan which controls sorting ,when no sorting is defined in the proram script or the report?

Thanks,

Abby13

SujithKumar
17th August 2010, 19:18
Why do you ask? What are you trying to do?

mark_h
18th August 2010, 01:17
Did you make sure the reports are exactly the same for both companies? Did you also check that the index is completely the same for both companies? Just somethings to verify. I remember having this exact same problem before - I probably posted about it somewhere. I cannot remember what we traced it to. I do know that there are some Oracle optimizer or settings that could impact the sorts or how the query is parsed. I do know that we almost always set the report to have some sort.

You can searching on it, but for the life of me I can't remember what caused it. I do know it had to do with production order and operations. I know there is something causing this, just not sure what any more - best fix is to always either use order by, or a sort on the report. Another thing I recommend is to use _index1 in sql queries this prevents the oracle driver and optimizer from picking the wrong index.

sameer.don
18th August 2010, 07:24
Hi,
What I have observed while working with Informix is, when we do not specify any sort order data will appear in order, which it was inserted to table. I had checked the same with Print Session

However, if u r using session Maintian SQL Queries (ttadv3180m000) for same, it will sort data on first index.

This could be dependant on porting set too. (but I m not very sure abt porting set).