Problem Note 62364: You receive an empty result set after you query a SAS® table or SAS view that is created from a DBMS table
You receive an empty result set after you query a SAS table or SAS view that was created from a database management system (DBMS) table.
The code example here for the query uses Oracle as the DBMS, but the code also applies to other DBMS systems.
proc sql;
connect to oracle (user=user-name password=password path='path-to-Oracle');
create view vdbms as select * from connection to oracle(
select *
from class
);
disconnect from oracle;
quit;
proc sql;
create table test1 as select name from vdbms
where sex in ('F');
quit;
After you run this code, you might see an error similar to the following in the SAS log:
NOTE: Table WORK.TEST1 created, with 0 rows and 1 columns.
For this particular example, nine rows should have been returned, but no rows were generated.
This error happens under the following conditions:
- The SAS table or view is created from a DBMS table, using an explicit Structured Query Language (SQL) pass-through facility.
- A column that is listed in the WHERE clause is not listed in the SELECT statement.
To work around this issue, any column that is named in the WHERE clause must be included in the SELECT statement, as shown in this example:
proc sql;
create table test2 as select name, sex from vdbms
where sex in ('F');
quit;
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 10 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2008 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2008 R2 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows Server 2012 Std | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Enterprise 32 bit | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Enterprise x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Home Premium 32 bit | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Home Premium x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Professional 32 bit | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Professional x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Ultimate 32 bit | 9.4 TS1M4 | 9.4 TS1M4 |
Windows 7 Ultimate x64 | 9.4 TS1M4 | 9.4 TS1M4 |
64-bit Enabled AIX | 9.4 TS1M4 | 9.4 TS1M4 |
64-bit Enabled Solaris | 9.4 TS1M4 | 9.4 TS1M4 |
HP-UX IPF | 9.4 TS1M4 | 9.4 TS1M4 |
Linux for x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Solaris for x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8 Pro x64 | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M4 | 9.4 TS1M4 |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M4 | 9.4 TS1M4 |
*
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.
An empty result set is returned after you query a SAS table or SAS view that is created from a database management system (DBMS) table.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2018-07-24 10:33:38 |
Date Created: | 2018-05-24 09:11:04 |