Avoidance in a multibyte code set
HCL OneDB™ database servers do not allow partial characters to occur. The GLS feature prevents the database server from returning the specified range of bytes literally when this range contains partial characters.
If your database locale supports a multibyte code set and you specify a particular column substring in a query, the database server replaces any truncated multibyte characters with single-byte white space characters.
For example, suppose the multi_col column
contains the string A1A2A3A4B1B2B3B4,
and you execute the following SELECT statement:
SELECT multi_col FROM tablename WHERE multi_col[2,4] = 'A1A2B1B2'
The
query returns no rows because the database server converts the substring multi_col[2,4],
namely the string A2A3A4, to three
single-byte blank spaces (
sss
). The WHERE clause
specifies this search condition: WHERE 'sss' = 'A1A2A3'
Because this condition is never true, the query retrieves no matching rows.
HCL® OneDB database servers replace partial characters in each individual substring operation, even when they are concatenated.
For example, suppose the multi_col column
contains A1A2B1B2C1C2D1D2,
and the WHERE clause contains the following condition:
multi_col[2,4] | multi_col[6,8]
The
query does not return any rows because the result of the concatenation
(A2B1B2C2D1D2)
contains two partial characters, A2 and C2.
The HCL OneDB database
server converts these partial characters to single-byte blank spaces
and creates the following WHERE clause condition:
WHERE 'sB1B2sD1D2' = 'A1A2B1B2'
This condition is also never true, so the query retrieves no matching rows.