Re: Unable to use ORDER BY in an INSERT statement

From: Joseph Thvedt <jthvedt_at_brookings.net>
Date: 1996/02/04
Message-ID: <4f1rla$1sf_at_news.corpcomm.net>#1/1


dlumby_at_axion.bt.co.uk (Dave Lumby) wrote:

>Folks,
> I'm trying to transfer fields from one table to another in a specific
>order.

[snip]

>At present the only route I can thing of that will work as required is to
>run the SELECT ... ORDER BY ... statement and then itterate through the
>result issuing succesive statements like -
 

>INSERT INTO new_table (user_ref, start, rec_id) VALUES ('654321', '07:30', 1);
>INSERT INTO new_table (user_ref, start, rec_id) VALUES ('400000', '07:30', 2);
>etc

This last idea is a _little_ like what I'd try: use a PL/SQL cursor for loop. There's probably a better example in the 2.0 book, but I have only the version 1.0 book handy. If you've got that, you can see the example on p. 6-54.



Joseph Thvedt
jthvedt_at_brookings.net Received on Sun Feb 04 1996 - 00:00:00 CET

Original text of this message