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.

144 DIRECT_SQL= LIBNAME Option 4 Chapter 10NOspecifies that generated SQL from PROC SQL is not passed to the DBMS <strong>for</strong>processing. This is the same as specifying the value NOGENSQL.NONEspecifies that generated SQL is not passed to the DBMS <strong>for</strong> processing. This includesSQL that is generated from PROC SQL, <strong>SAS</strong> functions that can be converted intoDBMS functions, joins, and WHERE clauses.NOGENSQLprevents PROC SQL from generating SQL to be passed to the DBMS <strong>for</strong> processing.NOWHEREprevents WHERE clauses from being passed to the DBMS <strong>for</strong> processing. Thisincludes <strong>SAS</strong> WHERE clauses and PROC SQL generated or PROC SQL specifiedWHERE clauses.NOFUNCTIONSprevents SQL statements from being passed to the DBMS <strong>for</strong> processing when theycontain functions.NOMULTOUTJOINSspecifies that PROC SQL does not attempt to pass any multiple outer joins to theDBMS <strong>for</strong> processing. Other join statements might be passed down however,including portions of a multiple outer join.DetailsBy default, processing is passed to the DBMS whenever possible, because the databasemight be able to process the functionality more efficiently than <strong>SAS</strong> does. In someinstances, however, you might not want the DBMS to process the SQL. For example,the presence of null values in the DBMS data might cause different results dependingon whether the processing takes place in <strong>SAS</strong> or in the DBMS. If you do not want theDBMS to handle the SQL, use DIRECT_SQL= to <strong>for</strong>ce <strong>SAS</strong> to handle some or all SQLprocessing.If you specify DIRECT_SQL=NOGENSQL, then PROC SQL does not generate DBMSSQL. This means that <strong>SAS</strong> functions, joins, and DISTINCT processing that occur withinPROC SQL are not passed to the DBMS <strong>for</strong> processing. (<strong>SAS</strong> functions outside PROCSQL can still be passed to the DBMS.) However, if PROC SQL contains a WHEREclause, the WHERE clause is passed to the DBMS, if possible. Unless you specifyDIRECT_SQL=NOWHERE, <strong>SAS</strong> attempts to pass all WHERE clauses to the DBMS.If you specify more than one value <strong>for</strong> this option, separate the values with spacesand enclose the list of values in parentheses. For example, you could specifyDIRECT_SQL=(NOFUNCTIONS, NOWHERE).DIRECT_SQL= overrides the SQL_FUNCTIONS= LIBNAME option. If you specifySQL_FUNCTIONS=ALL and DIRECT_SQL=NONE, no functions are passed.ExamplesThe following example prevents a join between two tables from being processed bythe DBMS, by setting DIRECT_SQL=NOGENSQL. Instead, <strong>SAS</strong> processes the join.proc sql;create view work.v asselect tab1.deptno, dname frommydblib.table1 tab1,mydblib.table2 tab2

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

Saved successfully!

Ooh no, something went wrong!