Aginity存储过程错误

时间:2015-05-10 02:29:25

标签: stored-procedures netezza

这可能是一个门外汉问题。我仍然在网上冲浪,无法通过。 在Aginity中运行简单存储过程时出现以下错误

CREATE OR REPLACE PROCEDURE test() 
RETURNS VARCHAR(10) 
LANGUAGE NZPLSQL AS
BEGIN_PROC
DECLARE 
BEGIN 
RETURN "SUCCESS" 
END
END_PROC;

运行上述内容时没有错误。

仅在执行时获取错误

EXECUTE TEST();

错误:

ERROR [01000] NOTICE:  plpgsql: ERROR during compile of TEST near line 3

ERROR [HY000] ERROR:  missing ; at end of SQL statement

由于

1 个答案:

答案 0 :(得分:2)

CREATE OR REPLACE PROCEDURE test() 
RETURNS VARCHAR(10) 
LANGUAGE NZPLSQL AS
BEGIN_PROC
-- No need a DECLARE when you don have to declare anything
BEGIN 
RETURN "SUCCESS" ; -- you just need a semi colon!
END; -- also here
END_PROC;