Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Changing column order

Re: Changing column order

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Tue, 23 Mar 1999 20:07:01 +0100
Message-ID: <36f7e663$0$25393@pascal>


Thor Morten Kopaas wrote

> After a table has been created, is there a way to change the
>order in which the columns are displayed

I feel it is bad practise to rely on the database column order, but that is just a matter of taste. In spite of all efforts you will find one day that your production and test database do not have the same column order, as for the production database columns are most like ADDED, while for the test database the whole database might have been re-created, with a different order of the columns in the create table scripts...

You could create a copy of your table, using

    create table my_temp_table as

        ( select empno, name, salary
          from employee
        );

    drop table employee;

    alter table my_temp_table rename to employee;

This is, of course, only a solution if your database constraints allow it.

Arjan. Received on Tue Mar 23 1999 - 13:07:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US