2.2.42 Operands related to character encoding

234) pd_substr_length = 3 | 4 | 5 | 6
Specifies the maximum number of bytes to be used to represent a single character. This operand is applicable when Unicode (UTF-8) is specified as the character encoding and affects the length of the results of the SUBSTR scalar function.
For details about the SUBSTR scalar function, see the manual HiRDB Version 9 SQL Reference.
Specification guidelines
If you use only characters in the UCS-2 range (1 to 3 bytes), you can omit this operand. To use characters in the UCS-4 range (1 to 6 bytes), you must specify in this operand the maximum number of bytes to be used to represent a single character.
If the specified value is greater than the actual number of bytes used to represent a character, the result of the SUBSTR scalar function might become too long. For this reason, evaluate the value to be specified in this operand on the basis of the character encoding actually used.
Notes
  • According to ISO/IEC Standard 10646, a range of one to four bytes is assigned per character and bytes 5 and 6 are reserved for future standards. Although HiRDB supports a range of one to six bytes per character, problems might arise in the future if you use a range of 5 or 6 bytes but no characters have been assigned using that number of bytes.
  • In Unicode (UTF-8) supported by version 06-02, you can use a maximum of three bytes per character. Version 08-00 supports a maximum of six bytes. Therefore, with some data, the number of bytes representing a single character might increase.
  • If all the following conditions are satisfied, you must re-create SQL objects in routines and re-define view tables:
    [Figure]Unicode (UTF-8) is specified as the character encoding.
    [Figure]A value other than 3 is to be specified in the new pd_substr_length operand; or, in an environment where the pd_substr_length operand has already been specified, routines and view tables are to be defined and the pd_substr_length operand value is to be changed.
    [Figure]A SUBSTR scalar function with a mixed character string type (MCHAR or MVARCHAR) specified as its argument is to be specified in routines and view definitions.
    You can specify the PDSUBSTRLEN operand in the client environment definition to control the connection, or you can specify the SUBSTR LENGTH SQL compile option to control a routine.
  • The tables below show the priority among the pd_substr_length operand and other operands when Unicode (UTF-8) is specified as the character encoding.
    When control is performed by routine
    Control timingpd_substr_length operandClient environment definition
    PDSUBSTRLEN
    SQL compile option
    SUBSTR LENGTH
    Remarks
    During definitionValid (2)InvalidValid (1)Default value
    pd_substr_length
    During call or function callInvalid
    (depends on the specification made during definition)
    Invalid
    (depends on the specification made during definition)
    --None
    Legend:
    ( ): Priority level is indicated within the parentheses
    --: Cannot be specified
    When control is performed by view table
    Control timingpd_substr_length operandClient environment definition
    PDSUBSTRLEN
    SQL compile option
    SUBSTR LENGTH
    Remarks
    During definitionValid (2)Valid (1)--Default value
    pd_substr_length
    During operationInvalid
    (depends on the specification made during definition)
    Invalid
    (depends on the specification made during definition)
    --None
    Legend:
    ( ): Priority level is indicated within the parentheses
    --: Cannot be specified