Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

regarding check constraint

KarteekJul 5 2012 — edited Jul 6 2012
Hi everyone,

i have a table for example :

CREATE TABLE RMD_2
(
"RMD_ID" NUMBER(10,0) NOT NULL ENABLE,
"ABB" VARCHAR2(16 BYTE),
"ACT_IND" VARCHAR2(1 BYTE) NOT NULL DISABLE,
CONSTRAINT "RMD_2_C1" CHECK (act_ind IN ('Y', 'N')) ENABLE
)

for column ACT_IND their is a check constraint RMD_2_C1
it should only accept either Y or N.

but, when ever i am inserting other values other than Y or N it is accepting

it should not accept and it should have to give error message ORA-02293- : check constraint violated.


but it is not happening,it is accepting all other values even NULL value also.
my requirement is this column should only accept either Y or N and it should not accept other values.



please needhelpful.

Edited by: karteek on Jul 5, 2012 7:00 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2012
Added on Jul 5 2012
4 comments
938 views