I want to get the table names where the count (*) is different by num_rows by 20000 rows . Then I can analyze these tables . I have put the logic there , need some help with the code .


declare
a varchar(30),
b num,
c num ,
select table_name from user_tables into a where owner='SYSTEM',
select count(*) from a into b;
select num_rows into c from user_tables where table_name = a;
If b > c + 20000
Then
PRINT ' a'
/