Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Determining char/varchar2 column length
> SQL> select column_name, data_length, char_length, char_col_decl_length
> from all_tab_columns where table_name = 'FOO';
>
> COLUMN_NAME DATA_LENGTH CHAR_LENGTH
CHAR_COL_DECL_LENGTH
> ------------------------------ ----------- ----------- -------------------
-
> A 50 50
50
> B 150 50
150
>
> I would have expected char_col_decl_length to be the same for both
columns.
So you want to see how many *characters* a column was defined to hold, despite the details how many bytes a char takes in it's charset?
What about:
select column_name,
nls_charset_decl_len(data_length, nls_charset_id(character_set_name))
decl_char_len
from dba_tab_columns where table_name = 'T123';
Tanel.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed Jul 14 2004 - 16:41:40 CDT
![]() |
![]() |