473,836 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

11 New Member
I am new at DB2 . so please guide

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

CREATE TABLE testschema.play er (
NAME VARCHAR(120) NOT NULL,
country VARCHAR(80) NOT NULL,
club VARCHAR(120) ,
totalgoals SMALLINT not null with DEFAULT 0 ,
goalsinpresents eason SMALLINT not null with DEFAULT 0 ,
posn VARCHAR(8) not null ,
jerseyno SMALLINT ,
valueinmilliond ollars Decimal(5,2)
)
/

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

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

please help
Jun 28 '07 #1
2 1967
r035198x
13,262 MVP
I am new at DB2 . so please guide

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

CREATE TABLE testschema.play er (
NAME VARCHAR(120) NOT NULL,
country VARCHAR(80) NOT NULL,
club VARCHAR(120) ,
totalgoals SMALLINT not null with DEFAULT 0 ,
goalsinpresents eason SMALLINT not null with DEFAULT 0 ,
posn VARCHAR(8) not null ,
jerseyno SMALLINT ,
valueinmilliond ollars Decimal(5,2)
)
/

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

but i am getting the error saying
LTER TABLE "TESTSCHEMA.PLA YER" 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 New Member
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
13464
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 strings) at least 12 digits (characters) long - all positions will be occupied (no leading 0's) - Tables may have upto 1m+ rows
2
2539
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 printf) If the number is small say, 9 then it has to be displayed as 009, 56 -> 056, 897-> 897, 6786 -> xxx
2
32360
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 and it appears the only thing that changes is the length. All the data remains in tact. The table with the column I want to modify is very critical. Is there any chance I would loose data if I change the length to a larger size? I am making a...
13
2924
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 the field type when running a make table query? Thanks, Sven
10
4035
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 inspection and behavior in the gri the data type is string. If I preview the dataset with the GUI in VISSTUDIO it shows my datatype to be dateTime .. If I try to rest the datatype I get this erro Additional information: Cannot change DataType...
1
2241
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 Integers? I'm also interested in changing the date/time that may be held in a column. That is, if the date and time are held in a column of DataTable, how can we change it so it only has the time?
3
3197
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 missing from the code? Thanks - Jon Private Sub MakeParentTable() ' Create a new DataTable. Dim myDataTable As Datatable = New Datatable("ParentTable")
10
2939
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, SQLERRMC: =;FUNCTION Message: No authorized routine named "=" of type "FUNCTION" having compatible arguments was found.
0
4576
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 columns to make a derived column. When I run my code, I get this error: ------------
0
9825
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9671
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10846
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5650
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5828
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4021
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.