Tomas,
  Well I also checked the manual but as I was in the seminar about the V8 Functions and Features, we were told that we can do it. But I would guess it may be a feature in V8+1. But I still have a copy of the presentation and his explanation about one of them was that we can change a column type from a smaller size to a larger size.
There are some features for which he said when you migrate you need to drop and recreate it to take into affect in z/Os I don't know if that holds good for other platform. Also the talk about the feature was in z/Os.
Thanks,
Syed
-----Original Message-----
From: Hallin, Tomas (HQP) [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 3:22 PM
To: 'Fazal, Syed (TATA)'; 'Sunil Inchal'; [EMAIL PROTECTED]
Subject: RE: [DB2EUG] ALTER TABLE QUESTION

You can?  How?  The V8 manual still states that the only data type change that can be done with ALTER TABLE is to extend VARCHARs.  A bunch of other stuff can be done in the ALTER COLUMN clause, but I don't see anything that would support converting a smallint to a decimal, for instance.
 
/T
 
Tomas Hallin
Database Administration
Robert Half International
Pleasanton, CA
-----Original Message-----
From: Fazal, Syed (TATA) [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 11:51 AM
To: 'Sunil Inchal'; [EMAIL PROTECTED]
Subject: RE: [DB2EUG] ALTER TABLE QUESTION

With DB2 you can only Alter a Column data type of Data type CHAR but to change it from other Data type you need to drop the table and recreate it. In case of V8 you can do an alter of the column but still there is a restriction of Alter. In case of V8 you can alter a column like you want from SMALLINT to DECIMAL(16,2) but only the new data type should be larger  than the old data type.
 
-----Original Message-----
From: Sunil Inchal [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: [DB2EUG] ALTER TABLE QUESTION

Hi group,
 
How do I alter column type and drop a column in DB2 using ALTER TABLE or any other command?
I read in the documents that only columns with CHAR type could be altered using
ALTER TABLE <tabname>
ALTER COLUMN <column>
....
 
I want to change a SMALLINT datatype to DECIMAL(16,2). Also I need to drop an existing column.
In Informix IDS it is a very easy to perform the above using ALTER command. But I don't know how to do it in DB2.
Finally, what I did was backed up data using EXPORT utility, dropped the table and recreated with changed schema and reloaded the data using LOAD utility.
Are there any other ways to do it?
 
Thanks and regards
 
Sunil
 

Reply via email to