-
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
Thanx in advance,
Kavita
KN
-
KN
-
Put simply, I dont know what the 22 is all about
BUT
to measure number lengths
i.e 15,2
the 15 is stored in the data_precision column
the 2 is stored in the data_scale column
-
also data_length gives you the character length of
char
nchar
varchar2
nvarchar2
raw
However this is only based on limited knowledge.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|