Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 20 Apr 2008 @ 20:03:26 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Cross join in update statement
 
From:   Michael Larkins

Kishore:

I think the error is saying that the UPDATE does not support the newer JOIN syntax like a SELECT. Besides even if it did, you should not reference the CATALOG_ITEM table again in the FROM since it is already identified in the UPDATE. Even if the UPDATE did support this syntax, your WHERE may end up making this a merge join instead of a product join anyway (WHERE CATALOG_ITEM.NATIVE_PK = inSKU_ID). You could try it in a SELECT via an EXPLAIN to know for sure.

Try this:

     UPDATE CATALOG_ITEM FROM FORECAST_PLAN FP
        SET CURRENT_PERIOD_ID = FP.IMPORT_PERIOD_ID,
            CURRENT_EFFECTIVE_PERIOD_ID = FP.IMPORT_PERIOD_ID
        WHERE CATALOG_ITEM.NATIVE_PK = inSKU_ID;

As long as the catalog item and the forecast are a 1:1 ratio, it should work. It however will not work with a 1:Many.


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023