13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

434 CONNECTION TO Component 4 Chapter 13CONNECTION TO ComponentRetrieves and uses DBMS data in a PROC SQL query or viewValid in: PROC SQL step SELECT statements (when accessing DBMS data using<strong>SAS</strong>/<strong>ACCESS</strong> software)SyntaxCONNECTION TO dbms-name | alias (dbms-query)The CONNECTION TO component specifies the DBMS connection that you want touse or that you want to create (if you have omitted the CONNECT statement).CONNECTION TO then enables you to retrieve DBMS data directly through a PROCSQL query.You use the CONNECTION TO component in the FROM clause of a PROC SQLSELECT statement:PROC SQL;SELECT column-listFROM CONNECTION TO dbms-name (dbms-query)other optional PROC SQL clausesQUIT;You can use CONNECTION TO in any FROM clause, including those in nestedqueries—that is, subqueries.You can store an SQL pass-through facility query in an SQL view and then use thatview in <strong>SAS</strong> programs. When you create an SQL view, any options that you specify inthe corresponding CONNECT statement are stored too. So when the SQL view is usedin a <strong>SAS</strong> program, <strong>SAS</strong> can establish the appropriate connection to the DBMS.On many relational databases, you can issue a CONNECTION TO component in aPROC SQL SELECT statement directly without first connecting to a DBMS. (See“CONNECT Statement” on page 427.) If you omit the CONNECT statement, animplicit connection is per<strong>for</strong>med when the first PROC SQL SELECT statement thatcontains a CONNECTION TO component is passed to the DBMS. Default values areused <strong>for</strong> all DBMS connection arguments. See the documentation <strong>for</strong> your<strong>SAS</strong>/<strong>ACCESS</strong> interface <strong>for</strong> details.Because relational databases and <strong>SAS</strong> have different naming conventions, someDBMS column names might be changed when you retrieve DBMS data through theCONNECTION TO component. See Chapter 2, “<strong>SAS</strong> Names and Support <strong>for</strong> DBMSNames,” on page 11 <strong>for</strong> more in<strong>for</strong>mation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!