1
votes

I am trying to connect to the Oracle database and facing a problem at the select statement of Sql in SAS here is the code I wrote.

libname oral oracle path='jumbo' schema='AAA';
proc sql;
connect using oral;
create table ght as 
select * from connection to oral
(select * from  bo_gut);
disconnect from oral;
quit;

and now I am getting an error saying

ERROR: ORACLE prepare error:ORA-00942:table or view does not exist

what can be the problem, the the schema that I am using has this table "bo_gut" but still not able to create a new table from it.

2

2 Answers

1
votes

Just use your library (and this will query faster if the table is large).

libname oral oracle path='jumbo' schema='AAA';
proc sql;
create table ght as
select * from oral.bo_gut;
quit;

If you still get that error, then make sure the table actually exists and SAS can see it.

This will print everything SAS can see in a library to the LOG.

proc datasets lib=oral memtype=all;
quit;

If you cannot see the table, then check your Oracle permissions.

0
votes

How do you find out the name of your schema? Are you shure that it is 'AAA'?

Name of SAS library usually is not the same as Oracle schema. You can find out right name of you schema (in SAS Enterprise Guide) if you right click on your library, click on "Properties" and look at "Options".