NLS_LENGTH_SEMANTICS=CHAR does not set the default character length type to char

  • From: Lu Jiang <lu.jiang69@xxxxxxxxx>
  • To: list <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 6 Jun 2013 09:28:59 -0700 (PDT)

Hi all,
 
I just found that set parameter NLS_LENGTH_SEMANTICS=CHAR at instance level 
does not make the default character length type to char when created table with 
 char/varchar column in one of our11g database. Has any one seen this before?
 
The following if what I got from this database:
 
1.
SQL> show parameter length
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
nls_length_semantics string CHAR

2. I created a table as following, but the length semantics does not use the 
default 'char'
SQL> Create table test (Col1 CHAR(20),Col2 VARCHAR2(100));

Table created.

SQL> desc test
Name Null? Type
----------------------------------------- -------- ----------------------------
COL1 CHAR(20 byte)
COL2 VARCHAR2(100 byte)

3. Create a table with the length semantic explicitly specify to char

SQL> Create table test1 (Col1 CHAR(20 char),Col2 VARCHAR2(100 char));

Table created.

SQL> desc test
Name Null? Type
----------------------------------------- -------- ----------------------------
COL1 CHAR(20 CHAR)
COL2 VARCHAR2(100 CHAR)

Although define the the data type explicitly is a good practice, but i don't 
know why set NLS_LENGTH_SEMANTICS parameter is useless.  Could any one shed any 
light on this? 
 
Thanks,
Lu
--
//www.freelists.org/webpage/oracle-l


Other related posts: