DATA Step, Macro, Functions and more

Oracle Library - Table Contents

Reply
Contributor
Posts: 63

Oracle Library - Table Contents

Code below gives me table information except for number of physical observations for all the tables in Justice Oracle library.

How can I get list of library name, member name and no. of records in each table?


LIBNAME justice ORACLE
PATH=Total.world
SCHEMA=usa
USER=xxxxx
PASSWORD="xxxxxxx"
READBUFF=1
;

Proc Sql ;
create table test1 as
select libname, memname, nobs
from dictionary.tables
where libname='JUSTICE' ;
quit ;
SAS Employee
Posts: 104

Re: Oracle Library - Table Contents

You will probably need to get this with explicit pass-through SQL. Something like this ought to do it:
proc sql;
connect to oracle (path=Total.world user=xxxx password=xxxx);
select * from connection to oracle
(SELECT owner, table_name, num_rows
FROM ALL_TABLES
WHERE OWNER='USA' )
;
disconnect from oracle;
quit;
Ask a Question
Discussion stats
  • 1 reply
  • 328 views
  • 0 likes
  • 2 in conversation