Archives of the TeradataForum
Message Posted: Sun, 20 Apr 2008 @ 20:03:26 GMT
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.
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,
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|