BookmarkSubscribeRSS Feed
chittamsri1_gmail_com
Calcite | Level 5

What is the Code We Use to Connect to Oracle Database from SAS In Unix Environment & Windowing Environment

PLease give me the reply

* i have all the information in oracle database .I want to get that information from oracle database and i want to work in SAS ENVIRONMENT .Please tell me the code for this .

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You need to have the connection information, then you can either do it directly or through pass through:

Directly:

proc sql;

     connect to oracle (path=dddd user=aaa orapw=cccc);

     create table work.test as

     select * from connection to oracle (

          select...

           from...

          );

     disconnect from oracle;

quit;

Pass-through:

proc sql;

     connect to oracle (path=dddd user=aaa orapw=cccc);

     execute (drop table A_TABLE) by oracle;

     execute (commit) by oracle;

     disconnect from oracle;

quit;

LinusH
Tourmaline | Level 20

Just to be clear about the concepts. Both these examples are usually defined as Explicit SQL Pass-thru - you explicitly write native DBMS specific SQL.

You can use SAS programs to access a libref that points to DBMS schema. The part of the SAS logic that the SAS/ACCESS libname engine can transform to native DBMS SQL will be automatically sent to the DBMS for processing. This is true for both SAS SQL, PROC's and Data step, in the later mainly WHERE-clauses. This is known as Implicit SQL pass-thru.

Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 843 views
  • 0 likes
  • 3 in conversation