These assumptions apply
to the examples in this section.
-
The DeptInfo table already exists
on the DBMS that contains all of your department information.
-
One SAS data set contains join
criteria that you want to use to extract specific rows from the DeptInfo
table.
-
Another SAS data set contains updates
to the DeptInfo table.
Examples use these librefs
and temporary tables.
libname saslib base 'SAS-library';
libname dept netezza server=nps1 database=test
user=myuser pwd=mypwd connection=global;
libname temp netezza server=nps1 database=test
user=myuser pwd=mypwd connection=global;
proc sql;
connect to netezza (server=nps1 database=test
user=myuser pwd=mypwd connection=global);
execute (create temporary table temptab1 (dname char(20),
deptno int)) by netezza;
quit;
This example shows how
to use a heterogeneous join with a temporary table to perform 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 netezza (server=nps1 database=test
user=myuser pwd=mypwd connection=global);
insert into temp.temptab1 select * from saslib.joindata;
select * from dept.deptinfo info, temp.temptab1 tab
where info.deptno = tab.deptno;
/* remove the rows for the next example */
execute (delete from temptab1) by netezza;
quit;
In this example, transaction
processing on the DBMS occurs by using a temporary table instead of
using either DBKEY= or MULTI_DATASRC_OPT=IN_CLAUSE with a SAS data
set as the transaction table.
proc sql;
connect to netezza (server=nps1 database=test
user=myuser pwd=mypwd connection=global);
insert into temp.temptab1 select * from saslib.transdat;
execute (update deptinfo d set dname = (select dname from temptab1)
where d.deptno = (select deptno from temptab1)) by netezza;
quit;