1
我試圖在Aginity中爲Netezza運行一些代碼,但沒有將它放入存儲過程中,但我無法獲得正確的語法。以下是一些示例代碼。它會給出錯誤,如「找到」DECLARE「(在字符1處)期待關鍵字。」如果我把代碼放入存儲過程中,它會運行正常。如何在Netezza中運行代碼塊
declare
cnt integer;
rVend record;
begin
FOR rVend in select vend_skey, vend_lvl_1_cd from dim_vend loop
select count(*) into cnt
from dim_vend
where vend_lvl_1_cd = rVend.vend_lvl_1_cd and vend_skey < rVend.vend_skey;
if cnt > 0 then
update dim_vend
set to_delete = 1 where vend_skey = rVend.vend_skey;
end if;
end loop;
end;
謝謝,我會停止嘗試使代碼工作:)參數替換不適用於此特定查詢,但可能在未來有所幫助。 – Kelly