【发布时间】:2016-12-02 00:34:54
【问题描述】:
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"
【问题讨论】:
-
本题与
error-handling无关。它是关于如何使用您拥有的工具,在这种情况下,编写一个执行两件事的脚本。
标签: sql oracle plsql error-handling