468,244 Members | 2,028 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

specified attributes not existing with existing column error on Altering table

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
2 5125
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
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.

Similar topics

4 posts views Thread by Mike Jansen | last post: by
1 post views Thread by Prabu Subroto | last post: by
23 posts views Thread by Frank Millman | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.