Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Check Constraints
I have a table describing employees.
I want to make sure that those employees who earn commission
(commission is not null) earn more than 0%
I issued following command:
ALTER TABLE EMP
ADD CONSTRAINT
check (COMMISSION > 0)
Oracle returned an error:
ORA-02438 Column check constraint cannot reference other columns
I decided to name this CONSTRAINT
ALTER TABLE EMP
ADD CONSTRAINT check_comm
CHECK (COMMISSION > 0)
And everything went alright.
What's the explanation for the strange error?
Received on Fri Jan 21 2005 - 08:19:39 CST
![]() |
![]() |