View previous topic :: View next topic
|
Author |
Message |
shriya reddy Warnings : 1 New User
Joined: 05 Jun 2004 Posts: 43
|
|
|
|
Hi Friends,
I heard we can the length of column using ALTER Stmt in new versions of DB2. please give how we code to change length of the column.
Regards,
Shriya Reddy. |
|
Back to top |
|
|
shriya reddy Warnings : 1 New User
Joined: 05 Jun 2004 Posts: 43
|
|
|
|
Hi Friends,
Anybody give me the answer.
Bye
shriya. |
|
Back to top |
|
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
Hi Shriya,
The following syantax will work. It is available only with DB2 8.2 and higher ok try it out.
ALTER TABLE CUSTOMER COLUMN ADDRESS SET DATA TYPE CHAR (35) |
|
Back to top |
|
|
shriya reddy Warnings : 1 New User
Joined: 05 Jun 2004 Posts: 43
|
|
|
|
Hi OV Reddy
thanks for reply
Shriya |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
using alter table u can only increase the present datatype length.. u cannot decrease it. note that carefully.
Eg:
ALTER TABLE CUSTOMER COLUMN ADDRESS SET DATA TYPE CHAR (35)
can be made as
ALTER TABLE CUSTOMER COLUMN ADDRESS SET DATA TYPE CHAR (55)
but cannot
ALTER TABLE CUSTOMER COLUMN ADDRESS SET DATA TYPE CHAR (15) |
|
Back to top |
|
|
Kavitha Palani
New User
Joined: 16 Nov 2005 Posts: 8
|
|
|
|
ALTER TABLE <TABLE NAME> COLUMN<COLUMN NAME> SET <DATA TYPE > (35) |
|
Back to top |
|
|
sri.mainframes
New User
Joined: 16 Feb 2006 Posts: 29 Location: MUMBAI
|
|
|
|
Hi Shreya
try this one
ALTER TABLE <tablename>
ALTER COLUMN <columnname>
SET DATATYPE <newdatatype> ;
this will work
regards
PRINCE |
|
Back to top |
|
|
|