google analytics

meta

adsense

Thursday, August 18, 2011

Oracle - Fetching all columns for a given table or finding all table which has a column name



The below query will help you in situations when you want to dynamically fetch the columns for a specific table or when  you simply need the list of all tables which have a column like you are looking for.

SELECT OWNER,
       TABLE_NAME,
       COLUMN_NAME,
       DATA_TYPE,
       DATA_LENGTH,
       DATA_PRECISION,
       NULLABLE,
       LAST_ANALYZED,
       CHAR_USED,
       HISTOGRAM
  FROM all_tab_columns

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...