|
You're out of luck, it can't be done with an ALTER statement. As
you observed, the only changes to existing columns that can be done using ALTER
TABLE is increasing the size of a VARCHAR column.
What I would do is:
Create a table with the new definition, and another
name.
Insert data from the old table, casting the datatype appropriately for
your smallint to decimal change.
Rename the original table to whatever_old, or something, so it's still
there in case something hasn't worked as you intended.
Rename the newly created and populated table to the desired
name.
Then of course, there's the issues of things (packages, triggers, views)
that may have depended on this table. They would have been invalidated and
must be recreated.
/T
Tomas Hallin
Database Administration
Robert Half International
Pleasanton, CA
|
- [DB2EUG] ALTER TABLE QUESTION Sunil Inchal
- RE: [DB2EUG] ALTER TABLE QUESTION Fazal, Syed (TATA)
- Re: [DB2EUG] ALTER TABLE QUESTION Sunil Inchal
- RE: [DB2EUG] ALTER TABLE QUESTION Hallin, Tomas (HQP)
- RE: [DB2EUG] ALTER TABLE QUESTION Fazal, Syed (TATA)
- RE: [DB2EUG] ALTER TABLE QUESTION Hallin, Tomas (HQP)
- RE: [DB2EUG] ALTER TABLE QUESTION Fazal, Syed (TATA)
- RE: [DB2EUG] ALTER TABLE QUESTION Philip Nelson
- RE: [DB2EUG] ALTER TABLE QUESTION Fazal, Syed (TATA)
