How does the below check constraint work?



IBM's flagship relational database management system

How does the below check constraint work?

Postby ctrevino » Thu Jun 30, 2011 10:48 pm

If I have a check constraint on field1 for table 1 that states the below:

(FIELD1 = 'XXX' and FIELD2 in (X1, X2, X3)

There is no check constraint on FIELD2

Does this mean that if I try to enter a value of X1 in FIELD2 without a value of FIELD2 that I will get an error?
Christy T.


Wherever you go, there you are - Buckaroo Banzai
ctrevino
 
Posts: 62
Joined: Tue Feb 23, 2010 1:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: How does the below check constraint work?

Postby ctrevino » Thu Jun 30, 2011 11:10 pm

Oh I know that the first thought is to just test it. The problem is that this check constraint has been removed because it is too big and nothing can be added to it. I am working on a system to replace the edits that the check constraint previously did. :) So, I can't test it really.
Christy T.


Wherever you go, there you are - Buckaroo Banzai
ctrevino
 
Posts: 62
Joined: Tue Feb 23, 2010 1:23 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post