SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 62565: You receive "ERROR: ORACLE prepare error: ORA-00907: missing right parenthesis. . ." after you use PROC SQL to join a SAS table to an Oracle table

DetailsHotfixAboutRate It

In SAS/ACCESS® Interface to Oracle, PROC SQL might generate an error that is similar to the following:

ERROR: ORACLE prepare error: ORA-00907: missing right parenthesis. SQL
       statement: SELECT  "Oracle-date" FROM Oracle-table WHERE  ( ("Oracle-date"  IN
        (TO_DATE('25MAY2018:00:00:00','DDMONYYYY:HH24:MI:SS','NLS_DATE_LANGUAGE=American')
       ,(TO_DATE('26MAY2018:00:00:00','DDMONYYYY:HH24:MI:SS','NLS_DATE_LANGUAGE=American')
       ,(TO_DATE('27MAY2018:00:00:00','DDMONYYYY:HH24:MI:SS','NLS_DATE_LANGUAGE=American')
... repeated for each date in the SAS table ...
       ,(TO_DATE('29MAY2018:00:00:00','DDMONYYYY:HH24:MI:SS','NLS_DATE_LANGUAGE=American')
       ,(TO_DATE('18FEB2021:00:00:00','DDMONYYYY:HH24:MI:SS','NLS_DATE_LANGUAGE=American')
       OR  ("Oracle-date" IN  ( ) ) ).
ORACLE:  *-*-*-*-*-*-* ROLLBACK *-*-*-*-*-*-*

The error can occur when all of the following conditions are true:

  • You use the Oracle LIBNAME option MULTI_DATASRC_OPT=IN_CLAUSE.
  • You use PROC SQL to join a SAS table to an Oracle table.
  • The join criteria match a SAS column to an Oracle DATE column.
  • The SAS table has more than 1,000 rows.

The following example code can create the error:

libname dbms oracle path=Oracle-path user=user-id password=password multi_datasrc_opt=in_clause ;
proc sql ;
   select SAS-column
         ,Oracle-date
        from SAS-table 
       inner join dbms.Oracle-table on SAS-table.SAS-column = Oracle-table.Oracle-date ;
quit ;

You can work around this issue by removing MULTI_DATASRC_OPT=IN_CLAUSE (highlighted above) from the LIBNAME statement to Oracle.

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



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASz/OS9.49.4_M69.4 TS1M09.4 TS1M6
z/OS 64-bit9.49.4_M69.4 TS1M09.4 TS1M6
Microsoft® Windows® for x649.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 8 Enterprise x649.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 8 Pro x649.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 8.1 Enterprise 32-bit9.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 8.1 Enterprise x649.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 8.1 Pro 32-bit9.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 8.1 Pro x649.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows 109.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows Server 2008 R29.49.4 TS1M0
Microsoft Windows Server 2008 for x649.49.4 TS1M0
Microsoft Windows Server 2012 Datacenter9.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows Server 2012 R2 Datacenter9.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows Server 2012 R2 Std9.49.4_M69.4 TS1M09.4 TS1M6
Microsoft Windows Server 2012 Std9.49.4_M69.4 TS1M09.4 TS1M6
Windows 7 Enterprise x649.49.4_M69.4 TS1M09.4 TS1M6
Windows 7 Professional x649.49.4_M69.4 TS1M09.4 TS1M6
64-bit Enabled AIX9.49.4_M69.4 TS1M09.4 TS1M6
64-bit Enabled Solaris9.49.4_M69.4 TS1M09.4 TS1M6
HP-UX IPF9.49.4_M69.4 TS1M09.4 TS1M6
Linux for x649.49.4_M69.4 TS1M09.4 TS1M6
Solaris for x649.49.4_M69.4 TS1M09.4 TS1M6
* 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.