Tokens
The basic syntactical units of the SQL language are called tokens. A token consists of one or more characters of which none are blanks, control characters, or characters within a string constant or delimited identifier.
Tokens are classified as ordinary or delimiter tokens:
- An ordinary token is a numeric constant, an ordinary
identifier, a host identifier, or a keyword. Examples:
1 .1 +2 SELECT E 3
- A delimiter token is a string constant, a delimited
identifier, an operator symbol, or any of the special characters shown
in the syntax diagrams. A question mark (?) is also a delimiter token
when it serves as a parameter marker, as explained in PREPARE.
Examples:
, 'string' "fld1" = .
Spaces
A space is a sequence of one or more blank characters.
Uppercase and lowercase
A token in an SQL statement can include lowercase letters, but lowercase letters in an ordinary token are folded to uppercase. Delimiter tokens are never folded to uppercase.
Example: The following two statements, after folding, are equivalent:
select * from PCB01.HOSPITAL where hospname = 'Alexandria';
SELECT * FROM PCB01.HOSPITAL WHERE HOSPNAME = 'Alexandria';