I have to modify my table and I try do it as following:
ALTER TABLE projects
MODIFY (
id_proj NUMBER(4) CONSTRAINT pk_proj PRIMARY KEY,
desc VARCHAR2(40) NOT NULL CONSTRAINT uk_proj UNIQUE,
end_date CONSTRAINT chk_date CHECK(end_date > start_date),
fund CHECK (fund > 0)
);
And when I try execute this query I get an error:
ORA-02438: Column check constraint cannot reference other columns
02438. 00000 - "Column check constraint cannot reference other columns"
*Cause: attempted to define a column check constraint that references another column.
*Action: define it as a table check constraint.
Additionally I want the column to accept values greater than 0 or NULL values.