Finding Columns with Null Values ​​in Teradata

advertisements

I would like to find the columns in a table that has a null value in it. Is there a system table that have that information?


To find columns where "null" values are allowed try...

select *
from dbc.columns
where databasename = 'your_db_name'
and tablename = 'your_table_name'
and Nullable = 'Y'

then to identify the specific rows w/ null values, take the "ColumnName" from the previous result set and run queries to identify results... perhaps throw them in a volatile table if you want to take further action on them (update,delete).

-- for example you found out that column "foo" is nullable...
create volatile table isnull_foo_col
as
(
  sel *
  from your_table_name
  where foo is null
) with data
on commit preserve rows;