Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Check Constraint Question
Maybe a silly question, but why not define a DEFAULT value of 'AB' on the
column? (since a null indicates 'AB'). This way the developers don't have
to do nvl() calls or any extra checking.
Just a thought,
Diana
-----Original Message-----
From: Tamara Swilley [mailto:tswilley_at_agency.com]
Sent: Tuesday, September 26, 2000 8:21 PM
To: Multiple recipients of list ORACLE-L
Subject: Check Constraint Question
Hi Experts!
Can a check constraint include a null value? I have a requirement to add a check constraint to a column with a two-digit "type". The column can be null, but if it has a value is has to be one of the specified values.
For example, the requirements state values can be "AB, BC, CD, DE, with a null indicating type AB". All the examples of check constraints I've seen don't show a null value allowed. Would I say something like ... values in ('AB','BC','CD','DE',NULL)... or is this even possible? If it IS possible, how would the syntax look?
Thanks in advance,
Tamara Swilley
AGENCY.COM-Avon
tswilley_at_agency.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Tamara Swilley
INET: tswilley_at_agency.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Sep 27 2000 - 15:34:20 CDT
![]() |
![]() |