SUPPORT / SAMPLES & SAS NOTES
 

Support

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

DetailsHotfixAboutRate It

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

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASMicrosoft® Windows® for x649.4 TS1M49.4 TS1M4
Microsoft Windows 8.1 Pro 32-bit9.4 TS1M49.4 TS1M4
Microsoft Windows 8.1 Pro x649.4 TS1M49.4 TS1M4
Microsoft Windows 109.4 TS1M49.4 TS1M4
Microsoft Windows Server 20089.4 TS1M49.4 TS1M4
Microsoft Windows Server 2008 R29.4 TS1M49.4 TS1M4
Microsoft Windows Server 2008 for x649.4 TS1M49.4 TS1M4
Microsoft Windows Server 2012 Datacenter9.4 TS1M49.4 TS1M4
Microsoft Windows Server 2012 R2 Datacenter9.4 TS1M49.4 TS1M4
Microsoft Windows Server 2012 R2 Std9.4 TS1M49.4 TS1M4
Microsoft Windows Server 2012 Std9.4 TS1M49.4 TS1M4
Windows 7 Enterprise 32 bit9.4 TS1M49.4 TS1M4
Windows 7 Enterprise x649.4 TS1M49.4 TS1M4
Windows 7 Home Premium 32 bit9.4 TS1M49.4 TS1M4
Windows 7 Home Premium x649.4 TS1M49.4 TS1M4
Windows 7 Professional 32 bit9.4 TS1M49.4 TS1M4
Windows 7 Professional x649.4 TS1M49.4 TS1M4
Windows 7 Ultimate 32 bit9.4 TS1M49.4 TS1M4
Windows 7 Ultimate x649.4 TS1M49.4 TS1M4
64-bit Enabled AIX9.4 TS1M49.4 TS1M4
64-bit Enabled Solaris9.4 TS1M49.4 TS1M4
HP-UX IPF9.4 TS1M49.4 TS1M4
Linux for x649.4 TS1M49.4 TS1M4
Solaris for x649.4 TS1M49.4 TS1M4
Microsoft Windows 8 Enterprise 32-bit9.4 TS1M49.4 TS1M4
Microsoft Windows 8 Enterprise x649.4 TS1M49.4 TS1M4
Microsoft Windows 8 Pro 32-bit9.4 TS1M49.4 TS1M4
Microsoft Windows 8 Pro x649.4 TS1M49.4 TS1M4
Microsoft Windows 8.1 Enterprise 32-bit9.4 TS1M49.4 TS1M4
Microsoft Windows 8.1 Enterprise x649.4 TS1M49.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.