Oracle query table and column information ____oracle

Source: Internet
Author: User


1, query all tables and table comments:


Sql> Select T.table_name, t.last_analyzed,s.comments from User_all_tables T, user_tab_comments s where T.TABLE_NAME = S.table_name;


TABLE_NAME last_analyzed COMMENTS
------------------------------ ------------- -------------------------------------------------------------------- ------------
City 2015/2/11 22: Urban Information table
College_news 2015/2/11 22: College Press


2, query a table for all columns and other information:
Select
T.column_name,t.data_length,c.comments, T.data_type,t.data_precision,t.data_scale,t.data_default,t.nullable,t. Last_analyzed
From
User_tab_columns t,user_col_comments c where t.table_name = C.table_name
and t.column_name = c.column_name and t.table_name = ' City ';

column_name Data_length COMMENTS                                                                     Data_type data_precision Data_scale Data_default NULLABLE last_analyzed
------------------------------ ----------- ---------------------------------------------------------------------- ---------- -------------------------------------------------------------------------------- -------------- ------- --- -------------------------------------------------------------------------------- -------- -------------
ID                                      22 primary Key ID                             &N Bsp                                   &NB Sp          number                       &NBS P                                   &NB Sp                                    0                                 &N Bsp                                   &NB Sp            n        2015/2/11 22:
parent_id                               22 parent Node ID                                                                     &NB Sp    number                             &NBS P                                   &NB Sp                              0                                       &N Bsp                                   &NB Sp &nbsP    y        2015/2/11 22:
NAME                                 &NBS P  80 name                               &NBSP ;                                   &NB Sp          VARCHAR2                       &N Bsp                                   &NB Sp                                   &NB Sp                                   &NB Sp                                   &nbsp            y        2015/2/11 22:
Create_by                               22 founder                                   &N Bsp                                   &NB Sp    number                             &NBS P                                   &NB Sp                              0                                       &N Bsp                                   &NB Sp      y        2015/2/11 22:
Create_time                              7 when created Between                                   & nbsp                                   &NB Sp  date                                                                   &N Bsp                                   &NB Sp                                   &NB Sp                                   &NB SP        y        2015/2/11 22:
Last_update_by                          22 last modified person                                     &NB Sp                                  NUMB ER                                                                     &NB Sp                          0                                           &N Bsp                                   &NB Sp  y        2015/2/11 22:
Last_update_time                         7 Last modified time   &NBS P                                   &NB Sp                              date                                       &N Bsp                                   &NB Sp                                   &NB Sp                                   &NB Sp                                   &NBSp Y        2015/2/11 22:
Enable_flag                             22 identifier &nbs P                                   &NB Sp                                   &NB Sp  number                               &NBS P                                   &NB Sp                    1          0     & nbsp                                   &NB Sp                                        y        2015/2/11 22:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.