INFORMIX
Informix Guide to SQL: Syntax
Chapter 1: SQL Statements
Home Contents Index Master Index New Book

SQL Statements

Constraint Name

The Constraint Name segment specifies the name of a constraint. Use the Constraint Name segment whenever you see a reference to a constraint name in a syntax diagram.

Syntax

Element Purpose Restrictions Syntax

database

The name of the database where the constraint resides

The database must exist.

Database Name, p. 1-856

dbservername

The name of the Universal Server database server that is home to database. The @ symbol is a literal character that introduces the database server name.

The database server that dbservername specifies must match the name of a database server in the sqlhosts file.

Database Name, p. 1-856

owner

The user name of the owner of the constraint

If you are using an ANSI-compliant database, you must enter the owner. parameter for a constraint that you do not own. If you put quotation marks around the name that you enter in owner, the name is stored exactly as typed. If you do not put quotation marks around the name that you enter in owner, the name is stored as uppercase letters.

The user name must conform to the conventions of your operating system.

Usage

The actual name of the constraint is an SQL identifier.

GLS
If you are using a nondefault locale, you can use characters from the code set of your locale in the names of constraints. For more information, see the Guide to GLS Functionality.

When you create a constraint, the name of the constraint must be unique within the database if the database is not ANSI compliant.

ANSI
When you create a constraint, the owner.name combination (the combination of the owner name and constraint name) must be unique within a database.

The owner.name combination is case sensitive. In an ANSI-compliant database, if you do not use quotes around the owner name, the name of the constraint owner is stored as uppercase letters. For more information, see the discussion of case sensitivity in ANSI-compliant databases on page 1-1049.

References

See the CREATE TABLE statement in this manual for information on defining constraints.

Database Name

The Database Name segment specifies 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

The 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. Database names are not case sensitive. If you are using Universal Server, the database name can have a maximum of 18 characters.

Identifier, p. 1-966

dbservername

The name of the database server on which the database that is named in dbname resides. The @ symbol is a literal character that introduces the database server name. Specifying a database server name allows you to choose a database on another database server as your current database. You can name the current database server using dbservername, although that is extra information.

The database server that is specified in dbservername must match the name of a database server in the sqlhosts file. You can put a space between dbname and the @ symbol, or you can omit the space. You cannot put a space between the @ symbol and dbservername. For restrictions on dbservername that are specific to syntax formats that use quotation marks and slash symbols, see "//dbservername/dbname Option".

Identifier, p. 1-966

variable name

The name of a host variable that holds the database name

Contents must comply with restrictions on dbservername

Name of the host variable must conform to language-specific rules for variable names.

Usage

The simple database name is an SQL identifier, as described on page 1-966. If you are creating a database, the name that you assign to the database can be 18 characters, inclusive. Database names are not case sensitive. You cannot use delimited identifiers for a database name.

The maximum length of the database name, including dbservername, is 128 characters.

The following example shows a database specification:

GLS
If you are using a nondefault locale, you can use characters from the code set of your locale in the names of databases. For more information, see the Guide to GLS Functionality.

@dbservername Option

If you use a database server name, do not put any spaces between the name and the @ symbol. For example, the following format is valid for the stores7 database on the training database server:

//dbservername/dbname Option

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

variable name Option

ESQL
You can use a variable within an SQL API to hold the name of a database.

References

See the CREATE DATABASE and RENAME DATABASE statements in this manual for information on naming databases.




Informix Guide to SQL: Syntax, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.