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 -> Re: Can't Update Value because of constraint :: WEIRD!

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

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Thu, 02 Oct 2003 22:35:35 +0200
Message-ID: <mv2pnvkllijs5c9vh39goh7lsc15bfrh8e@4ax.com>


On Thu, 02 Oct 2003 02:25:24 -0600, Lee <now_at_yjo.se> wrote:

>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...

Compare 'Status' to 'plate_status'

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Oct 02 2003 - 15:35:35 CDT

Original text of this message

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