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 constraint question

check constraint question

From: Dina Newsham <d_newsham_at_hotmail.com>
Date: Wed, 9 May 2001 09:52:14 -0700
Message-ID: <9dbslq$am6$1@usenet.nau.edu>

Hi,

I am still learning so I apologize in advance if this is an easy question. I am trying to put a check constraint on a table, with 2 checks, like so:

alter table actual
add constraint act_oth_tuition check ((acct != '0101') and (dept != 'OTH'));

so that if somebody tries to enter values into the table in dept OTH, acct 0101, they are not allowed. I am getting the following error:

add constraint act_oth_tuition check ((acct != '0101') and (dept != 'OTH'))

                                                                    *
ERROR at line 2:
ORA-02293: cannot validate (DAN5.ACT_OTH_TUITION) - check constraint violated

There is no data in these rows, which the error code refers to (as far as I can tell), and the constraint does not already exist. Can somebody tell me if this type of constraint is allowed... I am running it on 3 tables. One table accepts the constraint and the other 2 give the error.

Thanks
Dina Received on Wed May 09 2001 - 11:52:14 CDT

Original text of this message

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