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

Home -> Community -> Usenet -> c.d.o.misc -> Can't Update Value because of constraint :: WEIRD!

Can't Update Value because of constraint :: WEIRD!

From: Lee <now_at_yjo.se>
Date: Thu, 02 Oct 2003 02:25:24 -0600
Message-ID: <3f7c89c2$1_3@news3.es.net>


Hi!

I'm no stranger to SQL, but I am to Oracle. I'm having a little problem trying to update a field that has a constraint on it. My table is similar to this below:

create table myTable
(

   id NUMBER(38) CONSTRAINT myFK REFERENCES anotherTable    status VARCHAR2(10) default 'good',
   CONSTRAINT myPK PRIMARY KEY (plate_id),    CONSTRAINT statuschk CHECK (plate_status in ('good', 'bad', 'ugly',)) );

When I try and execure the following:
update myTable set status = 'bad' where id = 96

I get:
ERROR at line 1:
ORA-02290: check constraint (blag.STATUSCHK) violated

What mistake am I making? 'bad' is allowed, but it's breaking the constraint... Received on Thu Oct 02 2003 - 03:25:24 CDT

Original text of this message

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