SAS: How to copy a local sas table into oracle via SQL pass-through -


after making searches didn't lead useful me, ask question.

some background: create oracle table via 2 different methods in order compare performances. want copy table 1 of local sas libraries oracle.

i used first method (that works perfectly) libname oracle:

libname dblib oracle user=usr password="&dbpwd_sas" path="dm_ct_test" schema="sas";  proc sql noprint;   create table dblib.test_win7 select *     sashelp.cars     strip(upcase(make)) eq "acura"   ; quit;  libname dblib clear; 

but try use method via sql pass-through doesn't work:

proc sql noprint;   connect oracle (user=usr password="&dbpwd_sas" path="dm_ct_test");    execute (  create table sas.test_win7              select * sashelp.cars               strip(upcase(make)) eq "acura"           )  oracle;    disconnect oracle; quit; 

with method, sashelp.cars not found procedure.

so here question: possible copy local sas table oracle via sql pass-through? if yes, how proceed.

thank you

in sql passthrough, connected session cannot see sas libraries, unless separately connected through dbms-specific connection methods (unlikely). pass-through literally taking code , submitting execution on remote dbms, sas dumb terminal.

the way can access information sas in explicit pass-through transmit text in macro variable. such, can perform in queries putting list of values in macro variable , submitting it; cannot reference sas table directly. could pass contents of entire table in macro variable or set of macro variables , use insert statements include them, it's not idea; won't faster using libname connection , has lot more risk of error (and more work).

in instances, should use libname access when want see both sas , rdbms data @ same time. sas use implicit pass-through when can speed things when using libname access.

if you're trying use passthrough in order avoid sas having download data perform join, 1 thing can upload sas data global temporary table using libname access. can connect via passthrough , use temporary table. aware 2 connections separate, won't share non-global temporary tables. (i believe in newer versions have added feature make them share connections, couldn't find syntax , don't recall having success using myself.)


Comments