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"
答案 0 :(得分:2)
在函数定义之后和匿名块之后,单独添加斜杠{{1}}(在单独的行上)。其他一切都应该有用。