Help using Base SAS procedures

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

Reply
Occasional Contributor
Posts: 12

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

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 .

Super User
Posts: 5,257

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

Super User
Super User
Posts: 7,401

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

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;

Super User
Posts: 5,257

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

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
Occasional Contributor
Posts: 12

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

thank you for your answers

Ask a Question
Discussion stats
  • 4 replies
  • 282 views
  • 0 likes
  • 3 in conversation