Skip to Main Content

Oracle Database Discussions

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!

ORA-01449: column contains NULL values; cannot alter to NOT NULL

KB..Sep 8 2006 — edited May 14 2007
Hi

we have a table as follows

SQL> desc child_disease_intents_tab
Name Null? Type
------------------------------- -------- ----
CLIENT_ID NOT NULL NUMBER(10)
DATE_OF_INTENT DATE
CONSENT_ID NUMBER(2)
INTENT VARCHAR2(1)
REASON_NOT_IMM VARCHAR2(1)
SECTOR VARCHAR2(2)
AUDIT_TIMESTAMP DATE
AUDIT_ID NUMBER
AUDIT_ORIGIN VARCHAR2(30)
RECORD_STATUS CHAR(1)

the client_id is not null field and consent_id has got only 10 distinct numeric values

but when i am creating a PK constrarint i am getting above error

SQL> alter table child_disease_intents_tab add (
constraint child_disease_intents_tab_pk primary key ( client_id, consent_id)
using index tablespace child_indexes
)

ERROR at line 2:
ORA-01449: column contains NULL values; cannot alter to NOT NULL

there are no null values in consent_id

thankx
kedar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2007
Added on Sep 8 2006
14 comments
5,822 views