Use the CREATE SERVER statement to set up remote server definitions.
For some systems, including Sybase IQ and Adaptive Server Anywhere, each data source describes a database, so a separate remote server definition is needed for each database.
You must have RESOURCE authority to create a server.
The following statement creates an entry in the sysservers table for the Adaptive Server Enterprise server named ASEserver:
CREATE SERVER ASEserver CLASS 'asejdbc' USING 'rimu:6666/my_asedb'
where:
asejdbc specifies the server is an Adaptive Server Enterprise and the connection to it is JDBC-based
rimu:6666/my_asedb is the machine name and TCP/IP port number where the remote server is located, and the database you will connect to. Specifying the database is optional when creating remote Adaptive Server Enterprise servers.
For ODBC connections, each remote server corresponds to an ODBC data source.
ODBC-based connections may only be used for IQ on 32-bit systems. To create an ODBC-based server class, you must first create a DSN, as described in “Creating and editing ODBC data sources”.
The following statement creates an entry in the sysservers table for the ODBC-based Sybase IQ server named testasiq:
CREATE SERVER testasiq CLASS 'asaodbc' USING 'test4'
where:
testasiq is the name by which the remote server is known within this database.
asaodbc specifies that the server is an Sybase IQ (or Adaptive Server Anywhere) and the connection to it uses ODBC.
For more information on server classes, including CREATE SERVER requirements for various server classes, see Chapter 17, “Server Classes for Remote Data Access.”