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.

The LIBNAME Statement <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong> 4 CONNECTION= LIBNAME Option 111In the following GLOBALREAD example, the two librefs, MYDBLIB andMYDBLIB2, share the same connection <strong>for</strong> read access becauseCONNECTION=GLOBALREAD and the connection options are identical. The firstconnection is used to print the data from MYDBLIB.TAB while a second connection ismade <strong>for</strong> updating MYDBLIB.TAB. The second connection is closed at the end of thestep. Note that the first connection is closed with the final LIBNAME statement.libname mydblib oracle user=testuser /* connection 1 */pw=testpass path=’myorapath’connection=globalread;libname mydblib2 oracle user=testuserpw=testpass path=’myorapath’connection=globalread;proc print data=mydblib.tab ...proc sql; /* connection 2 */update mydblib.tab ...libname mydblib clear; /* does not close connection 1 */libname mydblib2 clear; /* closes connection 1 */In the following UNIQUE example, the libref, MYDBLIB, does not establish aconnection. A connection is established in order to print the data from MYDBLIB.TAB.That connection is closed at the end of the print procedure. Another connection isestablished to update MYDBLIB.TAB. That connection is closed at the end of the PROCSQL. The CLEAR option in the LIBNAME statement at the end of this example doesnot close any connections.libname mydblib oracle user=testuserpw=testpass path=’myorapath’connection=unique;proc print data=mydblib.tab ...proc sql;update mydblib.tab ...libname mydblib clear;

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

Saved successfully!

Ooh no, something went wrong!