Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to expand a column from SMALLINT to BIGINT. I get the error: SQL0104N An unexpected token "BIGINT" was found following ""TYPE SET DATA TYPE". Expected tokens may include:"". SQLSTATE=42601

share|improve this question

1 Answer 1

up vote 0 down vote accepted

On the DB2 reference for Alter Table you can only alter string (VARCHAR) related data types.

The alternative is to add a new column TEMP of type BIGINT, copy the value from column A to column TEMP, rename A to OLD, rename the TEMP to A, and finally drop OLD.

share|improve this answer
    
This suggested solution won't work on DB2 8.2 either, because you can't use ALTER TABLE to drop a column. You have to drop and recreate the table. (Or create a second copy of the table and rename the tables). –  Ian Bjorhovde Jan 7 '11 at 1:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.