Problem Note 46781: Implicit pass-through processing generates incorrect code when you use the INNER JOIN syntax
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:
from
rudwh.int_crd_portfolio_snapshot_c ic
,rudwh.int_crd_portfolio_snapshot_c icsn
where ic.crd_acct_nbr = icsn.crd_acct_nbr
and
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
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 | |
*
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.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2012-06-28 11:14:47 |
Date Created: | 2012-06-12 10:39:59 |