Hi Khurram,
This script is not tested but I think you will get the logic easily. You can customize and expand more as per your requirements. Once you get the output, you can open in excel sheet or write unix script to do comparison, according to your convenience:
.export....all what you need
........EXPORT REPORT FILE = abc.sql
select case when when tablekind = 't' then 'show table '
when tablekind = 'v' then 'show view '
end || trim(databasename) || '.' || trim(tablename) || ' ;' (title '')
from dbc.tables tbl_view
where tbl_view.tablekind in('t','v')
AND DATABASENAME IN
(
'db1','db2'
)
and trim(tablename) not like all ('al%','et%','lt%','tl%','uv')
and tbl_view.tablename not in
( select trim(childtable) || '_' || trim(indexid)
from dbc.all_ri_children
)
group by 1
order by 1;
.EXPORT RESET
.EXPORT REPORT FILE = abc.txt
.RUN FILE abc.sql
.EXPORT RESET
.LOGOFF
.QUIT
Cheers,
Raja
Hi Khurram,
This script is not tested but I think you will get the logic easily. You can customize and expand more as per your requirements. Once you get the output, you can open in excel sheet or write unix script to do comparison, according to your convenience:
.export....all what you need
........EXPORT REPORT FILE = abc.sql
select case when when tablekind = 't' then 'show table '
when tablekind = 'v' then 'show view '
end || trim(databasename) || '.' || trim(tablename) || ' ;' (title '')
from dbc.tables tbl_view
where tbl_view.tablekind in('t','v')
AND DATABASENAME IN
(
'db1','db2'
)
and trim(tablename) not like all ('al%','et%','lt%','tl%','uv')
and tbl_view.tablename not in
( select trim(childtable) || '_' || trim(indexid)
from dbc.all_ri_children
)
group by 1
order by 1;
.EXPORT RESET
.EXPORT REPORT FILE = abc.txt
.RUN FILE abc.sql
.EXPORT RESET
.LOGOFF
.QUIT
Cheers,
Raja