You are on page 1of 1

32 Chapter 1: Creating

to find the remote table. That is the purpose of the CREATE SERVER and
CREATE EXTERNLOGIN commands.

1.14.1 CREATE SERVER


The CREATE SERVER command defines a local name for the remote data
server.
<create_server> ::= CREATE SERVER <server_local_name>
CLASS <server_access_class>
USING <connection_string>
[ READ ONLY ]
<server_local_name> ::= <identifier>
<server_access_class> ::= 'ASAJDBC'
| 'ASEJDBC'
| 'ASAODBC'
| 'ASEODBC'
| 'DB2ODBC'
| 'MSSODBC'
| 'ORAODBC'
| 'ODBC'
<connection_string> ::= ODBC string literal containing Data Source Name
| UNIX ODBC string literal 'driver=file_spec;dsn=dsn_name'
| JDBC string literal 'machinename:portnumber[/dbname]'
The server access class specifies the access mechanism (ODBC versus JDBC)
and in some cases the server type; currently the list includes ASA, ASE, DB2,
Oracle, and Microsoft SQL Server. Use 'ODBC' for a server type that isnt
explicitly named in the list (e.g., use 'ODBC' for Excel and text files).
The connection string specifies the exact location of the remote server,
either via an ODBC Data Source Name or a JDBC machine, port, and database
name string.
The READ ONLY clause prevents you from making any changes to the
data on this server.

Tip: The CREATE SERVER and CREATE EXTERNLOGIN commands dont actu-
ally connect to the remote database. You wont find out if the connection works
until you try to create or use a proxy table.

1.14.2 CREATE EXTERNLOGIN


The CREATE EXTERNLOGIN statement is optional for some remote data,
such as text files, but it is required for remote servers that control access such as
SQL Anywhere and Oracle.
CREATE EXTERNLOGIN names a local user ID that will be used to
manipulate remote and proxy tables via a server named in the CREATE
SERVER command. A remote user ID can be provided, together with a remote
password, so that the middleware can make a connection to the remote server.
<create_external_login> ::= CREATE EXTERNLOGIN <local_user_id>
TO <server_local_name>
[ REMOTE LOGIN <remote_user_id>
[ IDENTIFIED BY <remote_password> ] ]
<local_user_id> ::= <identifier>
<remote_user_id> ::= <identifier>
<remote_password> ::= <identifier> -- to be used as a password
| non-empty string literal containing a password

You might also like