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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SAS</strong>/<strong>ACCESS</strong> Interface to Sybase 4 Reading Multiple Sybase Tables 753Passing Joins to SybaseFor a multiple libref join to pass to Sybase, all of these components of the LIBNAMEstatements must match exactly:user ID (USER=)password (PASSWORD=)database (DATABASE=)server (SERVER=)For more in<strong>for</strong>mation about when and how <strong>SAS</strong>/<strong>ACCESS</strong> passes joins to the DBMS,see “Passing Joins to the DBMS” on page 43.Reading Multiple Sybase Tables<strong>SAS</strong> opens multiple Sybase tables <strong>for</strong> simultaneous reading in these situations:3 When you are using PROC COMPARE. Here is an example:proc compare base=syb.data1 compare=syb.data2;3 When you are running an SCL program that reads from more than one Sybasetable simultaneously.3 When you are joining Sybase tables in <strong>SAS</strong>—namely, when implicit pass-throughis not used (DIRECT_SQL=NO). Here are four examples:proc sql ;select * from syb.table1, syb.table2 where table1.x=table2.x;proc sql;select * from syb.table1 where table1.x = (select x from syb.table2where y = 33);proc sql;select empname from syb.employee where empyears > all (select empyearsfrom syb.employee where emptitle = ’salesrep’);proc sql ;create view myview asselect * from employee where empyears > all (select empyears fromsyb.employee where emptitle = ’salesrep’);proc print data=myview ;To read two or more Sybase tables simultaneously, you must specify either theLIBNAME option CONNECTION=UNIQUE or the LIBNAME optionREADLOCK_TYPE=PAGE. Because READLOCK_TYPE=PAGE can degradeper<strong>for</strong>mance, it is generally recommended that you use CONNECTION=UNIQUE(unless there is a concern about the number of connections that are opened on thedatabase).

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

Saved successfully!

Ooh no, something went wrong!