472,780 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 software developers and data experts.

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

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
2 1930
r035198x
13,262 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
Rahul B
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

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

Similar topics

14
by: Sanjay Minni | last post by:
What is the datatype to be used for Primary Key columns for most optimised access given that - There will be a single column primary key only - The values will only be integers (but as...
2
by: Chandra Mohan | last post by:
Getting 0 padded values in the columns. Hi All, I have a requirement to convert a integer to string and display it in Sql server with fixed length say 3 chars. (in c, we wud use %03d in...
2
by: Kelly Prendergast | last post by:
Hi all, I need to change a varchar from 35 to 50. In the SQL Server books on line it says that SQL Server actually creates a new table when you change the length. I ran a test in a test database...
13
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify...
10
by: andrewcw | last post by:
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date I deserialize my XML and one attribute of the XSD has type as dateTime but upon...
1
by: Geoff Jones | last post by:
Hi Is it possible to change the type of data a column holds in DataTable at runtime? For example, suppose that the table column originally holds Strings, can we, at runtime, change it to...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
10
by: Rahul Babbar | last post by:
Hi, I am getting the following error, while executing the simple insert script on a few tables. INSERT INTO <table_name>(<col1>) VALUES (1); DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884,...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.