Is there any way in LO Base to set a constraint of the form "This field is not required, but if given must be ‘X’ "?
I have a one-character text field and have tried all sorts of ways to do it.
- If I SET NULL and then ADD CONSTRAINT … CHECK (“field-name” = ‘X’) I get “Check constraint violation”;
- If I ADD CONSTRAINT … CHECK (“field-name” IN (‘X’, ‘’)) [two consecutive single quotes] I get “Unexpected token ;, requires )”;
- If I ADD CONSTRAINT … CHECK (“field-name” IN (‘X’, ’ ')) [space between the last two single quotes] I get the same thing;
- If I ADD CONSTRAINT … CHECK (“field-name” IN (‘X’, NULL)) I get “NULL in value list statement …”;