Identifiers; Regular Identifiers; Delimited Identifiers; Examples Of Identifiers - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Identifiers

SQL identifiers are names used to identify tables, views, columns, and other SQL entities. The
two types of identifiers are regular and delimited. A delimited identifier is enclosed in double
quotes ("). An identifier of either type can contain up to 128 characters.

Regular Identifiers

Regular identifiers begin with a letter (A through Z or a through z), but can also contain digits
(0 through 9), or underscore characters (_). Regular identifiers are not case-sensitive. You cannot
use a reserved word as a regular identifier.

Delimited Identifiers

Delimited identifiers are character strings that appear within double quote characters (") and
consist of alphanumeric characters and other characters except for the at sign (@), the forward
slash (/), backward slash (\), and circumflex (^). To include a double quote character in a
delimited identifier, use two consecutive double quotes (for example, "da Vinci's ""Mona
Lisa""").
Unlike regular identifiers, delimited identifiers are case-sensitive. Spaces within a delimited
identifier are significant except for trailing spaces, which Neoview SQL truncates. You can use
reserved words as delimited identifiers.
These forms of delimited identifiers are not supported. Results are unpredictable for delimited
identifiers that:
Start with a "\" or "$"
Consist of space characters only (for example, " ", " ")
Consist of special characters only (for example, "~" or "~!#$%^&")
Contain more than two consecutive double quote characters (for example,
""""""""""abc"""""""""")
Contain dots (for example, "cat.sch".sch2."cat3.sch3.mod")
Cause a length limit (128) overflow (for example, 250 double quotes will result in character
length of 125 bytes)

Examples of Identifiers

These are regular identifiers:
mytable
SALES1995
Employee_Benefits_Selections
CUSTOMER_BILLING_INFORMATION
Because regular identifiers are case insensitive, Neoview SQL treats all these identifiers as
alternative representations of mytable:
mytable
These are delimited identifiers:
"mytable"
"table"
"1995 SALES"
"CUSTOMER-BILLING-INFORMATION"
"%&*()"
Because delimited identifiers are case-sensitive, Neoview SQL treats the identifier "mytable"
as different from the identifiers "MYTABLE" or "MyTable". Trailing spaces in a delimited
identifier are truncated. For example, "mytable " is equivalent to "mytable".
You can use reserved words as delimited identifiers. For example, table is not allowed as
a regular identifier, but "table" is allowed as a delimited identifier.
220
SQL Language Elements
MYTABLE
MyTable
mYtAbLe

Advertisement

Table of Contents
loading

Table of Contents