Get table field:
SELECT *
From User_tab_columns
where table_name= ' user table '
ORDER BY column_name
Get Table Comments:
SELECT *
From User_tab_comments
where table_name= ' user table '
ORDER BY table_name
get field Comments:
SELECT *
From User_col_comments
where table_name= ' user table '
ORDER BY column_name
/* Get table: * *
Select table_name from User_tables; Table for current user
Select table_name from All_tables; Table for all users
Select table_name from Dba_tables; Include system tables
Select table_name from dba_tables where owner= ' Zfxfzb '
/*
User_tables:
Table_name,tablespace_name,last_analyzed, etc.
Dba_tables:
Ower,table_name,tablespace_name,last_analyzed, etc.
All_tables:
Ower,table_name,tablespace_name,last_analyzed, etc.
All_objects:
Ower,object_name,subobject_name,object_id,created,last_ddl_time,timestamp,status, etc.
*/
/* Get table field: */
SELECT * from user_tab_columns where table_name= ' user table ';
SELECT * from all_tab_columns where table_name= ' user table ';
SELECT * from dba_tab_columns where table_name= ' user table ';
/* User_tab_columns:
TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_PRECISION,DATA_SCALE,NULLABLE,COLUMN_ID, etc.
All_tab_columns:
OWER,TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_PRECISION,DATA_SCALE,NULLABLE,COLUMN_ID, etc.
Dba_tab_columns:
OWER,TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_PRECISION,DATA_SCALE,NULLABLE,COLUMN_ID, etc.
*/
/* Get table Comment: */
SELECT * FROM User_tab_comments
/*
User_tab_comments:table_name,table_type,comments
The corresponding also dba_tab_comments,all_tab_comments, these two more than User_tab_comments ower column.
*/
/* Get field Comment: */
SELECT * FROM User_col_comments
/*
User_col_comments:table_name,column_name,comments
The corresponding also dba_col_comments,all_col_comments, these two more than User_col_comments ower column.
*/
Original link: http://www.cnblogs.com/emanlee/archive/2011/12/02/2272629.html