![]() | ![]() | ![]() | ![]() | ![]() |
Implicit pass-through processing generates incorrect code when you use the INNER JOIN syntax. However, it will generate correct code when you use the ON clause as part of the WHERE clause and use a comma to separate the INNER JOINS.
When you run the following SQL procedure (PROC) statement using implicit pass-through to Teradata, the error shown below the example occurs:
select ic.crd_acct_nbr, ic.mis_dt, ic.blng_cyc_dt, ic.anr_prev_lcyamt, icsn.anr_prev_lcyamt as prev_prev_value from rudwh.int_crd_portfolio_snapshot_c ic inner join rudwh.int_crd_portfolio_snapshot_c icsn on ic.crd_acct_nbr = icsn.crd_acct_nbr /*end of inner join*/ where ic.mis_dt = (select max(mis_dt) from rudwh.int_crd_portfolio_snapshot_c ) and icsn.mis_dt = (select max(mis_dt) from rudwh.int_crd_portfolio_snapshot_c where mis_dt < ic.mis_dt and crd_acct_nbr = ic.crd_acct_nbr) and ic.anr_prev_lcyamt <> icsn.anr_prev_lcyamt;
ERROR: Teradata prepare: Syntax error: expected something between the 'select' keyword and the 'from' keyword.
When the SQL statement is prepared to be sent to Teradata, the SQL statement generated from implicit pass-through is incorrect and results in a syntax error even though the PROC SQL code is valid and works in explicit pass-through.
Rewriting the query's FROM clause with a comma and including the ON clause at the beginning of the WHERE allows the query to be executed successfully in the database. This should achieve the same result without using the INNER JOIN statement:
Click the Hot Fix tab in this note to access the hot fix for this issue.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | Aster Data nCluster on Linux x64 | 9.3 TS1M0 | |
DB2 Universal Database on AIX | 9.3 TS1M0 | |||
DB2 Universal Database on Linux x64 | 9.3 TS1M0 | |||
Greenplum on Linux x64 | 9.3 TS1M0 | |||
Netezza TwinFin 32bit blade | 9.3 TS1M0 | |||
Netezza TwinFin 32-bit SMP Hosts | 9.3 TS1M0 | |||
Netezza TwinFin 64-bit S-Blades | 9.3 TS1M0 | |||
Netezza TwinFin 64-bit SMP Hosts | 9.3 TS1M0 | |||
Teradata on Linux | 9.3 TS1M0 | |||
z/OS | 9.3 TS1M0 | |||
Z64 | 9.3 TS1M0 | |||
Microsoft® Windows® for x64 | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.3 TS1M0 | |||
Microsoft Windows Server 2003 for x64 | 9.3 TS1M0 | |||
Microsoft Windows Server 2008 | 9.3 TS1M0 | |||
Microsoft Windows Server 2008 for x64 | 9.3 TS1M0 | |||
Microsoft Windows XP Professional | 9.3 TS1M0 | |||
Windows 7 Enterprise 32 bit | 9.3 TS1M0 | |||
Windows 7 Enterprise x64 | 9.3 TS1M0 | |||
Windows 7 Home Premium 32 bit | 9.3 TS1M0 | |||
Windows 7 Home Premium x64 | 9.3 TS1M0 | |||
Windows 7 Professional 32 bit | 9.3 TS1M0 | |||
Windows 7 Professional x64 | 9.3 TS1M0 | |||
Windows 7 Ultimate 32 bit | 9.3 TS1M0 | |||
Windows 7 Ultimate x64 | 9.3 TS1M0 | |||
Windows Vista | 9.3 TS1M0 | |||
Windows Vista for x64 | 9.3 TS1M0 | |||
64-bit Enabled AIX | 9.3 TS1M0 | |||
64-bit Enabled HP-UX | 9.3 TS1M0 | |||
64-bit Enabled Solaris | 9.3 TS1M0 | |||
HP-UX IPF | 9.3 TS1M0 | |||
Linux | 9.3 TS1M0 | |||
Linux for x64 | 9.3 TS1M0 | |||
Solaris for x64 | 9.3 TS1M0 |