SAS/ACCESS Interface to Oracle |
Overview |
This section describes the LIBNAME statement that SAS/ACCESS Interface to Oracle supports and includes examples. For details about this feature, see Overview of the LIBNAME Statement for Relational Databases.
Here is the LIBNAME statement syntax for accessing Oracle.
LIBNAME libref oracle <connection-options> <LIBNAME-options>; |
Arguments |
specifies any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views.
specifies the SAS/ACCESS engine name for the Oracle interface.
provide connection information and control how SAS manages the timing and concurrence of the connection to the DBMS. Here is how these options are defined.
specifies an optional Oracle user name. If the user name contains blanks or national characters, enclose it in quotation marks. If you omit an Oracle user name and password, the default Oracle user ID OPS$sysid is used, if it is enabled. USER= must be used with PASSWORD=.
specifies an optional Oracle password that is associated with the Oracle user name. If you omit PASSWORD=, the password for the default Oracle user ID OPS$sysid is used, if it is enabled. PASSWORD= must be used with USER=.
specifies the Oracle driver, node, and database. Aliases are required if you are using SQL*Net Version 2.0 or later. In some operating environments, you can enter the information that is required by the PATH= statement before invoking SAS.
SAS/ACCESS uses the same Oracle path designation that you use to connect to Oracle directly. See your database administrator to determine the databases that have been set up in your operating environment, and to determine the default values if you do not specify a database. On UNIX systems, the TWO_TASK environment variable is used, if set. If neither the PATH= nor the TWO_TASK values have been set, the default value is the local driver.
define how SAS processes DBMS objects. Some LIBNAME options can enhance performance, while others determine locking or naming behavior. The following table describes the LIBNAME options for SAS/ACCESS Interface to Oracle, with the applicable default values. For more detail about these options, see LIBNAME Options for Relational Databases.
Oracle LIBNAME Statement Examples |
In this first example, default settings are used for the connection options to make the connection. If you specify the appropriate system options or environment variables for Oracle, you can often omit the connection options from your LIBNAME statements. See your Oracle documentation for details.
libname myoralib oracle;
In the next example, the libref MYDBLIB uses SAS/ACCESS Interface to Oracle to connect to an Oracle database. The SAS/ACCESS connection options are USER=, PASSWORD=, and PATH=. PATH= specifies an alias for the database specification, which SQL*Net requires.
libname mydblib oracle user=testuser password=testpass path=hrdept_002; proc print data=mydblib.employees; where dept='CSR010'; run;
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.