SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 61621: Performance issues or an ORA-01841 error might occur when querying a DBMS table

DetailsHotfixAboutRate It

In the following scenarios, you might encounter two issues, which are detailed in this note:

  • You install Hot Fix I22107 and HF I22132 [SAS® 9.3M2 (TS1M2)].
  • You install Hot Fix V01070 [SAS® 9.4M3 (TS1M3)].
  • You run SAS® 9.4M4 (TS1M4) without installing Hot Fix A3Z008.

Issue #1

A performance issue might occur if the following is true about your SQL procedure query: 

  • You are accessing database management system (DBMS) tables via a LIBNAME engine.
  • You include one of the following as part of a WHERE clause:
    • the between operator is used to compare a variable to two constant values
    • the <= and >= operators are used to compare a variable to two constant values
    • the < and > operators are used to compare a variable to two constant values

Issue #2

An Oracle error might occur if the following is true about your PROC SQL query:

  • You are accessing Oracle tables via a LIBNAME engine.
  • You include one of the following as part of a WHERE clause:
    • the between operator is used to compare a variable to two constant values
    • the <= and >= operators are used to compare a variable to two constant values
    • the < and > operators are used to compare a variable to two constant values
  • The table is partitioned by month on the date variable that is being referenced in the WHERE clause.

The Oracle error might look similar to the following:

ERROR: ORACLE prepare error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0.

These issues occur due to an OR condition that is being added to the query submitted to the database in order to support linguistic-sensitive environments. For more information, see SAS Note 54751, "The BETWEEN operator might re-order values, possibly leading to unexpected results in a linguistic-sensitive environment." 

The workaround for this issue depends on your PROC SQL query. A possible workaround is to specify the variable comparison using the DBCONDITION= data set option.

Click the Hot Fix tab in this note to access the hot fix for this issue.

The hot fix for this issue addresses queries that contain all of the following:

  • comparing a variable that is not a character
  • not including anything that is SAS specific
  • containing one of the following:
    • DISTINCT
    • ORDER BY
    • JOIN of 2 or more tables using the same libref
    • GROUP BY
    • set operator other than OUTER UNION
    • aggregate function
    • HAVING clause
    • WHERE clause containing a subquery that references a DBMS table using the same libref

For queries against non-character variables that were not addressed by this hot fix, see SAS Note 63630, "Performance issues or an ORA-01841 error might occur when you query a database management system (DBMS) table."



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASWindows Vista9.3_M29.3 TS1M2
Windows 7 Ultimate x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Ultimate 32 bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Professional x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Professional 32 bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Home Premium x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Home Premium 32 bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2012 R2 Std9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2012 R2 Datacenter9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2012 Datacenter9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2008 for x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2008 R29.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2003 Datacenter Edition9.3_M29.3 TS1M2
Microsoft Windows 8.1 Pro x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8.1 Pro 32-bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8.1 Enterprise x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8.1 Enterprise 32-bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8 Pro x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8 Pro 32-bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8 Enterprise x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows 8 Enterprise 32-bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft® Windows® for x649.3_M29.4_M59.3 TS1M29.4 TS1M5
z/OS 64-bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Enterprise x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows 7 Enterprise 32 bit9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows XP Professional9.3_M29.3 TS1M2
Microsoft Windows Server 2012 Std9.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 20089.3_M29.4_M59.3 TS1M29.4 TS1M5
Microsoft Windows Server 2003 for x649.3_M29.3 TS1M2
Microsoft Windows Server 2003 Standard Edition9.3_M29.3 TS1M2
Microsoft Windows Server 2003 Enterprise Edition9.3_M29.3 TS1M2
z/OS9.3_M29.4_M59.3 TS1M29.4 TS1M5
Windows Vista for x649.3_M29.3 TS1M2
64-bit Enabled AIX9.3_M29.4_M59.3 TS1M29.4 TS1M5
64-bit Enabled HP-UX9.3_M29.4_M59.3 TS1M29.4 TS1M5
64-bit Enabled Solaris9.3_M29.4_M59.3 TS1M29.4 TS1M5
HP-UX IPF9.3_M29.4_M59.3 TS1M29.4 TS1M5
Linux9.3_M29.4_M59.3 TS1M29.4 TS1M5
Linux for x649.3_M29.4_M59.3 TS1M29.4 TS1M5
Solaris for x649.3_M29.4_M59.3 TS1M29.4 TS1M5
* 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.