Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Wed, 04 Apr 2007 @ 09:49:35 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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
     SELECT *
     FROM test
     WHERE col1 NOT LIKE ALL ('%A%','%B%','%C%')
     WITH CHECK OPTION


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020