Reputation: 23352
I am trying to add following constraint to my DB2 table but it gives error.
ALTER TABLE Table_name ADD CONSTRAINT VALID_BINDING
CHECK((LOWER(REQ_BINDING) IN ('http-post','http-redirect'))
AND ((LOWER(RESP_BINDING) IN ('http-post','http-redirect')));
Is this a valid query. Can I use AND operator in it?
Upvotes: 0
Views: 178
Reputation: 23183
Isn't it about parentheses?
ALTER TABLE Table_name ADD CONSTRAINT VALID_BINDING
CHECK(
LOWER(REQ_BINDING) IN ('http-post','http-redirect') AND
LOWER(RESP_BINDING) IN ('http-post','http-redirect')
);
Upvotes: 1