Connects to the specified server to establish a passthrough-mode connection; takes the connection out of passthrough mode.
connect to server_name disconnect
connect to specifies the server to which a passthrough connection is required. Passthrough mode enables you to perform native operations on a remote server.
server_name must be the name of a server in the sysservers table, with its server class and network name defined.
When establishing a connection to server_name on behalf of the user, Component Integration Services uses one of the following identifiers:
A remote login alias described in sysattributes, if present
The user’s name and password
In either case, if the connection cannot be made to the specified server, Adaptive Server returns an error message.
For more information about adding remote servers, see sp_addserver.
After making a passthrough connection, Component Integration Services bypasses the Transact-SQL parser and compiler when subsequent language text is received. It passes statements directly to the specified server, and converts the results into a form that can be recognized by the Open Client interface and returned to the client program.
To take the connection created by the connect to command out of passthrough mode, use disconnect. You can use this command only after the connection has been made using connect to.
disconnect does not actually cause the termination of the connection to the remote server; instead, it simply takes the connection out of passthrough mode, leaving the connection available for subsequent DDL or DML statements that are processed normally by the Adaptive Server query processor.
disconnect can be abbreviated to disc.
disconnect returns an error unless connect to has already been previously issued and the server is connected to a remote server.
When disconnect is issued, Component Integration Services forwards disconnect to the remote server, to take it out of passthrough mode. If not in passthrough mode, syntax errors may occur, but they are ignored by Component Integration Services and not forwarded to the client.
No interaction occurs with ASAnywhere when connect or disconnect are issued.
No interaction occurs with ASIQ when connect or disconnect are issued.
When connect is issued using a server in class direct_connect, the direct_connect is sent an RPC:
sp_thread_props “passthru mode”, 1
When disconnect is issued, and the server for which a passthrough-mode connection has been established is a direct_connect, the direct_connect is sent an RPC:
sp_thread_props “passthru mode”, 0
No interaction occurs with db2 when connect or disconnect are issued.
commit in the Reference Manual