LOWER(:string) = UPPER(:string)
Of course, you will not be able to put this into a CHECK constraint because of restrictions on their content (for example, you cannot use function in a CHECK constraint). But you could use this in SQL statements and as a check in your programs before allowing data to be inserted or modified in your CHAR(10) column.
Anyone else have any other ideas?
Of course, you will not be able to put this into a CHECK constraint because of restrictions on their content (for example, you cannot use function in a CHECK constraint). But you could use this in SQL statements and as a check in your programs before allowing data to be inserted or modified in your CHAR(10) column.
Anyone else have any other ideas?
Hi Craig,
ReplyDeletewhat about a trigger like
CREATE TRIGGER ... NO CASCADE
BEFORE INSERT ON ...
REFERENCING NEW AS N
FOR EACH ROW MODE DB2 SQL
WHEN (UPPER(N.string <>
LOWER(N.string))
SIGNAL SQLSTATE
'75001' ('invalid string')
A trigger like that should work nicely.
ReplyDelete