这可能是一个门外汉问题。我仍然在网上冲浪,无法通过。 在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
由于
答案 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;