LIBREF Statement

Creates a connection to an SPD Server domain within an EXECUTE statement.

Valid in: SPD Server
Explicit SQL pass-through facility
Requirement: The domain specified in the LIBREF statement must be on the same network as the domain specified in the CONNECT TO statement.

Syntax

LIBREF libref-name ENGOPTS='connection-string'

Arguments

libref-name

specifies a logical name for the connection. This name can be used a domain qualifier in subsequent explicit pass-through requests.

ENGOPTS='connection-string'

specifies SPD Server connection parameters:

DBQ=domain

specifies the name of the SPD Server domain to which you want to connect. The domain must have been previously defined in a libnames.parm file.

SERVER=host.port

specifies the name of the SPD Server Name Server host computer and port number.

USER=userID

specifies an SPD Server user ID.

PASSWORD=password

specifies the password associated with the user ID. The PASSWORD parameter is not required when the ANONYMOUS user ID is used.

Details

The statements submitted within an SQL EXECUTE statement apply to the SPD Server domain specified in the CONNECT TO statement. The LIBREF statement is provided to enable you to reference another domain within the SQL explicit pass-through session.
The domain specified in the LIBREF statement must be on the same network as the domain specified in the CONNECT TO statement. For information to establish a connection to a domain that is in a different network, see Nesting SQL Pass-Through Access.
The LIBREF statement is often used in statement blocks that are submitted to the SQL processor within the BEGIN ASYNC OPERATION and END ASYNC OPERATION statements. When used within a block, a LIBREF statement must be issued for both the CONNECT TO domain and the new domain, so that you can identify tables from the domains using two-part names. For an example of how the LIBREF= statement is used, see Using SQL Options in an ASYNC Block Statement.
Last updated: February 8, 2017