alter table

Posted on 2012-09-08
Last Modified: 2012-09-17
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


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.
Question by:sam2929
    LVL 37

    Expert Comment

    which version of db2 are you using?
    i don't think is supported before version 9

    Author Comment

    Database server        = DB2/AIX64 9.5.9
    LVL 37

    Expert Comment


    ALTER TABLE aa alter COLUMN ID set not null ;
    LVL 24

    Accepted Solution


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

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

        Tomas Helgi

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
    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…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now