gpt4 book ai didi

sql - 错误(11,1): PLS-00103: Encountered the symbol “DECLARE”

转载 作者:行者123 更新时间:2023-12-03 09:04:17 25 4
gpt4 key购买 nike

CREATE OR REPLACE FUNCTION totalPatients
RETURN number IS
total number(2) := 0;
BEGIN
SELECT count(*) into total
FROM patient;

RETURN total;
END;

DECLARE
c number(2);
BEGIN
c := totalPatients();
dbms_output.put_line('Total no. of Patients: ' || c);
END;


Error(11,1): PLS-00103: Encountered the symbol "DECLARE"

最佳答案

在函数定义之后和匿名块之后单独添加斜杠/(在单独的行上)。其他一切都应该起作用。

关于sql - 错误(11,1): PLS-00103: Encountered the symbol “DECLARE” ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40922864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com