A SERVICE OF

logo

The Pass-Through Facility for Relational Databases CONNECTION TO Component 237
virtual table for the PROC SQL FROM clause. In this example, MYCON is a connection
alias.
proc sql;
connect to oracle as mycon (user=testuser
password=testpass path=’myorapath’);
%put &sqlxmsg;
select *
from connection to mycon
(select empid, lastname, firstname,
hiredate, salary
from employees where
hiredate>=’31-DEC-88’);
%put &sqlxmsg;
disconnect from mycon;
quit;
The SAS %PUT macro displays the &SQLXMSG macro variable for error codes and
information from the DBMS. See “Macro Variables for Relational Databases” on page
219 for more information.
The following example gives the query a name and stores it as the PROC SQL view
samples.HIRES88:
libname samples ’SAS-data-library’;
proc sql;
connect to oracle as mycon (user=testuser
password=testpass path=’myorapath’);
%put &sqlxmsg;
create view samples.hires88 as
select *
from connection to mycon
(select empid, lastname, firstname,
hiredate, salary
from employees where
hiredate>=’31-DEC-88’);
%put &sqlxmsg;
disconnect from mycon;
quit;