[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

alter table

Posted on 2012-09-08
4
Medium Priority
?
740 Views
Last Modified: 2012-09-17
Hi,
I have column ID as bigint not null, i want to alter it to bigint null i tried
ALTER TABLE aa alter COLUMN ID set data type BIGINT null ;

its giving me error

Explanation:

The attributes specified in the ALTER COLUMN clause for the column
"<column-name>" of the table "<table-name>" in an ALTER TABLE statement
are not compatible with the attributes of the existing column. The error
was returned for one of the following reasons.
0
Comment
Question by:sam2929
  • 2
4 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 38379428
which version of db2 are you using?
i don't think is supported before version 9
0
 

Author Comment

by:sam2929
ID: 38379446
Database server        = DB2/AIX64 9.5.9
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 38379458
try

ALTER TABLE aa alter COLUMN ID set not null ;
0
 
LVL 26

Accepted Solution

by:
Tomas Helgi Johannsson earned 2000 total points
ID: 38380825
Hi!

Try this
ALTER TABLE aa alter COLUMN ID drop not null;

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.ref.doc%2Fdoc%2Fr0000888.html

After that it is a good practice to do some reorg and runstats.

Regards,
    Tomas Helgi
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question