Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Can't Update Value because of constraint :: WEIRD!
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