Previous Topic

Book Contents

Book Index

Next Topic

New Database - Options

Column lengths specification in brackets (such as 'nvarchar(254)) can mean either the number of available bytes or characters, depending on the database settings. When Valuemation installation scripts are run, their interpretation is also subject to this byte/character distinction. With single-byte character sets this has no consequences. With Unicode, where one character may take up to 4 bytes, the number of actually available characters may be considerably smaller.

From this perspective there are two options for the creation of a new database:

  • Keep the default database length semantics 'NLS_LENGTH_SEMANTICS=BYTE', with the above described consequences.

    With this setting, lengths without unit are interpreted as the number of bytes. For example, VARCHAR2(10) is interpreted as VARCHAR2(10 BYTE).

    This is the standard way of creating a new Valuemation database.

  • Change database length semantics to 'NLS_LENGTH_SEMANTICS=CHAR' to change the length interpretation.

    With this setting, lengths without unit are interpreted as the number of characters. For example, VARCHAR2(10) is interpreted as VARCHAR2(10 CHAR). This means that:

    • With a single-byte characterset, it results in the same number of bytes
    • With Unicode, more bytes are reserved, depending on the encoding. For example: With UTF-8, one character uses 1 to 4 Bytes so VARCHAR2(10) can take up to 40 bytes.

    Note that the length semantics setting influences only creation of new database columns, the previously created ones remain intact.

See Also

Databases With Database Level Support

Migration - Number of Characters