Reference Manual
CHAPTER 6. SQL Language Elements
The following elements are found in the syntax of many SQL statements.
column-name An identifier that represents the name of a column.
condition An expression that evaluates to TRUE, FALSE, or UNKNOWN. See Search conditions.
connection-name An identifier or a string representing the name of an active connection.
owner An identifier that represents a user ID.
data-type A storage data type, as described in SQL Data Types.
expression An expression, as described in Expressions.
filename A string containing a filename.
host-variable A C language variable, declared as a host variable preceded by a colon.
identifier Any string of alphabetic characters, or digits. The collation sequence of the database dictates which characters are considered alphabetic or digit characters. The underscore character (_ ), at sign (@), number sign (#), and dollar sign ($) are considered alphabetic characters. The first character must be an alphabetic character.
Alternatively, any string of characters can be used as an identifier by enclosing it in quotation marks ("double quotes").
A quotation mark inside the identifier is represented by two quotation marks in a row. Identifiers are truncated to 128 characters. The following are all valid identifiers.
Surname "Surname" SomeBigName some_big_name "Client Number" "With a quotation "" mark"
Some words that adhere to the above rules are reserved because they play an important role in the syntax of the SQL language. If you choose to use one of them as an identifier, you must enclose it in double quotes.
For a complete list of the reserved words, see Alphabetical list of keywords.
indicator-variable A second host variable of type short int immediately following a normal host variable. It must also be preceded by a colon. Indicator variables are used to pass NULL values to and from the database.
number Any sequence of digits followed by an optional decimal part and preceded by an optional negative sign. Optionally, the number can be followed by an E and then an exponent. For example,
42 -4.038 .001 3.4e10 1e-10
role-name An identifier representing the role name of a foreign key.
search-condition A condition that evaluates to TRUE, FALSE, or UNKNOWN. See Search conditions.
string Any sequence of characters enclosed in apostrophes ('single quotes').
To represent an apostrophe inside the string, use two apostrophes in a row. To represent a new line character, use a backslash followed by n (\n). To represent a backslash character, use two backslashes in a row (\\).
Hexadecimal escape sequences can be used for any character, printable or not. A hexadecimal escape sequence is a backslash followed by an x followed by two hexadecimal digits (for example, \x6d represents the letter m). The following are valid strings:
'This is a string.' 'John''s database' '\x00\x01\x02\x03'
For compatibility with Adaptive Server Enterprise, you can set the QUOTED_IDENTIFIER database option to OFF, and then you can also use double quotes to mark the beginning and end of strings. The option is set to ON by default.
savepoint-name An identifier that represents the name of a savepoint.
statement-label An identifier that represents the label of a loop or compound statement.
table-list A list of table names, which may include correlation names. See FROM clause.
table-name An identifier that represents the name of a table.
userid An identifier that represents a user name.
variable An identifier that represents a variable name.