SAS SQL 直通 [英] SAS SQL Pass Through

查看:61
本文介绍了SAS SQL 直通的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在此代码中的 SAS SQL 传递中首先执行的是什么:

I would like to know what gets executed first in the SAS SQL pass thru in this code:

Connect To OLEDB As MYDB ( %DBConnect( Catalog = MYDB ) ) ;

 Create table MYDB_extract as
   select put(Parent,$ABC.) as PARENT,
          put(PFX,z2.) as PFX,* 
    From Connection To MYDB
     ( SELECT
           Appointment,Parents,Children,Cats,Dogs 
       FROM MYDB.dbo.FlatRecord
        WHERE Appointment between '20150801' and '20150831' 
           And Children > 2);
Disconnect from MYDB;

由于 MS SQL-Server 不支持 PUT 函数,这个查询会导致所有记录在本地处理还是只从 DBMS 得到结果记录?

Since MS SQL-Server doesn't support the PUT function will this query cause ALL of the records to be processed locally or only the resultant records from the DBMS?

推荐答案

首先内联视图中的代码会在服务器上执行:

First the code in the inline view will be executed on the server:

SELECT Appointment,Parents,Children,Cats,Dogs 
FROM   MYDB.dbo.FlatRecord
WHERE  Appointment between '20150801' and '20150831' And Children > 2 

满足 WHERE 子句的行将由 DBMS 通过 OLDEB 连接返回给 SAS.

Rows that meet that WHERE clause will be returned by the DBMS to SAS over the OLDEB connection.

然后 SAS 将(尝试并)从该结果集中选择,应用任何其他代码,包括 put 函数.

Then SAS will (try and) select from that result set, applying any other code, including the put functions.

这与内联视图在任何其他 DBMS 中的工作方式并没有什么不同,只是这里有两个不同的数据库引擎,一个运行内部查询,而 SAS 运行外部查询.

This isn't really any different from how an inline view works in any other DBMS, except that here you have two different database engines, one running the inner query and SAS running the outer query.

这篇关于SAS SQL 直通的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆