Can we use any other operator than relational operators for 'CONSTRAINT', because I am having an error

Apr 5 2011 4:04 AM

Can we use logical operators, Conditional operators other than relational operator in query of Constraints?, because I am having an error

Below is the query I tried
Alter table arbab ADD  CONSTRAINT abc CHECK (gender 'Male' or 'female');

I am having below mentioned error:

Error starting at line 1 in command:
Alter table arbab ADD  CONSTRAINT abc CHECK (gender 'Male' or 'female')
Error report:
SQL Error: ORA-00920: invalid relational operator
00920. 00000 -  "invalid relational operator"
*Cause:   
*Action:

This query:

Alter table arbab ADD  CONSTRAINT abc CHECK (gender >10);

Worked fine.


Thanks in advance.


Answers (8)