Usage Note 15721: Find the list of tables, list of columns, and column attributes from the database using the ODBC engine and PROC SQL Pass-Through
You can use an ODBC query of ODBC::SQLTables to get a list of tables, and the query ODBC::SQLColumns to get the column information from a specific table from the ODBC data source.
In the following example, data set LIST1 contains a list of all the tables in the ODBC data source, data set LIST2 is the column information from the table DEPT and data set LIST3 is the information about just one column, DNAME.
proc sql;
connect to odbc(dsn=odbc_data_source_name uid=user_ID pwd=XXXXX);
create table list1
as
select * from connection to odbc(ODBC::SQLTables);
create table list2
as
select * from connection to odbc(ODBC::SQLColumns,,"DEPT",);
create table list3
as
select * from connection to odbc(ODBC::SQLColumns,,"DEPT","DNAME");
quit;
Operating System and Release Information
SAS System | SAS/ACCESS Interface to ODBC | Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |
Windows Vista | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |
Microsoft® Windows® for x64 | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |
Linux on Itanium | 9.1 TS1M3 SP4 | |
HP-UX IPF | 9.1 TS1M3 SP4 | |
64-bit Enabled AIX | 9.1 TS1M3 SP4 | |
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |
Linux | 9.1 TS1M3 SP4 | |
Tru64 UNIX | 9.1 TS1M3 SP4 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Date Modified: | 2021-08-27 09:47:11 |
Date Created: | 2005-07-08 00:00:00 |