Home » SQL & PL/SQL » SQL & PL/SQL » list of columns of a table
list of columns of a table [message #627236] Mon, 10 November 2014 00:08 Go to next message
hahaie
Messages: 194
Registered: May 2014
Senior Member
hi all,
who can with select statment show list of columns(fields)a table?
Re: list of columns of a table [message #627237 is a reply to message #627236] Mon, 10 November 2014 00:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Query USER_TAB_COLUMNS.

Re: list of columns of a table [message #627240 is a reply to message #627236] Mon, 10 November 2014 00:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Generally speaking when you want something from Oracle dictionary you can query DICT view:
SQL> select table_name, comments from dict 
  2  where lower(comments) like '%table%column%'
  3     or lower(comments) like '%column%table%'
  4  order by 1;
TABLE_NAME                     COMMENTS
------------------------------ --------------------------------------------------------------------------------
ALL_APPLY_KEY_COLUMNS          Alternative key columns for a STREAMS table visible to the current user
ALL_APPLY_TABLE_COLUMNS        Details about the columns of destination table object visible to the user
ALL_COL_COMMENTS               Comments on columns of accessible tables and views
ALL_CONS_OBJ_COLUMNS           List of types an object column or attribute is constrained to in the tables acce
                               ssible to the user
ALL_IND_COLUMNS                COLUMNs comprising INDEXes on accessible TABLES
ALL_NESTED_TABLE_COLS          Columns of nested tables
ALL_OBJ_COLATTRS               Description of object columns and attributes contained in the tables accessible
                               to the user
ALL_PARTIAL_DROP_TABS          All tables with patially dropped columns accessible to the user
ALL_REFS                       Description of REF columns contained in tables accessible to the user
ALL_REPAUDIT_COLUMN            Information about columns in all shadow tables for replicated tables which are a
                               ccessible to the user
ALL_REPCOLUMN                  Replicated top-level columns (table) sorted alphabetically in ascending order
ALL_REPCOLUMN_GROUP            All column groups of replicated tables which are accessible to the user
ALL_REPGROUPED_COLUMN          Columns in the all column groups of replicated tables which are accessible to th
                               e user
ALL_REPKEY_COLUMNS             Primary columns for a table using column-level replication
ALL_REPPARAMETER_COLUMN        All columns used for resolving conflicts in replicated tables which are accessib
                               le to the user
ALL_SEC_RELEVANT_COLS          Security Relevant columns of all VPD policies for tables or views which the user
                                has access
ALL_TAB_COLS                   Columns of user's tables, views and clusters
ALL_TAB_COLUMNS                Columns of user's tables, views and clusters
ALL_TAB_COL_STATISTICS         Columns of user's tables, views and clusters
ALL_TAB_HISTOGRAMS             Histograms on columns of all tables visible to user
ALL_TRIGGER_COLS               Column usage in user's triggers or in triggers on user's tables
ALL_UNUSED_COL_TABS            All tables with unused columns accessible to the user
ALL_UPDATABLE_COLUMNS          Description of all updatable columns
DBA_APPLY_KEY_COLUMNS          alternative key columns for a table for STREAMS
DBA_APPLY_TABLE_COLUMNS        Details about the destination table columns
DBA_CLU_COLUMNS                Mapping of table columns to cluster columns
DBA_COL_COMMENTS               Comments on columns of all tables and views
DBA_CONS_OBJ_COLUMNS           List of types an object column or attribute is constrained to in all tables in t
                               he database
DBA_IND_COLUMNS                COLUMNs comprising INDEXes on all TABLEs and CLUSTERs
DBA_NESTED_TABLE_COLS          Columns of nested tables
DBA_OBJ_COLATTRS               Description of object columns and attributes contained in all tables in the data
                               base
DBA_OLDIMAGE_COLUMNS           Gives all object tables and columns in old (8.0) image format
DBA_PARTIAL_DROP_TABS          All tables with partially dropped columns in the database
DBA_REFS                       Description of REF columns contained in all tables
DBA_REPAUDIT_COLUMN            Information about columns in all shadow tables for all replicated tables in the
                               database
DBA_REPCOLUMN                  Replicated top-level columns (table) sorted alphabetically in ascending order
DBA_REPCOLUMN_GROUP            All column groups of replicated tables in the database
DBA_REPGROUPED_COLUMN          Columns in the all column groups of replicated tables in the database
DBA_REPKEY_COLUMNS             Primary columns for a table using column-level replication
DBA_TAB_COLS                   Columns of user's tables, views and clusters
DBA_TAB_COLUMNS                Columns of user's tables, views and clusters
DBA_TAB_COL_STATISTICS         Columns of user's tables, views and clusters
DBA_TAB_HISTOGRAMS             Histograms on columns of all tables
DBA_UNUSED_COL_TABS            All tables with unused columns in the database
DBA_UPDATABLE_COLUMNS          Description of dba updatable columns
DICT_COLUMNS                   Description of columns in data dictionary tables and views
USER_CLU_COLUMNS               Mapping of table columns to cluster columns
USER_COL_COMMENTS              Comments on columns of user's tables and views
USER_CONS_OBJ_COLUMNS          List of types an object column or attribute is constrained to in the tables owne
                               d by the user
USER_ENCRYPTED_COLUMNS         Encryption information on columns of tables owned by the user
USER_IND_COLUMNS               COLUMNs comprising user's INDEXes and INDEXes on user's TABLES
USER_NESTED_TABLE_COLS         Columns of nested tables
USER_OBJ_COLATTRS              Description of object columns and attributes contained in tables owned by the us
                               er
USER_OLDIMAGE_COLUMNS          Gives all object tables and columns in old (8.0) image format
USER_PARTIAL_DROP_TABS         User tables with unused columns
USER_REFS                      Description of the user's own REF columns contained in the user's own tables
USER_REPAUDIT_COLUMN           Information about columns in all shadow tables for user's replicated tables
USER_REPCOLUMN                 Replicated columns for the current user's table in ascending order
USER_REPCOLUMN_GROUP           All column groups of user's replicated tables
USER_REPFLAVOR_COLUMNS         Replicated columns from current user's tables in flavors
USER_REPGROUPED_COLUMN         Columns in the all column groups of user's replicated tables
USER_REPKEY_COLUMNS            Primary columns for a table using column-level replication
USER_REPPARAMETER_COLUMN       All columns used for resolving conflicts in user's replicated tables
USER_SEC_RELEVANT_COLS         Security Relevant columns of VPD policies for tables or views owned by the user
USER_TAB_COLS                  Columns of user's tables, views and clusters
USER_TAB_COLUMNS               Columns of user's tables, views and clusters
USER_TAB_COL_STATISTICS        Columns of user's tables, views and clusters
USER_TAB_HISTOGRAMS            Histograms on columns of user's tables
USER_UNUSED_COL_TABS           User tables with unused columns
USER_UPDATABLE_COLUMNS         Description of updatable columns

Re: list of columns of a table [message #627241 is a reply to message #627237] Mon, 10 November 2014 00:28 Go to previous messageGo to next message
hahaie
Messages: 194
Registered: May 2014
Senior Member
thanks
Re: list of columns of a table [message #636895 is a reply to message #627241] Tue, 05 May 2015 04:03 Go to previous messageGo to next message
browncat
Messages: 9
Registered: May 2015
Junior Member
The query is...

DESC <table-name>;
Re: list of columns of a table [message #636900 is a reply to message #636895] Tue, 05 May 2015 04:43 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
browncat wrote on Tue, 05 May 2015 14:33
The query is...

DESC <table-name>;


It won't show you the comments. And by the way, OP was asking for a SELECT statement.

[Updated on: Tue, 05 May 2015 04:48]

Report message to a moderator

Previous Topic: Update record based on previous record
Next Topic: alignment of output in the dbms_output file
Goto Forum:
  


Current Time: Wed Apr 24 19:52:22 CDT 2024