Re: INSERT INTO with SELECT

From: Brad Murray <BradMurray_at_SeeSignatureIfThere.com>
Date: 1998/01/27
Message-ID: <MPG.f3806cbfbd4affc989913_at_news>#1/1


In article <01bd2a61$ea492b60$3b81170a_at_smalld>, SmallD_at_csi.com said...  

> If I use an INSERT INTO clause, followed be a SELECT clause, followed by
> an ORDER BY clause I receive an error message ("SQL command not properly
> ended"). If I remove the ORDER BY clause, the statement works fine. Is
> there a way to include the ORDER BY clause in Oracle? Most other RDBMS's
> permit it in the INSERT INTO/SELECT statements.

Is there any real reason to insert in that order? The order the data takes in the table doesn't matter and if it does you will specify an order by clause when you query the table in the future.

I am assuming you want to be able to order by the table's key in the future and get the records in the order that they were entered and yet you want to control that order as they are inserted. Oracle has some bug up its ass against you ordering in an insert into statement, the same way you can't put an order by in a view definition.


 Bradley S. Murray       Princeton Computer Consulting  (609) 730-9100
 BradMurray(-at-)usa.net   Pennington, NJ 08534-3612     Fax: 730-0761
                            http://pcci.home.ml.org
Received on Tue Jan 27 1998 - 00:00:00 CET

Original text of this message