CREATE NICKNAME statement - Examples for the ODBC wrapper

Use the CREATE NICKNAME statement to register a nickname for an ODBC table or view that you want to access. This topic provides a complete example with the required parameters.

The following example shows how to register a nickname for an ODBC table or view using the CREATE NICKNAME statement.

CREATE NICKNAME cust_europe FOR mysql_server."vinnie"."italy"
A unique nickname that is used to identify the ODBC table or view. The nickname must be unique within the schema.
Important: The nickname is a two-part name—the schema and the nickname. If you omit the schema when you register the nickname, the schema of the nickname will be the authorization ID of the user who registers the nickname.

If your ODBC data source does not support schemas, omit the schema from the CREATE NICKNAME statement.

A three-part identifier for the remote object:
  • mysql_server is the server definition name that you assigned to the ODBC data source server in the CREATE SERVER statement.
  • vinnie is the user ID of the owner to which the table or view belongs.
  • italy is the name of the remote table or view that you want to access.

The federated server folds the names of the ODBC schemas and tables to uppercase unless you enclose the names in quotation marks.