Neoview Character Sets Administrator's Guide (R2.4, R2.5)
>>select * from t1 where c1 like x'25 84 5C 25' escape '\';
--- 0 row(s) selected.
In Neoview Release 2.4, character strings are compared at the character level, not the byte level.
Therefore, the second byte of a double-byte SJIS character in a LIKE pattern is treated as part of
the SJIS character and not as an escape sequence or a wild-card character, as this example shows:
>>select * from t1 where c1 like x'25 83 5F 84 5F 25';
--- 0 row(s) selected.
>>select * from t1 where c1 like '% %'; -- ( is 835F, and is 845F)
--- 0 row(s) selected.
>>select * from t1 where c1 like x'25 84 5C 25' escape '\';
C1
--------------------
ABC 123
--- 1 row(s) selected.
>>select * from t1 where c1 like '% %' escape '\'; -- ( is 845C)
C1
--------------------
ABC 123
--- 1 row(s) selected.
Locating Invalid Characters in Syntax Error Messages
It is impossible to guarantee that a Neoview SQL syntax error message can always point to the
exact character that initiated the syntax error. That is why the message has always stated that
the error occurred “at or before” the spot where the carat is printed. This is further complicated
when non-ISO8859-1 source languages such as SJIS or GBK are used, where characters in strings
or delimited identifiers may consist of from one to three bytes of information.
There is the additional problem of SQL commands that can consist of hundreds or even thousands
of lines. The SQL compiler currently prints up to 945 characters that preceded the error, but this
is of limited assistance if the command contains hundreds of lines of very similar sequences of
clauses. SQL commands with fewer than 945 characters are reprinted in full.
For this Neoview Release, parser syntax error messages are expanded to include the actual
number of the character where the error was detected. Syntax error messages now identify the
number of characters from the start of the SQL statement where the error occurred, allowing
you to find the character more quickly with your editor. Unfortunately, the line number where
the error occurred cannot be displayed because the newline characters have been stripped from
the source before Neoview SQL sees it.
Example of a Syntax Error in a Shorter SQL Statement
This is an example of a syntax error on a command that uses less than 945 characters. The
character-identifying text with a carat is provided at the end of the syntax error.
>>create table simpl(a int,);
*** ERROR[15001] A syntax error occurred at or before:
create table simpl(a int,);
Locating Invalid Characters in Syntax Error Messages 33