Hi All,
I'm used below sql script for audit purpose to check the number of records are loaded into Not Null fields of each table..I used the all_tab_columns table because it has all tables columns details in a database and i considered nullable=n for not null columns.Ideally columns defined as not null should not accepts null value but just for audit purpose i have to save the report.when i try the below script it is giving wrong result but still it is giving count as no of columns count .Any one can guide me on this.
SELECT TABLE_NAME,COUNT(*) FROM
(
select table_name,COLUMN_NAME from all_tab_columns
where owner='SH' and nullable='N'--- and table_name='PROMOTIONS'
)
GROUP BY TABLE_NAME