SAS/ACCESS for Oracle

Pass-Through Facility Specifics for Oracle

See Overview of the Pass-Through Facility for general information about this feature. Oracle examples are available.

The Pass-Through Facility specifics for Oracle are as follows:


Examples

The following example uses the alias DBCON for the DBMS connection (the connection alias is optional):

proc sql;
   connect to oracle as dbcon
       (user=testuser password=testpass buffsize=100 
        path='myorapath');
quit;

The following example connects to Oracle and sends it two EXECUTE statements to process.

proc sql;
   connect to oracle (user=testuser password=testpass);
   execute (create view whotookorders as
      select ordernum, takenby,  
             firstname, lastname, phone
         from orders, employees
         where orders.takenby=employees.empid)
      by oracle;
   execute (grant select on whotookorders 
            to testuser) by oracle;
   disconnect from oracle;
quit;

The following example performs a query, shown in highlighted text, on the Oracle table CUSTOMERS:

proc sql;    
connect to oracle (user=testuser password=testpass);    
select *       
   from connection to oracle          
     (select * from customers
      where customer like '1%');
    disconnect from oracle; 
quit;

In this example, the PRESERVE_COMMENTS argument is specified after the USER= and PASSWORD= arguments. The Oracle SQL query is enclosed in the required parentheses. The SQL INDX command identifies the index for the Oracle query optimizer to use in processing the query. Note that multiple hints are separated with blanks.

proc sql;    
connect to oracle as mycon(user=testuser
        password=testpass preserve_comments);    
select *       
   from connection to mycon
     (select /* +indx(empid) all_rows */
          count(*) from employees);
quit;

space
Previous Page | Next Page | Top of Page