By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,686 Members | 1,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,686 IT Pros & Developers. It's quick & easy.

Drop / Rename a Column

P: n/a
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.
Apr 3 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gladiator wrote:
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
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Apr 3 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.