Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DATA_LENGTH in all_tab_columns in BYTE/CHAR???

XenofonOct 21 2010 — edited Oct 21 2010
Hi

in the Oracle 11gR2 or 10gR2 documentation you find the following description of ALL_TAB_COLUMNS.DATA_LENGTH.
DATA_LENGTH 	NUMBER 	NOT NULL 	Length of the column (*in bytes*)
But what about VARCHAR2 fields which have been created with
NLS_LENGTH_SEMANTICS='CHAR'
My observation is, that in 10g ALL_TAB_COLUMNS.DATA_LENGTH shows the length in what ever mode, you have created the table. So, if I have created a VARCHAR2 field as VARCHAR2(4 CHAR), then ALL_TAB_COLUMNS.DATA_LENGTH will show 4. In 11g however the field shows really the length in bytes. So I observed data_length=16 for a field which had been defined as VARCHAR2(4 CHAR) on a 11gR2 database with NLS_CHARACTERSET= "AL32UTF8".

Is there any contrary observation or experience?
This post has been answered by Dom Brooks on Oct 21 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2010
Added on Oct 21 2010
4 comments
3,442 views