Home » SQL & PL/SQL » SQL & PL/SQL » how can i change the column name from particular table
how can i change the column name from particular table [message #40815] Thu, 07 November 2002 06:20 Go to next message
Gurdeep Singh
Messages: 64
Registered: October 2002
Member
please tell me how can i change the column name of particular table.
Re: how can i change the column name from particular table [message #40820 is a reply to message #40815] Thu, 07 November 2002 07:17 Go to previous messageGo to next message
Rick Cale
Messages: 111
Registered: February 2002
Senior Member
It depends on the Oracle version of method to use.
BTW, all messages at a minimum should include OS and
Oracle version. If you are using <= 8.0

1.Rename the existing table
2.Create a new table with new column names from the renamed table.
3.Drop the renamed table.
Of course you have to grant privs again

In 8i and above
1. ADD new columns
2. UPDATE new column with contents of old col
3. DROP old column using
ALTER TABLE
SET UNUSED COLUMN <old_col>;
ALTER TABLE
DROP UNUSED COLUMNS;
Re: how can i change the column name from particular table [message #40837 is a reply to message #40820] Thu, 07 November 2002 09:37 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
And in 9iR2, you can rename the column directly.
Previous Topic: how to print sql table
Next Topic: how to copy a table
Goto Forum:
  


Current Time: Mon Apr 29 04:27:42 CDT 2024