Subject Re: Firebird: has ORDER BY in INSERT INTO... FROM being added?
Author Marco Menardi
--- In ib-support@yahoogroups.com, "Martijn Tonies" <m.tonies@u...> wrote:
> Hi Marco,
>
> > Hi, I can't test FB RC2, so, since there is no mention in "What's new"
> > document, does anyone here know if this syntax is now correct (and
> > works ;))?
> > insert into PhoneList(client_id)
> > select client_id from Clients order by birthday
>
> Why the ORDER BY?
>

For instance, I have triggers that prevent inserting people jounger
than the older in the table, or force code to be longer thant the
previous entered, and so on. When I need to "copy" the data from one
table to the other without "order by" I will not know the order in
which the records are extracted and then inserted, so trigger
generated exception can be risen. Of course I can use some tricks (C.
Valderrana time ago suggested the use of group by, or someone else a
selectable procedure with order by inside, etc.), but having "order
by" working also here seems very good to me.
One of the worse think I've found in Interbase/Firebird what the
scarce "ortogallity", some costructs work in one context but not in
another, and this slows down developement a lot :(
FB 1.5 seems much better, but hope it will improve aven further.
regards
Marco Menardi