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

specified attributes not existing with existing column error on Altering table

P: n/a
Hi.

I have created a table

CREATE TABLE testschema.player (
country VARCHAR(80) NOT NULL,
posn VARCHAR(2) not null
)
/

and tried to alter it using
Alter table testschema.player alter column country set data type
Varchar(3)

but it's giving error saying
Error: ALTER TABLE "TESTSCHEMA.PLAYER" specified attributes for column
"COUNTRY" that are not compatible with the existing column.

Can anybody help and tell the reason?

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


P: n/a
Rahul B wrote:
Hi.

I have created a table

CREATE TABLE testschema.player (
country VARCHAR(80) NOT NULL,
posn VARCHAR(2) not null
)
/

and tried to alter it using
Alter table testschema.player alter column country set data type
Varchar(3)

but it's giving error saying
Error: ALTER TABLE "TESTSCHEMA.PLAYER" specified attributes for column
"COUNTRY" that are not compatible with the existing column.

Can anybody help and tell the reason?
[lelle@53dbd181 lelle]$ db2 "? SQL0190N"
SQL0190N ALTER TABLE "<table-name>" specified attributes for
column "<column-name>" that are not compatible with the
existing column.
Explanation:

[...]
- the length of the column is greater than the length specified
in the clause

Jun 28 '07 #2

P: n/a
On Jun 28, 4:06 pm, Rahul B <rahul.babb...@gmail.comwrote:
Hi.

I have created a table

CREATE TABLE testschema.player (
country VARCHAR(80) NOT NULL,
posn VARCHAR(2) not null
)
/

and tried to alter it using
Alter table testschema.player alter column country set data type
Varchar(3)

but it's giving error saying
Error: ALTER TABLE "TESTSCHEMA.PLAYER" specified attributes for column
"COUNTRY" that are not compatible with the existing column.

Can anybody help and tell the reason?


U cannot decrease the size of the column.(VARCHAR(80) to
VARCHAR(3) )..Try Using SYSPROC.ALTOBJ procedure..

Thanks

Jun 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.