informix
Informix Guide to SQL: Syntax
Segments

Database Name

Use the Database Name segment to specify the name of a database. Use the Database Name segment whenever you see a reference to a database name in a syntax diagram.

Syntax

Element Purpose Restrictions Syntax
dbname Name of the database itself This simple name does not include the pathname or the database server name. A database name must be unique among the database names on the same database server. In Dynamic Server, dbname can have a maximum of 128 bytes. In Enterprise Decision Server, dbname can have a maximum of 18 bytes. Identifier, p. 4-205
dbservername Name of the database server on which the database that is named in dbname resides. The database server that is specified in dbservername must exist. You cannot put a space between the @ symbol and dbservername. In Dynamic Server, dbservername can have a maximum of 128 bytes. In Enterprise Decision Server, dbservername can have a maximum of 18 bytes. Identifier, p. 4-205
db_var Host variable that contains a value representing a database environment Variable must be a fixed-length character data type. Name must conform to language-specific rules for variable names.

Usage

Database names are not case sensitive. You cannot use delimited identifiers for a database name.

If you are using a nondefault locale, you can use characters from the code set of your locale in the names of databases.

If you are using a multibyte code set, keep in mind that the maximum length of the database name refers to the number of bytes, not the number of characters.

For further information on the GLS aspects of naming databases, see the Informix Guide to GLS Functionality.

Specifying the Database Server

You can choose a database on another database server as your current database by specifying a database server name. The database server that dbservername specifies must match the name of a database server that is listed in your sqlhosts information.

Using the @ Symbol

The @ symbol is a literal character that introduces the database server name. If you specify a database server name, do not put any spaces between the @ symbol and the database server name. You can either put a space between dbname and the @ symbol, or omit the space.

The following examples show valid database specifications:

In these examples, empinfo is the name of the database and personnel is the name of the database server.

Using a Path-Type Naming Method

If you use a path-type naming method, do not put spaces between the quotes, slashes, and names, as the following example shows:

In this example, empinfo is the name of the database and personnel is the name of the database server.

Using a Host Variable

You can use a host variable within an ESQL/C application to contain a value that represents a database environment.


Informix Guide to SQL: Syntax, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved