--
-- Describe all existing tables and views
--
-- Created:   Jun  2, '03  Stan K
-- Modified:
--
----------------------------------------------------------------------
-- First create desc.sql file to do the job
--
set feedback 0
set pages 0
set termout off
set echo off
--
spool desc.sql
PROMPT PROMPT TABLES:
select 'describe '||table_name||';' from user_tables;
select 'select comments from user_tab_comments where table_name='''||table_name||''';' from user_tables;
column COLUMN_NAME	heading 'COLUMN'	format a14
column COMMENTS		heading 'COMMENT'	format a64
select 'select column_name, comments from user_col_comments where table_name='''||table_name||''';' from user_tables;
PROMPT PROMPT VIEWS:
select 'describe '||view_name||';' from user_views;
spool off
--
set feedback 6
set pages 14
set termout on
----------------------------------------------------------------------
-- Now run desc.sql and log the results and echos of the commands
--
spool desc.log
set heading off
select 'DATE:  ' || to_char(sysdate, 'DD-MON-YY HH24:MI:SS') from dual;
set heading on
show user
set echo on
@desc.sql
set echo off     
spool OFF
--
