Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it possible to remove the NOT NULL constraint from a non key column?

dariyooshDec 3 2010 — edited Dec 3 2010
Oracle version: Enterprise Edition 11g - 11.2.0.1.0
OS: Redhat Linux Enterprise Edition 5.0



Dear all,


I have a question about NOT NULL columns in oracle tables and I would appreciate if you could kindly help me with this problem.

I have the following table
CREATE TABLE ARTICLES
(
    artid                VARCHAR2(20),
    lbl                  VARCHAR2(100)        NOT NULL,
    cmporder             VARCHAR2(30)         NOT NULL      
)

ALTER TABLE ARTICLES ADD CONSTRAINT PK_ARTICLES PRIMARY KEY(artid);
It's about a year that I have this table but recently the data model has changed and the third column in the table is no more mandatory, therefore NULL values for the third column cmporder are allowed. What I would like to know is that whether it is possible to change the table definition (for example by using some ALTER statement) in order to remove the "NOT NULL" constraint from the third column? In this way I can conserve the 2 million lines which are already in the table and avoiding to do a bakup before dropping and recreating the table.


Thanks in advance,

Kind Regards,
Dariyoosh
This post has been answered by 784735 on Dec 3 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2010
Added on Dec 3 2010
2 comments
2,774 views