Hi TDP world, new user to TDP and trying to leverage the automation for some scripts. I have some existing SQLs that process fine when manually run, but they are erroring out when I try to run them through the automation / scheduler.
Any help would be much appreciated on the error, but it appears to me it does not like the temporary table in the last pass.
Exception Messages:
File_1 - ERROR: relation does not exist ODS_LIVE.AGENT.PO_SKU_FORECAST
ERROR: relation does not exist ODS_LIVE.AGENT.PO_SKU_FORECAST
Settings:
SQL (only portion related to error):
create temp table PO_SKU_FORECAST as
(SELECT MIN(C2.DATECODE)WEEK_STARTING,
DIV_NO ,DIV_NAME ,DEPT_NO ,CLASS_NO ,VENDOR_NO ,VENDOR_NAME ,FACTORY_NO ,FACTORY_NAME ,FOB ,SHIP_TO,PO_NO ,
REVISION_NO ,ORDER_DATE ,ORIG_START_SHIP_DATE ,SHIP_DATE ,ORIGINAL_CANCEL_DATE ,CANCEL_DATE ,ORIGINAL_ANTICIPATE_DATE ,
ANTICIPATE_DATE ,STYLE_NO ,STYLE_DESC ,SKU_NO ,SKU_DESC ,QTY_PLANNED ,TOTAL_COST ,TOTAL_RETAIL ,USED_REVISED_DATE ,
STYLE_LENGTH ,STYLE_WIDTH ,STYLE_HEIGHT ,STYLE_MASTERPACK_QTY,
TTL_SKU_CBMS,CONTAINERS_40_FT, SOURCE
FROM ALL_ITEMS_WITH_CBMS IT
JOIN RIQ_BIS_AC_LIVE..LU_FISCAL_CALENDAR_DATE cal
ON (IT.SHIP_DATE=CAL.DATECODE)
JOIN RIQ_BIS_AC_LIVE..LU_FISCAL_CALENDAR_DATE c2
ON (C2.WEEK_ID=CAL.WEEK_ID)
GROUP BY DIV_NO ,DIV_NAME ,DEPT_NO ,CLASS_NO ,VENDOR_NO ,VENDOR_NAME ,FACTORY_NO ,FACTORY_NAME ,FOB ,SHIP_TO,PO_NO ,
REVISION_NO ,ORDER_DATE ,ORIG_START_SHIP_DATE ,SHIP_DATE ,ORIGINAL_CANCEL_DATE ,CANCEL_DATE ,ORIGINAL_ANTICIPATE_DATE ,
ANTICIPATE_DATE ,STYLE_NO ,STYLE_DESC ,SKU_NO ,SKU_DESC ,QTY_PLANNED ,TOTAL_COST ,TOTAL_RETAIL ,USED_REVISED_DATE ,
STYLE_LENGTH ,STYLE_WIDTH ,STYLE_HEIGHT ,STYLE_MASTERPACK_QTY,
TTL_SKU_CBMS,CONTAINERS_40_FT, SOURCE
ORDER BY SOURCE) ;
SELECT *
FROM (
SELECT WEEK_STARTING,
DIV_NO ,DIV_NAME ,DEPT_NO ,CLASS_NO ,VENDOR_NO ,VENDOR_NAME ,FACTORY_NO ,FACTORY_NAME ,FOB ,SHIP_TO,PO_NO ,
REVISION_NO ,ORDER_DATE ,ORIG_START_SHIP_DATE ,SHIP_DATE ,ORIGINAL_CANCEL_DATE ,CANCEL_DATE ,ORIGINAL_ANTICIPATE_DATE ,
ANTICIPATE_DATE ,STYLE_NO ,STYLE_DESC , SUM(TOTAL_COST)TOTAL_COST ,SUM(TOTAL_RETAIL)TOTAL_RETAIL ,USED_REVISED_DATE ,
STYLE_LENGTH ,STYLE_WIDTH ,STYLE_HEIGHT ,STYLE_MASTERPACK_QTY,
SUM(TTL_SKU_CBMS)TTL_SKU_CBMS,SUM(CONTAINERS_40_FT)CONTAINERS_40_FT,SOURCE
FROM PO_SKU_FORECAST
GROUP BY WEEK_STARTING,DIV_NO ,DIV_NAME ,DEPT_NO ,CLASS_NO ,VENDOR_NO ,VENDOR_NAME ,FACTORY_NO ,FACTORY_NAME ,FOB ,SHIP_TO,PO_NO ,
REVISION_NO ,ORDER_DATE ,ORIG_START_SHIP_DATE ,SHIP_DATE ,ORIGINAL_CANCEL_DATE ,CANCEL_DATE ,ORIGINAL_ANTICIPATE_DATE ,
ANTICIPATE_DATE ,STYLE_NO ,STYLE_DESC , USED_REVISED_DATE ,
STYLE_LENGTH ,STYLE_WIDTH ,STYLE_HEIGHT ,STYLE_MASTERPACK_QTY,SOURCE)X
ORDER BY PO_NO,STYLE_NO,SOURCE;