Identifiers

Simple Identifiers

All identifiers may be up to 128 characters. Identifiers may be quoted (with case-sensitivity) by enclosing them in double-quote marks ("), or unquoted (with implicit uppercasing before both storage and lookup).

Unquoted identifiers must start with a letter or underscore, and be followed by letters, digits or underscores; letters are all converted to upper case.

Quoted identifiers can contain other punctuation too (in fact, any Unicode character except control characters: codes 0x0000 through 0x001F). You can include a double-quote in an identifier by escaping it with another double-quote.

In the following example, a stream is created with an unquoted identifier, which is converted to upper case before the stream definition is stored in the catalog. It can be referenced using its upper-case name, or by an unquoted identifier which is implicitly converted to upper case.

-- create a stream called FOOBAR
CREATE stream FooBar(baz INTEGER NOT NULL);
-- ok
SELECT stream * FROM FOOBAR;
-- ok; unquoted name is not case-sensitive
SELECT stream * FROM foobar;
-- ok; unquoted name is converted to FOOBAR
SELECT stream * FROM FooBar;
-- error; stream "FooBar" not found; quoted names are case sensitive
SELECT stream * FROM "FooBar";

When objects are created using SQLstream s-Studio, their names are implicitly quoted, so it is easy to create identifiers that contain lowercase characters, spaces, dashes, or other punctuation. If you reference those objects in SQL statements, you will need to quote their names.

Compound identifiers

The compound or qualified identifier “catalog-name”.“schema-name”.“object-name” fully qualifies a schema object name:

<qualified-identifier> := [ [ < - catalog-name
>. ] < - schema-name
>. ] < - object_name
>

<catalog-name>         := < - identifier
>

<schema-name>          := < - identifier
>

<object_name>          := < - identifier
>

<identifier>           :=   <alpha>  <underscore> [ { <alpha>  <digit>  <underscore> } ]

                           " <non-control-character> [ { <non-control-character> } ] "
<alpha>                := any character A-Z, or a-z
<digit>                := any digit 0-9
<underscore>           := _
<non-control-character>:= any character except 0x0000 through 0x001F

Reserved Words and Keywords

Certain identifiers, called keywords, have special meaning if they occur in a particular place in a streaming SQL statement. A subset of these key words are called reserved words and may not be used as the name of an object, unless they are quoted.

See list of reserved and key words.