I have an Oracle table I would like to acces in SAS but using either the datastep or proc sql it returns the column headers but no rows of data. In SQL developer the same issue occurs, but I am able to resolve it by first running the SQL command below:
begin
apps.mo_global.set_policy_context('S',101);
end;
I have tried to run that exact SQL statement using the SQL pass-through facility as follows:
proc sql;
connect to oracle as ALIAS (user=username orapw=password path='path');
execute(begin
apps.mo_global.set_policy_context('S',org#);
end; ) by ALIAS;
disconnect from ALIAS;
quit;
The issue is that whenever I run this I get an error that the table or view does not exist. I do not know if there the problem is with my proc sql or if there is other code that is the SAS equivalent of the SQL command above. I have tried it in both SAS 9.3 and Enterprise Guide 5.1.
Any help would be greatly appreciated. Thank you.
Are you running the EXECUTE and the query in the same Oracle CONNECT step? If not, please try it.
Your set_policy_context code is different between the Oracle version and the SAS one. Is that correct or is it a typo?
Are you running the EXECUTE and the query in the same Oracle CONNECT step? If not, please try it.
Hi, this seemed to solve the problem. Running them in the same Oracle CONNECT step each time worked. Thank you for your help.
What you're trying to do should be possible.
As @SASKiwi already points out: Make sure that you run exactly the same code via Pass-through SQL than what you're using in SQL Developer (or the like).
Are you always using the same user and password?
Also make sure that once your first statement works that you issue your queries within the same session/connection.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.