Problem Note 63980: The error "Unable to execute query . . ." occurs in SAS® Studio after you try to sort a character column in the table viewer
When you use the table viewer in SAS Studio to open a SAS or database table, the following pop-up error message appears:
Unable to execute query: SQL passthru expression contained these errors:
NOTE: The query as specified involves ordering by an item that doesn’t appear in its SELECT clause.
This error occurs because the SQLIPONEATTEMPT system option is in effect. When you want to sort by a character column, a SQL procedure generates the view by using the SORTKEY function. However, the SQLIPONEATTEMPT option prevents this action from occurring.
A workaround is to use the NOSQLIPONEATTEMPT system option.
Click the Hot Fix tab in this note to access the hot fix for this issue.
After you apply the hot fix, you can set a new configuration property, webdms.useSortkeyFunction, to FALSE. This property prevents the SORTKEY function from being used with the ORDER BY clause in the generated PROC SQL code.
Operating System and Release Information
SAS System | SAS Studio | Microsoft® Windows® for x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows 8 Enterprise 32-bit | 3.71 | | 9.4 TS1M5 | |
Microsoft Windows 8 Enterprise x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows 8 Pro 32-bit | 3.71 | | 9.4 TS1M5 | |
Microsoft Windows 8 Pro x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows 8.1 Enterprise 32-bit | 3.71 | | 9.4 TS1M5 | |
Microsoft Windows 8.1 Enterprise x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows 8.1 Pro 32-bit | 3.71 | | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows 10 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2008 | 3.71 | | 9.4 TS1M5 | |
Microsoft Windows Server 2008 R2 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2008 for x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 Datacenter | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 R2 Datacenter | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 R2 Std | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 Std | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2016 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Windows 7 Enterprise 32 bit | 3.71 | | 9.4 TS1M5 | |
Windows 7 Enterprise x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Windows 7 Home Premium 32 bit | 3.71 | | 9.4 TS1M5 | |
Windows 7 Home Premium x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Windows 7 Professional 32 bit | 3.71 | | 9.4 TS1M5 | |
Windows 7 Professional x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Windows 7 Ultimate 32 bit | 3.71 | | 9.4 TS1M5 | |
Windows 7 Ultimate x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
64-bit Enabled AIX | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
64-bit Enabled Solaris | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
HP-UX IPF | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Linux for x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
Solaris for x64 | 3.71 | 5.2 | 9.4 TS1M5 | Viya |
*
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.
SAS Studio generates PROC SQL code with the SORTKEY function to sort a character column. If you use the SQLIPONEATTEMPT option, the error "...SQL passthru expression contained these errors: NOTE: The query as specified involves ordering by an item that doesn’t appear in its SELECT clause" appears.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2019-06-03 15:36:35 |
Date Created: | 2019-04-04 16:18:39 |