我正在使用 Oracle sql developer 编写一个 oracle 包,我得到了这个编译错误:
错误(7,1):PLS-00103:遇到符号“CREATE”。
create or replace
PACKAGE TestPackage AS
FUNCTION beforePopulate RETURN BOOLEAN;
FUNCTION afterPopulate RETURN BOOLEAN;
END TestPackage;
CREATE OR REPLACE PACKAGE BODY TestPackage AS
FUNCTION beforePopulate RETURN BOOLEAN AS
BEGIN
DELETE FROM TEST_1;
INSERT INTO TEST_1
SELECT * FROM TEST WHERE VALUE=300;
COMMIT;
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END;
FUNCTION afterPopulate RETURN BOOLEAN AS
BEGIN
UPDATE TEST SET RESULT="completed" WHERE VALUE=300;
COMMIT;
RETURN TRUE;
EXCEPTION
WHEN OTHERS RETURN FALSE;
END;
END;
END TestPackage;
如果我/
在第 6 行添加 a,则错误变为:
错误(6,1):PLS-00103:遇到符号“/”
我厌倦了这样的空实现:
create or replace
package package1 as
END PACKAGE1;
CREATE OR REPLACE
package body package1 as
end package1;
我也犯了同样的错误。