 |
 |
Archives of the TeradataForum
Message Posted: Fri, 15 Dec 2006 @ 18:00:27 GMT
Subj: | | Re: Looking for bad data |
|
From: | | Vande berg, Blaine |
There isn't a function but the SQL is pretty simple
/* DDL for test table */
CREATE SET TABLE dbname.test ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
col1 char(5) not null)
UNIQUE PRIMARY INDEX ( col1);
/* insert some bad values and a good one */
insert dbname.test
('0123A')
/* test for noncomformant data */
select * from dbname.test
where substring(col1 from 1 for 1) not between '0' and '9'
or substring(col1 from 2 for 1) not between '0' and '9'
or substring(col1 from 3 for 1) not between '0' and '9'
or substring(col1 from 4 for 1) not between '0' and '9'
or substring(col1 from 5 for 1) <> 'M'
| |