Previous Page | Next Page

The SQL Pass-Through Facility for Relational Databases

Syntax for the SQL Pass-Through Facility for Relational Databases


Overview

This section presents the syntax for the SQL pass-through facility statements and the CONNECTION TO component. For DBMS-specific details, see the documentation for your SAS/ACCESS interface.

PROC SQL <option(s)>;
CONNECT TO dbms-name <AS alias> <(<database-connection-arguments> <connect-statement-arguments> )>;
DISCONNECT FROM dbms-name | alias;
EXECUTE (dbms-specific-SQL-statement) BY dbms-name | alias;
SELECT column-list FROM CONNECTION TO dbms-name | alias (dbms-query)

Return Codes

As you use the PROC SQL statements that are available in the SQL pass-through facility, any error return codes and error messages are written to the SAS log. These codes and messages are available to you through these SAS macro variables:

SQLXRC

contains the DBMS return code that identifies the DBMS error.

SQLXMSG

contains descriptive information about the DBMS error that the DBMS generates.

The contents of the SQLXRC and SQLXMSG macro variables are printed in the SAS log using the %PUT macro. They are reset after each SQL pass-through facility statement has been executed.

See Macro Variables for Relational Databases for more information about these return codes.

Previous Page | Next Page | Top of Page