Netezza错误存储过程错误

问题描述 投票:1回答:1

我尝试执行存储过程,但遇到以下问题。我不知道我的字符串格式是否有问题。这是我的错误信息:

错误:查询'MERGE INTO GTN..ON_ORDER_REPORT_TSS_TEST a执行中的意外错误12正在使用QUANTISENSE_PROD_STAGE..VW_CURRENT_VIEW_OF_LINE_SHEET_HIST b开TRIM(a.channel)= TRIM(上(b.channel_desc))和TRIM(a.style_colour)= TRIM(b.style_opt_numb)和TRIM(a.season_code)= TRIM(b.season_cd)和a.STYLE_COLOUR ='IG1501S-034121'匹配时更新SET a.REVISED_IN_STORE_DT = b.REVISED_IN_STORE_DT || '00:00:00',a.PLANNED_IN_STORE_DT = b.PLANNED_IN_STORE_DT || '00:00:00';'

这是我的存储过程的代码:

CREATE OR REPLACE PROCEDURE USP_UPDATE_LINE_SHEET_TEST(CHARACTER VARYING(ANY))
RETURNS CHARACTER VARYING(ANY)
LANGUAGE NZPLSQL AS
BEGIN_PROC
DECLARE 
TABLENAME ALIAS FOR $1; 
SQL TEXT;
SQLFULL varchar(4000);

BEGIN 
SQL := 'MERGE INTO GTN..'||TABLENAME||' a 
USING QUANTISENSE_PROD_STAGE..VW_CURRENT_VIEW_OF_LINE_SHEET_HIST b 
ON TRIM(a.channel) = TRIM(upper(b.channel_desc)) 
and TRIM(a.style_colour) = TRIM(b.style_opt_numb) 
and TRIM(a.season_code) = TRIM(b.season_cd) 
and a.STYLE_COLOUR = ''IG1501S-034121''
WHEN MATCHED THEN 
UPDATE SET a.REVISED_IN_STORE_DT = b.REVISED_IN_STORE_DT || '' 00:00:00'', 
       a.PLANNED_IN_STORE_DT = b.PLANNED_IN_STORE_DT || '' 00:00:00'';';           
EXECUTE IMMEDIATE SQL;    
END; 
END_PROC;     

我该如何解决此错误?

database netezza
1个回答
0
投票

任何人都找到了解决此问题的方法吗?

热门问题
推荐问题
最新问题