Subject Re: User defined self-join order (KAO: Svein)
Author venussoftop
Thanks a lot Karol. I will keep both the options in mind.

--- In firebird-support@yahoogroups.com, "karolbieniaszewski" <liviuslivius@...> wrote:
>
>
> --- In firebird-support@yahoogroups.com, "venussoftop" <venussoftop@> wrote:
> >
> >
> >
> > --- In firebird-support@yahoogroups.com, Svein Erling Tysvær <svein.erling.tysvaer@> wrote:
> > > There is no ORDER BY on the final result set and not even on the CTE. I don't know whether there is some reason for CTEs to be returned in a particular order - so far I've thought of them as being a way to produce a temporary table, and tables just store data, they're not ordered. It might well be that the order isn't random, I just don't know.
> >
> > Okay, so the worry is that a future version may bring out records in a different manner and without an ORDER BY we'd observe something similar we observed previously. Putting a ORDER BY was my first shot at the past-present problem.
> >
> > Is there any other way to get the order, without too much coupling with the tree structure, instead of the iSrNo field, that I have used? The app in this regards is still fresh to be updated without much pains at this stage, if it would help in future-proofing the SQL query.
> >
> > Please advise.
> >
> > Thanks and regards.
> > Bhavbhuti
> >
>
>
> May be better in your situation will be
> stored procedure?
> you can sort anything you want and compute anything you want
> inside it you can use execute statement change sort ..
>
> or simpler execute block
> there you can write anything like stored procedure but without changing database metadata
> but execute block have some limitation of cursor count i do not remember what value then i suppose stored proc will be better
>
> Karol Bieniaszewski
>