Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: column length for LPAD
hi Thomas,
Yup, you answered actually my question.
I was looking already at USER_TAB_COLS and the column DATA_LENGTH and I
wrote a simple func to retrieve data from this view.
I'm little bit relunctant to access this DD view and was hoping there
would a expression similar like '%TYPE' available for the length of a
column (like %LENGTH or so).
But I think it's the only way to get this information with a SELECT on this view.
Thanks for your help.
Regards
Fred
"Thomas Gruber" <grubsi_at_chello.at> wrote in news:1105026804.698121.227980 @f14g2000cwb.googlegroups.com:
> Hi,
>
> I donīt think I completely understand your question. Anyway I hope I
> can help you.
>
> To determine the column length you can select it from the table
> USER_TAB_COLUMNS or ALL_TAB_COLUMNS.
> To determine the best column of USER_TAB_COLUMNS to get the length for
> your variable just make a "DESC <table name>" ;-)
>
> There are some options available to determine the length of a column:
> DATA_LENGTH:
> Length of the column in bytes
> DATA_PRECISION:
> Length: decimal digits (NUMBER) or binary digits (FLOAT)
> DATA_SCALE:
> Digits to right of decimal point in a number
> DEFAULT_LENGTH:
> Length of default value for the column
> AVG_COL_LEN:
> The average length of the column in bytes
> CHAR_LENGTH:
> The maximum length of the column in characters
> CHAR_USED:
> C is maximum length given in characters, B if in bytes
> Hope this is what you wanted to know.
> Thomas
>
>
Received on Thu Jan 06 2005 - 20:26:44 CST
![]() |
![]() |