Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Check Constraints

Check Constraints

From: Paweł <pmg3REMOVETHIS_at_op.pl>
Date: Fri, 21 Jan 2005 15:19:39 +0100
Message-ID: <1h74rud5vbmog.dlg@www.pmg3.pl>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US