Subject Re: Problems with "Order by"
Author Svein Erling Tysvær
You should be able to get away with writing one simple function or
procedure that takes the ORDER BY clause as input, removes all but the
first occurence of every field in the ORDER BY and returns this to the
caller. Probably not as elegant a solution as debugging your
procedures, and some of us may be disappointed by not seeing any fume,
but to me this sounds like a no-brainer which makes the most
complicate part simply to identify where you call PREPARE or OPEN, so
that you know when to call this new function.

Though of course Firebird should either report an error or sort
correctly, not decide to mess things up if a column is mentioned more
than once in an ORDER BY.


--- In, "Ingo Breker" wrote:
> Hello again!
> As the select statements are automatically build – and this
> generator is quite complex – the order columns can be recurred.
> And with this the described sorting problem can occur.
> My questions now are:
> - Is there any sense why the database backend changes / mixes the
> sorting
> - Is this a known or an unknown bug
> - Does anybody know an easy solution for this problem
> If not I have to debug my procedures and that means a lot of fume
> that will come out of my brain.
> So if someone could help me, I `d be very VERY grateful!
> Cheerio