I was trying to extract data length for all numeric columns in my database from the user_tab_columns view.
I found a very surprising thing. The data_length we get by desc statement is entirely different from the data_length field in the user_tab_columns. Basically for all numeric fields the data_length is always 22 in the view. What does the data_length field in the user_tab_columns give us??!!!
Eg: Observe the Due_adj_amt field from Desc statement
COLUMN_NAME DATA_TYPE DATA_LENGTH
CURR_CD VARCHAR2 8
DUE_ADJ_AMT NUMBER 17
CATEGORY_DESC VARCHAR2 100
SYSTEM_FIX CHAR 1
SCRUBBED CHAR 1
and the due_adj_amt data_length from the user_tab_columns view:
COLUMN_NAME DATA_LENGTH
DUE_ADJ_AMT 22
Bookmarks