SQl PAssthrough in SAS

Are there any advantages to using SQL Passthrough with SAS?

+3
source share
5 answers

Although this question is too broad, I can give too broad an answer.

Pass-through SQL in SAS allows you to directly contact the database. This becomes very beneficial when you use database-specific functions. An example is the statistics function of Oracle. You do not need to worry about how SAS will handle your coding or translate your SQL.

, , Pass-through SQL SAS. SAS, . Pass-through SQL, .

, SQL. , .

+4

PROC SQL , , . SAS, ( SAS/ACCESS ), . , SAS . SQL, , SAS. , , .

libname db <database> path=dbserver user=... password=...;
proc sql;
   create table db.new as
   select * from db.largedata where flag=1;
quit;

( , SAS 9.1.3) , = 1, SAS, . , .

.

proc sql;
   connect dbase (server=dbserver user=... password=...);
   execute (create table db.new as
   select * from db.largedata where flag=1) as dbase;
   disconnect dbase;
quit;

Oracle 250 000 . 20 , - 2 .

+4

, ( ) sas. , sas. ( ) , , , .

+2

, , . , proc sql . .

proc sql;
    connect to mysql(user = 'xxxxx' pass = 'xxxxx' server = 'localhost');
        execute(set @id = &id.) by mysql;
        execute(select (@lit:=image_text) from quality.links_image_text where image_id = @id) by mysql;
        execute(set @lidx = locate('ninja',@lit)) by mysql;
        execute(set @lidx2 = locate(' ',@lit,@lidx)) by mysql;
        execute(set @lidxd = @lidx2 - @lidx) by mysql;
        execute(set @lf = substr(@lit,@lidx,@lidxd)) by mysql;

        create table asdf as
        select &id. as id, a as ws from connection to mysql
        (select @lf as a)
        ;
    disconnect from mysql;
quit;

Clearly, this is not something that can be done outside of transit (at least not what I know). So yes ... it all depends on what you are trying to accomplish.

+2
source

Simply put, SQL-end-to-end instructions give you more control over what is sent to the database.

0
source

Source: https://habr.com/ru/post/1704559/


All Articles