Contents Index CREATE SCHEMA statement CREATE SERVICE statement

ASA SQL Reference
  SQL Statements

CREATE SERVER statement


Description 

Use this statement to add a server to the SYSSERVERS system table.

Syntax 

CREATE SERVER server-name
CLASS 'server-class'
USING 'connection-info'
READ ONLY ]

server-class :
  ASAJDBC | ASEJDBC
ASAODBC | ASEODBC
DB2ODBC | MSSODBC
ORAODBC | ODBC

connection-info :
  { machine-name:port-number [/dbname ] | data-source-name }

Parameters 

CLASS clause    Specifies the server class you want to use for a remote connection. Server classes contain detailed server capability information. If you are using NetWare, only the asajdbc class is supported.

USING clause    If a JDBC-based server class is used, the USING clause is of the form hostname:portnumber [/dbname], where:

If an ODBC-based server class is used, the USING clause is the data-source-name. The data-source-name is the ODBC Data Source Name.

On UNIX platforms, you need to reference the ODBC driver manager as well. For example, using the supplied Merant drivers, the syntax is as follows:

USING 'driver=/opt/sybase/SYBSsa9/drivers/lib/libodbc.so;dsn=my_dsn'

READ ONLY    The READ ONLY clause specifies that the remote server is a read-only data source. Any update request is rejected by Adaptive Server Anywhere.

Usage 

The CREATE SERVER statement defines a remote server from the Adaptive Server Anywhere catalogs.

For more information on server classes and how to configure a server, see Server Classes for Remote Data Access.

Permissions 

Must have RESOURCE authority.

Not supported on Windows CE.

Side effects 

Automatic commit.

See also 

ALTER SERVER statement

DROP SERVER statement

Server Classes for Remote Data Access

Standards and compatibility 
Example 

The following example creates an Adaptive Server Anywhere remote server named testasa, located on the machine apple and listening on port number 2638, use:

CREATE SERVER testasa
CLASS 'asajdbc'
USING 'apple:2638'

The following example creates a remote server for the JDBC-based Adaptive Server named ase_prod. Its machine name is banana and port number is 3025.

CREATE SERVER ase_prod
CLASS 'asejdbc'
USING 'banana:3025'

The following example creates a remote server for the Oracle server named oracle723. Its ODBC Data Source Name is oracle723.

CREATE SERVER oracle723
CLASS 'oraodbc'
USING 'oracle723'

Contents Index CREATE SCHEMA statement CREATE SERVICE statement