ORA-01449: column contains NULL values; cannot alter to NOT NULL
KB..Sep 8 2006 — edited May 14 2007Hi
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