![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/b/da/bda6fccb-b246-43e7-a520-a01ed647b8cf/bda6fccb-b246-43e7-a520-a01ed647b8cf-bgf7.png)
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;