On the move:

I'm currently moving the following to their own blogs: Unix, HTML for Blogs, Perl & Java.
The links are on the left side.

Sunday, May 25, 2008

Column Length

A column's length is based on three fields: Data_Precision, Data_Length, and Data_Scale.

Column Data_Len Heading Data|Length Format A6


Select Column_Name,
Data_Type,
Case When (Data_Precision Is Null)
Then To_Char(Data_Length,'9999')
Else ' '||Data_Precision||'.'||Data_Scale
End AS
Data_Len
From User_Tab_Columns
Where Table_Name like 'INC_%';


Column Data Data
Name Type Length
-------------- --------- ------
EMPLOYER_NAME VARCHAR2 20
INCOME NUMBER 7.2
INCOME_DATE DATE 7
SEX CHAR 1
BIRTHDATE DATE 7

No comments:

Post a Comment