Neoview Character Sets Administrator's Guide (R2.4, R2.5)
In Neoview Release 2.4, one underscore always matches one character, regardless of the byte
length of the character. When matching a single multibyte character in the database, specify one
underscore in the LIKE pattern.
In Neoview Release 2.3, the query in the following example requires you to put two underscores
in the LIKE pattern on a Neoview platform with the SJIS configuration, and three underscores
in the LIKE pattern on a system with the Unicode configuration. Otherwise, Neoview SQL does
not return the row, as this example shows:
>>select * from (values(_ISO88591' ')) as t(c1)
+> where c1 like _ISO88591' _ %';
C1
--------------------------------------------------
--- 0 row(s) selected.
>>select * from (values(_ISO88591' ')) as t(c1)
+>where c1 like _ISO88591' __ %';
C1
--------------------------------------------------
--- 1 row(s) selected.
In double-byte SJIS characters, the second byte might be 0x5C (\) or 0x5F (_). The underscore is
one of the wild-card characters in SQL, and the backslash character is used as an escape character
in ODBC. In Neoview Release 2.3, if a LIKE pattern includes a double-byte SJIS character that
uses 0x5C or 0x5F as the second byte, the SELECT statement might return the wrong results
because Neoview SQL interprets the second byte as an escape sequence or a wild-card character,
as this example shows:
>>insert into t1 values(x'41 42 43 83 5C 84 5C 31 32 33');
--- 1 row(s) inserted.
>>select * from t1;
C1
--------------------
ABC 123
--- 1 row(s) selected.
>>-- The next query should not return 'ABC 123' because
>>-- it does not match '% %' (x'25 83 5F 84 5F 25')
>>select * from t1 where c1 like x'25 83 5F 84 5F 25';
C1
--------------------
ABC 123
--- 1 row(s) selected.
>>-- The next query should return 'ABC 123' because
>>-- it matches '% %'
32 Using SQL Language Elements to Define and Manage Database Encoding