-- #############################################################################################
--
-- %Purpose: Show Table and Column Comments
--
-- Use:      Needs Oracle DBA Access
--
-- #############################################################################################
--
set feed off;
set pagesize 10000;
set wrap off;
set linesize 200;
set heading on;
set tab on;
set scan on;
set verify off;

ttitle off;
column owner format a5 heading 'Table|Owner'
column t1 format a20 heading 'Table|Name'
column comments format A100 heading 'Comments'
ttitle left 'Table Comments' skip 2

ACCEPT user_namen CHAR PROMPT 'Enter Schema Owner: '

break on owner
spool show_tab_col_comments.lst

SELECT owner,table_name t1,comments
  FROM dba_tab_comments
 WHERE owner LIKE UPPER('&user_namen');

column t2 noprint new_value tab
column column_name format a20 heading 'Column|Name'
ttitle off;
clear break;

ttitle left 'Column Comments on Tabelle: 'tab skip 2

break on t2 skip page -
on owner skip 2 -

SELECT owner,table_name t2,column_name,comments
  FROM dba_col_comments
 WHERE owner LIKE UPPER('&user_namen');

spool off;
set feed on echo off termout on pages 24 verify on;
ttitle off;
