Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / April 2008

Tip: Looking for answers? Try searching our database.

Drop / Rename a Column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gladiator - 03 Apr 2008 17:23 GMT
Hi Team ,

Can some one tell me why we dont we have a DROP column or rename a
column command in DB2 ? I Have a very Huge table and need to rename a
column . The only option i have to do to rename a column which i by
mistake spelled it wrong was to drop the Whole Table ????

Thanks in Advance ,
Kamal.
Serge Rielau - 03 Apr 2008 17:59 GMT
> Hi Team ,
>
> Can some one tell me why we dont we have a DROP column or rename a
> column command in DB2 ? I Have a very Huge table and need to rename a
> column . The only option i have to do to rename a column which i by
> mistake spelled it wrong was to drop the Whole Table ????
You can DROP COLUMN in DB2 9 for LUW.
So you can do:
SET INTEGRITY... OFF
ALTER TABLE ... ADD COLUMN ...GENERATED ALWAYS AS (oldcolname);
SET INTEGRITY .. FORCE GENERATED;
ALTER TABLE .. DROP GENERATED
ALTER TABLE .. DROP COLUMN oldcolname
REORG

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.