Posted By

thecrumb on 01/23/08


sql Oracle

Versions (?)

Get Columns and Comments (Oracle)

 / Published in: SQL

Get all my columns and comments.

  1. SELECT col.table_name
  2. ,col.column_name
  3. ,col.data_type
  4. ,col.data_default
  5. ,col.nullable
  6. ,case when col.data_type = 'varchar2' then col.data_length else NULL end AS data_length
  7. ,com.comments
  8. FROM user_col_comments com
  9. JOIN user_tab_cols col
  10. ON com.table_name=col.table_name
  11. AND com.column_name=col.column_name
  12. ORDER BY col.table_name, col.column_id

Report this snippet  

You need to login to post a comment.