Oracle 查看所有表结构

with temp as
 (select table_name name,
         '表' type,
         comments comments,
         '' tablename,
         0 num,
         '' nullable
    from user_tab_comments
   where table_type = 'TABLE'
  union all
  select '      ' || a.column_name name,
         a.data_type || '(' || a.data_length || ')' type,
         b.comments comments,
         a.table_name tablename,
         column_id num,
         nullable nullable
    from user_tab_columns a, user_col_comments b
   where a.table_name = b.table_name
     and a.column_name = b.column_name)
select name, type, nullable, comments
  from temp t
 start with tablename is null
connect by prior t.name = t.tablename
 order siblings by num;

转载:https://www.cnblogs.com/fighter7/p/12667366.html

原文地址:https://www.cnblogs.com/ZJ199012/p/14867519.html