martedì 9 giugno 2009

How to determine if a column has non-numeric values

Imagine you have a table with many records.

How to determine if a column of this table has non-numeric values?

This is a quick method:
select *
from MY_TABLE
where (LENGTH (TRIM (TRANSLATE (MY_FIELD, '0123456789', ' ') ) ) is not null)

Nessun commento:

Posta un commento