Chapter Contents

Previous

Next
RSPT Statements

RSPT Statements



Statements used for Remote SQL Pass-Through.

Local


Syntax
Syntax Description

Syntax

[1]
CONNECT TO dbms-name <AS alias> <(dbms-argument-1=value ... <dbms-argument-n=value>)>;
SELECT . . . FROM CONNECTION TO dbms-name | alias (dbms-query);
EXECUTE (SQL-statement) BY dbms-name | alias;
DISCONNECT FROM dbms-name | alias;

[2]
CONNECT TO REMOTE <AS alias>
(SERVER=serverid <SAPW=server-access-password>
<DBMS=dbms-name>
<PT2DBPW=passthrough-to-DBMS-password>
<DBMSARG=(dbms-argument-1=value ... <dbms-argument-n=value>)>);
SELECT . . . FROM CONNECTION TO REMOTE | alias (dbms-query);
EXECUTE (SQL-statement) BY REMOTE | alias;
DISCONNECT FROM REMOTE | alias;

Syntax Description

[1] The SQL syntax for the SQL procedure Pass-Through (SPT) facility consists of three statements and a FROM-clause component.
[2] The SQL syntax for the Remote SQL Pass-Through (RSPT) facility is similar to the SPT but must also include the name of the remote SAS server.

Details

CONNECT TO REMOTE <AS alias>
establishes a connection to a remote DBMS or to remote SAS data through a SAS server. This statement is required (RSPT does not support implicit connection). You can establish multiple connections to the same server by specifying different DBMS= values. You can also connect to more than one server at a time.

SERVER= serverid
specifies the name of the remote SAS server. If the server is a multi-user server, serverid is the name specified for the ID= option in the PROC SERVER statement. If the server is a single-user server running in a SAS/CONNECT remote session, serverid is the name of the SAS/CONNECT remote session. In either case, serverid should be the same name that is specified for the SERVER= option in a LIBNAME statement.

SAPW=server-access-password
is the password for controlling user access to a multi-user server as specified for the UAPW= option in the PROC SERVER statement. If UAPW= is specified when the server is started, you must specify SAPW= in a CONNECT TO REMOTE statement that specifies that server.

DBMS=dbms-name
is the name of the remote DBMS you want to connect to. This is the same name you would specify in a CONNECT TO statement if you were connecting directly to the DBMS. This option is used if you want to connect to a remote DBMS instead of the remote SAS SQL processor.

PT2DBPW=passthrough-to-DBMS-password
is the password for controlling pass-through access to remote DBMS databases that are specified by using the PT2DBPW= option in the PROC SERVER statement. If PT2DBPW= is specified when the server is started, you must specify PT2DBPW= in a CONNECT TO REMOTE statement that specifies the same server and specifies DBMS=.

DBMSARG=(dbms-argument-1=value ...
<dbms-argument-n=value>)
are the arguments required by the remote DBMS to establish the connection. These are the same arguments you would specify in a CONNECT TO statement if you were connecting directly to the DBMS.

FROM CONNECTION TO REMOTE |
alias (dbms-query);
specifies the connection to the remote SAS SQL processor or the remote DBMS as the source of data for the SELECT statement and the recipient of the dbms-query. For remote SAS data accessed through the PROC SQL view engine, dbms-query is any valid PROC SQL SELECT statement. For a remote DBMS, dbms-query is the same SQL query you would specify if you were connected directly to the DBMS

EXECUTE (SQL-statement) BY REMOTE | alias;
specifies an SQL statement to be executed by the SAS SQL processor or by the remote DBMS in the server SAS session. For remote SAS data that is accessed through the PROC SQL view engine, SQL-statement is any valid PROC SQL statement except SELECT. For a remote DBMS that is accessed through a single-user server in a SAS/CONNECT session, SQL-statement is the same SQL statement that you would specify if you were connected directly to the DBMS. For a remote DBMS, this statement may not be used if the DBMS is accessed through a remote multi-user server.

DISCONNECT FROM REMOTE | alias;
ends the connection to the remote DBMS or to the SAS SQL processor in the server SAS session.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.