SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Converting SQL/MP Applications to SQL/MX
Applications
HP NonStop SQL/MX Database and Application Migration Guide540435-005
10-33
String Literal Delimiters
These examples show a reserved word without double quotes, a nonreserved word
without double quotes, and a reserved word with double quotes.
Example 1Reserved Word Without Double Quotes
Hewlett-Packard NonStop(TM) SQL/MX Conversational Interface 2.0
(c) Copyright 2003 Hewlett-Packard Development Company, LP.
>>table SQL;
*** ERROR[15001] A syntax error occurred at or before:
table SQL;
^
*** ERROR[8822] The statement was not prepared.
Example 2Non-Reserved Word Without Double Quotes
>>table onion;
*** ERROR[4082] Table, view or stored procedure CAT.SCH.ONION does not exist
or is inaccessible.
*** ERROR[8822] The statement was not prepared
Example 3Reserved Word With Double Quotes
>>table "SQL";
*** ERROR[4082] Table, view or stored procedure CAT.SCH."SQL" does not exist
or is inaccessible.
*** ERROR[8822] The statement was not prepared.
If the word is reserved, as in the first example, the command returns a syntax error. If
the word is not reserved, as in the second example, or is a reserved word with double
quotes around it, as in the third example, it returns a different error (for example “Table,
view, or stored procedure
reserved-word does not exist or is inaccessible.”). If the
table actually exists, NonStop SQL/MX processes the statement normally.
Checking for Reserved Words When You Convert SQL/MP
Applications to SQL/MX
When converting an SQL/MP application to an SQL/MX application, check all
identifiers for SQL/MX reserved words and enclose each reserved word that is not a
host variable name in double quotes.
For a list of SQL/MX reserved words, see the
SQL/MX Reference Manual. For
information about how to use reserved words and limitations in NonStop SQL/MX, see
the Identifiers entry in the
SQL/MX Reference Manual.
String Literal Delimiters
NonStop SQL/MP uses both single (') and double quote characters (") to enclose
character, date-time, and interval literals. NonStop SQL/MX uses only single quote
characters for string delimiters, conforming to the SQL:1999 standard.
When converting an SQL/MP application to an SQL/MX application, change the double
quote characters around literals to single quotes. That way, NonStop SQL/MX does not