467,923 Members | 1,838 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

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

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
  • viewed: 1808
Share:
2 Replies
8TB
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
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.

Similar topics

14 posts views Thread by Sanjay Minni | last post: by
2 posts views Thread by Chandra Mohan | last post: by
2 posts views Thread by Kelly Prendergast | last post: by
3 posts views Thread by Jon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.