SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 46781: Implicit pass-through processing generates incorrect code when you use the INNER JOIN syntax

DetailsHotfixAboutRate It

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

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASAster Data nCluster on Linux x649.3 TS1M0
DB2 Universal Database on AIX9.3 TS1M0
DB2 Universal Database on Linux x649.3 TS1M0
Greenplum on Linux x649.3 TS1M0
Netezza TwinFin 32bit blade9.3 TS1M0
Netezza TwinFin 32-bit SMP Hosts9.3 TS1M0
Netezza TwinFin 64-bit S-Blades9.3 TS1M0
Netezza TwinFin 64-bit SMP Hosts9.3 TS1M0
Teradata on Linux9.3 TS1M0
z/OS9.3 TS1M0
Z649.3 TS1M0
Microsoft® Windows® for x649.3 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.3 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.3 TS1M0
Microsoft Windows Server 2003 Standard Edition9.3 TS1M0
Microsoft Windows Server 2003 for x649.3 TS1M0
Microsoft Windows Server 20089.3 TS1M0
Microsoft Windows Server 2008 for x649.3 TS1M0
Microsoft Windows XP Professional9.3 TS1M0
Windows 7 Enterprise 32 bit9.3 TS1M0
Windows 7 Enterprise x649.3 TS1M0
Windows 7 Home Premium 32 bit9.3 TS1M0
Windows 7 Home Premium x649.3 TS1M0
Windows 7 Professional 32 bit9.3 TS1M0
Windows 7 Professional x649.3 TS1M0
Windows 7 Ultimate 32 bit9.3 TS1M0
Windows 7 Ultimate x649.3 TS1M0
Windows Vista9.3 TS1M0
Windows Vista for x649.3 TS1M0
64-bit Enabled AIX9.3 TS1M0
64-bit Enabled HP-UX9.3 TS1M0
64-bit Enabled Solaris9.3 TS1M0
HP-UX IPF9.3 TS1M0
Linux9.3 TS1M0
Linux for x649.3 TS1M0
Solaris for x649.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.