Skip to Main Content

Oracle Database Discussions

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!

how to use with check contraint with multiple options

900105Nov 14 2011 — edited Nov 14 2011
Hi I like to correct the following codes,,,

I want to insert only 'Male' or 'female' in gender column. If anyone tries to insert otherthan male or female, column shoud not insert on it.

For that the following code is correct or not?


create table gender (gender varchar2(10) check (gender in male,female));


thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2011
Added on Nov 14 2011
5 comments
2,941 views