Archives of the TeradataForum
Message Posted: Wed, 04 Apr 2007 @ 09:49:35 GMT
| Subj: || || Re: Restricting String column to accept only Lower Case Values |
| From: || || Gaitonde, Amol |
You can create a casespecific column and add a constraint as below.
CREATE TABLE test
( Col1 CHAR (10) CASESPECIFIC
CHECK (col1 NOT LIKE ALL ('%A%','%B%','%C%')))
But I think it's a data cleansing issue and not a good idea to add as a constraint on the table for performance reasons.
In case you want to prevent users from adding incorrect data to the table , you can create a view and grant insert access to the view instead
of the table and create view like below.
REPLACE VIEW test_v AS
WHERE col1 NOT LIKE ALL ('%A%','%B%','%C%')
WITH CHECK OPTION