varchar2(n BYTE|CHAR) default -> CHAR or BYTE

后端 未结 2 1443
遥遥无期
遥遥无期 2020-12-05 13:19

I am supporting code that has below schema declaration:-

create table sample (
        id number Primary key,
        username varchar2(100),
);
相关标签:
2条回答
  • 2020-12-05 13:53

    The default will be whatever your NLS_LENGTH_SEMANTICS parameter is set to. By default, that is BYTE to be consistent with older versions of Oracle where there was no option to use character length semantics. If you are defining your own schema and you are using a variable width character set (like AL32UTF8), I'd strongly recommend setting NLS_LENGTH_SEMANTICS to CHAR because you almost always intended to specify lengths in characters not in bytes.

    0 讨论(0)
  • 2020-12-05 14:03

    You might check your current value using the following query:

    SELECT
      value
    
    FROM
      NLS_DATABASE_PARAMETERS
    
    WHERE
      parameter='NLS_LENGTH_SEMANTICS';
    
    0 讨论(0)
提交回复
热议问题