View previous topic :: View next topic
|
Author |
Message |
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
How can we modify the structure of a DB2 Table.
eg. i have a column with CHAR(10) but, i want it to be CHAR(15) now. |
|
Back to top |
|
|
raviprasath_kp Warnings : 1 New User
Joined: 20 Feb 2005 Posts: 65 Location: chennai
|
|
|
|
use alter command |
|
Back to top |
|
|
birdy K
New User
Joined: 05 Mar 2008 Posts: 72 Location: chennai
|
|
|
|
We cant use alter command for Char, only we can use for varchar. I think Im Right. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
Back to top |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
To make it clear in DB2, using Alter command, we cannot increase the Character column length.
What you can do is Drop the column which has size as 10 bytes and using the Alter command add a new column with size as 15.
But the problem here is you cannot add the column exactly at the same position where your previous column was. It will be added at the end.
Hope this would help you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you drop/add, make sure you have a backup first. . .
You will probably need to reload the 10-char existing data into the new 15-char field. |
|
Back to top |
|
|
|