全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2619 4
2013-07-16
我有一个逻辑库是用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表是个大表,定期更新一条数据而已,我觉得这样会很耽误时间
不知道有其他好办法没有,谢谢!


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-7-16 21:21:36
(1) upload dataset new into database as a temporary table
(2) issue a pass-through query to update the DB table.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-7-18 08:49:09
邓贵大 发表于 2013-7-16 21:21
(1) upload dataset new into database as a temporary table
(2) issue a pass-through query to update  ...
大侠能把第2条展开说下吗?
没看明白
谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-7-18 20:54:35
in case of SQL Server,
复制代码
Other DBMSs are similar.
In case of MS Access, you can use regular tables instead of temporary tables because you own the database exclusively. And the update statement will be like
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-7-26 14:12:59
学习
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群