Characters
The basic symbols of keywords and operators in the SQL language are single-byte characters that are part of all character sets supported by the IBM® relational database products.
Characters of the language are classified as letters, digits, or special characters.1
A letter is any of the 26 uppercase (A through Z) and 26 lowercase (a through z) letters of the English alphabet. 2
A digit is any of the characters 0 through 9.
A special character is any of the characters listed below:
space or blank | - | minus sign | |
" | quotation mark or double-quote or double quotation mark | . | period |
% | percent | / | slash |
& | ampersand | : | colon |
' | apostrophe or single quote or single quotation mark | ; | semicolon |
( | left parenthesis | < | less than |
) | right parenthesis | = | equals |
* | asterisk | > | greater than |
+ | plus sign | ? | question mark |
, | comma | _ | underline or underscore |
| | vertical bar4 | ‸ | caret |
! | exclamation mark3 | [ | left bracket |
{ | left brace | ] | right bracket |
} | right brace | ¬ | not 3 |
1 Note that if the SQL statement is
encoded as Unicode data, all characters of the statement except for
string constants will be converted to single-byte characters prior
to processing. Tokens representing string constants may be processed
as UTF-16 graphic strings without conversion to single-byte.
2 Letters
also include three code points reserved as alphabetic extenders for
national languages (#, @, and $ in the United States). These three
code points should be avoided because they represent different characters
depending on the CCSID.
3 Using the not symbol (¬) and the exclamation
point symbol (!) might inhibit code portability between IBM relational database products. Avoid using
them because they are variant characters. Instead of ¬= or != use <>.
Instead of ¬> or !> use <=. Instead of ¬< or !< use >=.
4 Using the vertical bar (|) character might inhibit code
portability between IBM relational
database products. Use the CONCAT operator instead of the concatenation
operator (||).