By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,589 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,589 IT Pros & Developers. It's quick & easy.

Getting error whle changing the Datatype of a column in the table.

P: 11
I am new at DB2 . so please guide

I am trying to change the Datatype of a column in the table.

CREATE TABLE testschema.player (
NAME VARCHAR(120) NOT NULL,
country VARCHAR(80) NOT NULL,
club VARCHAR(120) ,
totalgoals SMALLINT not null with DEFAULT 0 ,
goalsinpresentseason SMALLINT not null with DEFAULT 0 ,
posn VARCHAR(8) not null ,
jerseyno SMALLINT ,
valueinmilliondollars Decimal(5,2)
)
/

alter table testschema.player alter column posn set data type VARCHAR(2)

but i am getting the error saying
LTER TABLE "TESTSCHEMA.PLAYER" specified attributes for column "POSN" that are not compatible with the existing column.

please help
Jun 28 '07 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
I am new at DB2 . so please guide

I am trying to change the Datatype of a column in the table.

CREATE TABLE testschema.player (
NAME VARCHAR(120) NOT NULL,
country VARCHAR(80) NOT NULL,
club VARCHAR(120) ,
totalgoals SMALLINT not null with DEFAULT 0 ,
goalsinpresentseason SMALLINT not null with DEFAULT 0 ,
posn VARCHAR(8) not null ,
jerseyno SMALLINT ,
valueinmilliondollars Decimal(5,2)
)
/

alter table testschema.player alter column posn set data type VARCHAR(2)

but i am getting the error saying
LTER TABLE "TESTSCHEMA.PLAYER" specified attributes for column "POSN" that are not compatible with the existing column.

please help
Do you have a view on your table? You may need to drop that first.
Which version are you using?
Jun 28 '07 #2

P: 11
Do you have a view on your table? You may need to drop that first.
Which version are you using?
There is no view corresponding to that table
using DB2 9
Jun 29 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.