我有一个逻辑库是用libname的OLEDB方法连接的服务器上的数据库
我想定期利用在SAS里计算得到的表格更新该逻辑库里的表
我知道可以用data步里的update,发现这只能应用于SAS自创的逻辑库中的表,比如
data source;
input key $ value;
datalines;
a 13
b 23
c 83
;
run;
data new;
input key $ value;
datalines;
c 56
d 13
e 87
;
run;
proc sql noprint;
update source
set new;
quit;
上述代码在SAS中是可以运行的
但如果把Source表放在保存在服务器上的那个逻辑库里,则无法运行,出如下的错误
ERROR: The OLEDB table source has been opened for OUTPUT. This table already exists, or
there is a name conflict with an existing object. This table will not be replaced. This
engine does not support the REPLACE option.
我在网上查了下,在下面的文章里大概明白了点
support.sas.com/resources/papers/proceedings09/141-2009.pdf
里面提到的方法就是删了旧表,再复制新表
只不过我的Source表是个大表,定期更新一条数据而已,我觉得这样会很耽误时间
不知道有其他好办法没有,谢谢!