| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |
|

04-19-04, 09:40
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 31
|
|
|
Rename column in db2
|
|
Hi, everyone
i want to learn , how can i rename column name in db2?
we are using db2 OS/390 7.0 and
i m doing,
ALTER TABLE TableName RENAME COLUMN OldName TO NewName
but it's not getting..
thanks...
|
|

04-19-04, 09:53
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Are you kidding me? You need to download the SQL Reference guide from the IBM website. It is free. There is no such syntax to rename a column.
http://www-306.ibm.com/software/data...s/library.html
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

04-19-04, 15:53
|
|
Registered User
|
|
Join Date: Mar 2004
Location: Ottawa
Posts: 21
|
|
|
|
Hi Paren, you'll have to drop the table and redo with the proper column name. If you have some information in the table, before you drop the table you'll have to create a temporary table, insert all the info into that table, drop the old table, create the new tablespace, create the new table with the right column names and column definitions. If you have any, redo any primary and foreign you have. Give grant access to users and then insert all the information from the temporary table.
That's what we have to do here and we are using DB2 version 7.1 for OS/390.
__________________
Mbourd25
|
|

04-20-04, 01:40
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 31
|
|
thanks a lot Marcus_A and mbourd_d25
|
|

02-18-10, 09:03
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 1
|
|
Hi
hi folks....im working on DB 9.1 on z/os platform.....
the rename command work for v 9.1..i dunno what versions you are talking about....see my command
ALTER TABLE G31.TG31PDIX RENAME COLUMN RECORD_KEY TO RECORD_KEYY;
DSRZDB2D (s6wbq5) 7:23:43 PM 0:00:00.810 Execution successful ALTER TABLE G31.TG31PDIX RENAME COLUMN RECORD_KEY TO RECORD_KEYY..... 
|
|

02-18-10, 09:16
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Quote:
Originally Posted by abhi_srk
hi folks....im working on DB 9.1 on z/os platform.....
the rename command work for v 9.1..i dunno what versions you are talking about....see my command
|
You are responding to posts from May 2004. That is almost 6 years ago.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

10-27-10, 13:04
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 19
|
|
Abhi, thanks. Its good to update old posts so people can find answers on google thereby making this a more popular and successful board.
Marcus, I'm not sure why you're still allowed to post here after your initial response.
|
|

10-27-10, 15:39
|
|
Registered User
|
|
Join Date: Nov 2005
Location: IL
Posts: 554
|
|
|
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
DB2 v9.1.0.2 os 5.3.0.0
|
|

10-27-10, 16:50
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Quote:
Originally Posted by hifferyj
Marcus, I'm not sure why you're still allowed to post here after your initial response.
|
You mean my post from 2004? Because people should check the manual to see if a particular syntax is allowed, instead of just being lazy. If they don't understand the manual or have some question about it (or they could not find the subject in the manual), then it is perfectly fine to ask.
As to why I am allowed to post, it probably has something to do with the fact that (unlike you) I have answered several thousand legitimate questions with very useful information and/or advise.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

10-27-10, 17:07
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 19
|
|
And unlike me, in a great number of them, you've berated people.
|
|

10-27-10, 17:46
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Quote:
Originally Posted by hifferyj
And unlike me, in a great number of them, you've berated people.
|
You mean like you berate me?
I just ask people to be courteous and make an honest effort to read the documentation first and then ask questions. I doubt you have read very many of the more than 4000 questions I have answered, so I don't take your opinion very seriously.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

10-27-10, 19:47
|
|
∞∞∞∞∞∞
|
|
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
|
|
Quote:
Originally Posted by marcus_a
i have answered several thousand legitimate questions with very useful information and/or advise.
|
100% .
|
|

10-27-10, 21:44
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 19
|
|
Actually, before I initially responded, I clicked on "View All Posts" and witnessed a few instances of your very own brand of courtesy.
Your initial post here was condescending and uncalled for. Granted, it was 6 years ago but your stripes haven't changed all that much.
I didn't berate you. I called you out on something. So if you don't put much stock in my opinions, dig elsewhere and move on . . .
|
|

10-27-10, 22:06
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Quote:
Originally Posted by hifferyj
Actually, before I initially responded, I clicked on "View All Posts" and witnessed a few instances of your very own brand of courtesy.
Your initial post here was condescending and uncalled for. Granted, it was 6 years ago but your stripes haven't changed all that much.
I didn't berate you. I called you out on something. So if you don't put much stock in my opinions, dig elsewhere and move on . . .
|
If someone tries to execute a specific comand such as:
"ALTER TABLE TableName RENAME COLUMN OldName TO NewName"
and it does not work, I don't think it is unreasonable to suggest to that person that they look in manual to see if that is valid syntax.
Maybe you didn't notice, but the original poster in 2004 thanked me for my answer, perhaps because I posted a link to the manuals.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

10-27-10, 22:42
|
|
∞∞∞∞∞∞
|
|
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
|
|
hifferyj, Let's be "DB2 friends".
Marcus is one of the most knowledgeable DBAs and I'm sure many people are learning a LOT from his posts. I do!
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|