Chapter Contents

Previous

Next
SAS/ACCESS Software for Relational Databases: Reference

Defining a Schema

Some SAS/ACCESS engines support LIBNAME options that restrict or qualify the scope, or schema, of the tables in the libref. For example, the DB2 engine supports the AUTHID= and LOCATION= options, and the ORACLE engine supports the SCHEMA= and DBLINK= options. The options vary depending on which SAS/ACCESS interface you are using. See your DBMS chapter to determine which options are available for your DBMS.

The following example uses the SAS/ACCESS Interface to ORACLE:

libname myoralib oracle user=testuser 
password=testpass
   path='myoraserver' schema=testgroup;

proc datasets lib=myoralib;
run;
In this example, the MYORALIB libref is associated with the ORACLE schema named TESTGROUP. The DATASETS procedure lists only the tables and views that are accessible to the TESTGROUP schema. Any reference to a table that uses the libref MYORALIB is passed to the ORACLE server as a qualified table name; for example, if the SAS program reads a table by specifying the SAS data set MYORALIB.TESTTABLE, the SAS/ACCESS engine passes the following query to the server:
select * from "testgroup.testtable"


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.