Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Names

Names are strings used to identify SQL objects.

The name of an object is usually defined when the object itself is defined using the appropriate SQL statement. The name has then been introduced and the object can be referenced using this name in any subsequent statements.

SESAM/SQL distinguishes between unqualified names and qualified names.

Unqualified names

Unqualified names are either regular names that are not enclosed in double quotes, or special names, which must be enclosed in double quotes.

Regular names

Regular names are made up of alphabetic characters, numerics and the underscore character (_). The first character of a regular name must be an alphabetic character. Lowercase characters are converted to uppercase during interpretation. Reserved SQL keywords must not be used as regular names.

Special names

Special names, on the other hand, can contain reserved SQL keywords and characters which are not permitted for regular names. A distinction is made between uppercase and lowercase letters. Special names are enclosed in double quotes. The character following the first quote must not be an underscore (_). Quotes within a special name must be entered twice. The two double quotes then count as a single character.

Blanks at the end of special names are ignored. I.e. the following representations are all equivalent:

CUSTOMERS     Customers     “CUSTOMERS”     “CUSTOMERS ”

Qualified names

To allow the unique identification of different objects with the same name within an SQL application, it is possible to qualify the names. Names of objects can be qualified explicitly in SQL by prefixing the name with a database name, schema name, table name or correlation name, followed by a period.

The following qualifications are possible

  • Schema, space, storage group, table, index. Integrity constraint and routine with the database name.

  • Table, index, integrity constraint and routine with the schema name.

  • Column with the table or correlation name.

With the exception of column names, names of SQL objects must generally be qualified, either explicitly or implicitly. If a name is not qualified explicitly using the database or schema name, it is implicitly qualified by the default database or schema name. The default database and schema names are specified in the precompiler option SOURCE- PROPERTIES (see the “ ESQL-COBOL for SESAM/SQL-Server” manual) or in the configuration data for the utility monitor (see the “ Utility Monitor” manual). In the case of dynamically compilable statements, the user can specify the default database or schema name with the SET CATALOG and SET SCHEMA statements respectively (see "Defining default values in dynamic statements").


Example

CUSTOMERS table in the ORDERPROC schema of the ORDERCUST database

     ordercust.orderproc.customers