使用SAS V 9.xxx。
如何将数据从通用工作库中的表传递到Netezza中的表。
现在,我可以从Netezza中提取数据并存储在工作库中,例如:
/* using “connect to” */
proc sql;
connect to netezza (&us_mkt.);
execute (
drop table &tempdir..SALES_TBL_TST1;
create table &tempdir..SALES_TBL_TST1
as
select * from &tempdir..SALES_TBL;
/*select * from &tempdir..SALES_TBL */
) by netezza;
disconnect from netezza;
quit;
/* using “connect using” */
proc sql;
connect using ROLAP;
drop table WORK.SALES_TBL_TST2;
create table WORK.SALES_TBL_TST2 AS
select * from connection to ROLAP
(select * from USER_ROLAP.SALES_TBL);
insert into WORK.SALES_TBL_TST2
select * from connection to ROLAP
(select * from &tempdir..SALES_TBL);
quit;但是,如果我想将工作库中的数据放回Netezza中,该怎么办?举个例子:
insert into &tempdir..SALES_TBL_TST1
select * from WORK.SALES_TBL_TST2;有什么方法可以做到这一点吗?
提前感谢!
发布于 2018-10-24 04:40:34
您可以使用libname语句来移动数据。需要批量加载(批量加载数据,速度更快),以便快速传输记录。一旦定义了库名称。可以通过proc sql、datastep或proc append将数据从工作位置移动到Netezza。移动数据代码类似于在两个SAS库之间移动数据(语法方面)。
下面是从http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003181092.htm复制的代码
libname sasflt 'SAS-data-library';
libname net_air netezza user=louis pwd=fromage
server=air2 database=flights;由Proc sql提供的示例
proc sql;
create table net_air.flights98
(bulkload=YES bl_options='logdir "c:\temp\netlogs"')
as select * from sasflt.flt98;
quit;https://stackoverflow.com/questions/52956740
复制相似问题