Views Sys.user_tab_cols and Sys.user_tab_columns all save the current user's tables, views, and
The column information in the clusters. By retrieving these two tables, you can easily get to the structure of the table.
The main column properties are:
table_name
Table, view, or clusters name
column_name
Column Name
Data_type
Data type
Data_type_mod
Datatype modifier of the column
Data_type_owner
Owner of the datatype of the column
Data_length
Length
Data_precision
Precision
Data_scale
Number of digits after the decimal point
NULLABLE
Whether to allow empty
column_id
Column ID
Default_length
Default value length
Data_default
Default value
Char_length
The maximum number of columns, represented by a string
The difference is that User_tab_cols is a few more columns than User_tab_columns:
Hidden_column VARCHAR2 (3)
Virtual_column VARCHAR2 (3)
SEGMENT_COLUMN_ID number
internal_column_id not NULL number
Qualified_col_name VARCHAR2 (4000)
And there are more hidden fields stored in the content. These hidden fields are automatically added by Oracle and set
Both Hidden_column and Virtual_column are yes.
Look at Oracle's script to discover that the view User_tab_columns is created from the view User_tab_cols:
Create or replace view Sys.user_tab_columns as
Select table_name, COLUMN_NAME, Data_type, Data_type_mod, Data_type_owner,
Data_length, Data_precision, Data_scale, NULLABLE, column_id,
Default_length, Data_default, num_distinct, Low_value, High_value,
DENSITY, Num_nulls, Num_buckets, last_analyzed, Sample_size,
Character_set_name, Char_col_decl_length,
Global_stats, User_stats, Avg_col_len, Char_length, char_used,
V80_fmt_image, data_upgraded
From User_tab_cols
where hidden_column = ' NO '
Use User_tab_columns as much as possible to avoid acquiring hidden fields that Oracle adds to itself.
Oracle system views User_tab_cols and User_tab_columns