I'm trying to add a Default Value Constraint but only if the Constraint doesn't already exist.
CREATE TABLE CUSTOMERS( ID INT NOT NULL, NAME VARCHAR (20) NOT NULL, AGE INT NOT NULL, ADDRESS CHAR (25) , SALARY DECIMAL (18, 2) DEFAULT 5000.00, PRIMARY KEY (ID) );
I am using below statement but i got error. ALTER TABLE XXXtable ADD xxx_name varchar2(50) not null;
error message: ORA-01758: table must be empty to add mandatory (NOT NULL) column