Identifiers

Overview of Identifiers

An identifier is one or more tokens, or symbols, that name programming language entities, such as variables, method names, package names, and arrays, as well as data source objects, such as table names and column names.
FedSQL supports ANSI SQL:1999 core standards for both regular and delimited identifiers.
Regular identifiers are the type of identifiers that you see in most programming languages. They are not case-sensitive; the identifier “Name” is the same as “NAME” and “name”. Only certain characters are allowed in regular identifiers.
Delimited identifiers are case-sensitive, allow any character, and must be enclosed in double quotation marks.
By supporting ANSI SQL:1999 identifiers, FedSQL is compatible with data sources that also support the ANSI SQL:1999 identifiers.
Note: Identifiers for SAS data sets and SPD Engine data sets are limited to 32 characters.
Note: When more than one data source is involved, the maximum length of an identifier is determined by the smallest maximum length that is supported by all of the data sources and FedSQL. For example, if your data sources are a SAS data set, which has a maximum of 32 characters, and MySQL, which has a maximum of 64 characters, the maximum length of an identifier would be 32 characters.

Regular Identifiers

When you name regular identifiers, use these rules:
  • The length of a regular identifier can be 1 to 256 characters.
  • The first character of a regular identifier must be a letter. Subsequent characters can be letters, digits, or underscores.
  • Regular identifiers are case-insensitive.
The following are valid regular identifiers:
firstName
lastName
phone_num1
phone_num2
Letters in regular identifiers are stored internally as uppercase letters, which allows letters to be written in any case. For example, phone_num1 is the same as Phone_Num1 and PHONE_NUM1.
Note: Each data source has its own naming conventions, all of which are accepted by FedSQL. If your program contains identifiers that are specific for a particular data source, you must follow the naming conventions for that data source. See your database documentation for information about its naming conventions.

Delimited Identifiers

When you name delimited identifiers, follow these rules:
  • The length of a delimited identifier can be 1 to 256 characters.
  • Begin and end delimited identifiers with double quotation marks.
  • Delimited identifiers consist of any sequence of characters, including spaces and special characters, between the beginning and ending double quotation marks.
  • Delimited identifiers are case-sensitive.
A string of characters enclosed in double quotation marks is interpreted as an identifier and not as a character constant. Character constants can be enclosed only in single quotation marks.
The following is a list of valid delimited identifiers:
" x y z"
"Ü1"
"phone_num"
"a & B"
Letters in delimited identifiers are case-sensitive and their case is preserved when they are stored in FedSQL. When they are stored, the double quotation marks are removed. The identifier “phone_num” is not equivalent to “Phone_Num” or “PHONE_NUM”. The delimited identifier “PHONE_NUM” is equivalent to the regular identifier “phone_num”.
You can use delimited identifiers for terms that might otherwise be a reserved word. For example, to use the term “char” other than for a character declaration, you would use it as the delimited identifier “char”. For more information, see FedSQL Reserved Words.
Note: Each data source has its own naming conventions, all of which are accepted by FedSQL. When your program contains identifiers that are specific for a particular data source, you must follow the naming conventions for that data source. See your database documentation for information about table naming conventions for data source objects.

Support for Non-Latin Characters

FedSQL supports non-Latin characters only in quoted identifiers. Only Latin characters can be used in non-delimited identifiers.