These assumptions apply
to the examples in this section.
-
The DeptInfo table already exists
on the DBMS that contains all your department information.
-
One SAS data set contains join
criteria that you want to use to extract specific rows from the DeptInfo
table.
-
The other SAS data set contains
updates to the DeptInfo table.
These examples use these
librefs and temporary tables.
libname saslib base 'SAS-library';
libname dept neoview dsn=Users_DataSource
user=myuser pwd=mypwd connection=global;
proc sql;
connect to neoview (dsn=Users_DataSource
user=myuser pwd=mypwd connection=global);
execute (create volatile table temptab1
(dname char(20), deptno int)) by neoview;
quit;
This first example shows
how to use a heterogeneous join with a temporary table. It performs
a homogeneous join on the DBMS instead of reading the DBMS table into
SAS to perform the join. By using the table that was created previously,
you can copy SAS data into the temporary table to perform the join.
proc sql;
connect to neoview (dsn=Users_DataSource
user=myuser pwd=mypwd connection=global);
insert into dept.temptab1 select * from saslib.joindata;
select * from dept.deptinfo info, dept.temptab1 tab
where info.deptno = tab.deptno;
/* remove the rows for the next example */
execute (delete from temptab1) by neoview;
quit;
In this example, transaction
processing on the DBMS occurs by using a temporary table instead of
either DBKEY= or MULTI_DATASRC_OPT=IN_CLAUSE with a SAS data set as
the transaction table.
proc sql;
connect to neoview (dsn=Users_DataSource
user=myuser pwd=mypwd connection=global);
insert into dept.temptab1 select * from saslib.transdat;
execute (update deptinfo d set dname = (select dname from temptab1)
where d.deptno = (select deptno from temptab1)) by neoview;
quit;