View all tables and fields in Oracle
Get table fields:
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 the table: * /
Select table_name from user_tables; / / current user's table
Select table_name from all_tables; / / tables for all users
Select table_name from dba_tables; / / including system tables
Select table_name from dba_tables where owner='zfxfzb'
/ *
User_tables:
Table_name,tablespace_name,last_analyzed et al.
Dba_tables:
Ower,table_name,tablespace_name,last_analyzed et al.
All_tables:
Ower,table_name,tablespace_name,last_analyzed et al.
All_objects:
Ower,object_name,subobject_name,object_id,created,last_ddl_time,timestamp,status et al.
, /
/ * get the 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 et al.
All_tab_columns:
Ower,table_name,column_name,data_type,data_length,data_precision,data_scale,nullable,column_id et al.
Dba_tab_columns:
Ower,table_name,column_name,data_type,data_length,data_precision,data_scale,nullable,column_id et al.
, /
/ * get table comments: * /
Select * from user_tab_comments
/ *
User_tab_comments:table_name,table_type,comments
There is also dba_tab_comments,all_tab_comments, which has more ower columns than user_tab_comments.
, /
/ * get field notes: * /
Select * from user_col_comments
/ *
User_col_comments:table_name,column_name,comments
There is also dba_col_comments,all_col_comments, which has more ower columns than user_col_comments.
, /