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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Renaming a column in 8i Personal version

Re: Renaming a column in 8i Personal version

From: TurkBear <noone_at_nowhere.com>
Date: Thu, 07 Jun 2001 12:10:25 -0500
Message-ID: <66dvhtop9vmqei4npq9jl6va9f5m5o7k6b@4ax.com>

No problem, that method works with tables that have data in them as well, but it takes longer and you will have to redo any views, indexes, etc.. If there is data in it, and you just want to copy the structure, you can use Create table new_table as select * from old_table where 1 = 2; This will create new_table with the same columns and types as old_table but with no data, since 1 never equals 2 ( I hope)

"Julius Siojo" <siojo_at_ejward.com> wrote:

>Thanks a lot.
>
>Julius
>
>"TurkBear" <noone_at_nowhere.com> wrote in message
>news:gp9vhtcpuqjits5f4f3qp33m04m2okqpr8_at_4ax.com...
>>
>> You fail to specify what version of Oracle you are using, but, generally,
 you
>> cannot rename a column...
>> Since the table is empty try this:
>> when connected as OwnerC:
>> rename TableB to TableB_Old;
>> create TableB as select ColumnA NewColumnName,* from TableB_Old;
>>
>>
>
>
Received on Thu Jun 07 2001 - 12:10:25 CDT

Original text of this message

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