我必须执行一个SQL文件(我对SQL不太了解,我只需要执行它),但是有一个我不理解的错误:
错误:检查编译器日志
PACKAGE USER1.TST_MAI_FILTER的错误:
线路/颜色错误
29/1 PLS-00103:遇到符号“创建”
这是PACKAGE USER1.TST_MAI_FILTER:
CREATE OR REPLACE PACKAGE TST_MAI_FILTER IS
FUNCTION TRADE_TYPE
RETURN NUMBER;
FUNCTION ORDER_TYPE
RETURN NUMBER;
FUNCTION MRKT_EVT_TYPE
RETURN NUMBER;
FUNCTION DAILY_DATA_TYPE
RETURN NUMBER;
PROCEDURE log_mai_filter(p_run_id NUMBER, p_config_id NUMBER);
PROCEDURE is_valid_filter
(p_mai_class_id IN NUMBER,
p_type_id IN NUMBER,
v_where CLOB);
END TST_MAI_FILTER;
/
我正在使用Oracle SQL Developer(Oracle数据库12c企业版版本12.2.0.1.0-64位生产)。
编辑:这是第29行:
CREATE SEQUENCE S_TRD START WITH 1 INCREMENT BY 1 MINVALUE 1 CACHE 20 NOORDER;
,这是程序包的其余部分,但直到开发人员在此错误后停止,它才到那里:
CREATE OR REPLACE PACKAGE BODY TST_MAI_FILTER IS
FUNCTION TRADE_TYPE
RETURN NUMBER
IS
BEGIN
RETURN 1;
END;
FUNCTION ORDER_TYPE
RETURN NUMBER
IS
BEGIN
RETURN 2;
END;
FUNCTION MRKT_EVT_TYPE
RETURN NUMBER
IS
BEGIN
RETURN 3;
END;
FUNCTION DAILY_DATA_TYPE
RETURN NUMBER
IS
BEGIN
RETURN 4;
END;
PROCEDURE log_mai_filter(p_run_id NUMBER, p_config_id NUMBER)
IS
v_mesg VARCHAR2(4000 BYTE) := NULL;
BEGIN
INSERT INTO mai_filter_log (run_id, mai_query_id, sql_query, config_id, type_id, mai_class_id)
SELECT p_run_id, mai_query_id, sql_query, config_id, type_id, mai_class_id
FROM mai_filter
WHERE config_id = p_config_id;
LOG_INFO(p_run_id, 'I', 'RUN_LOG: Log mai_filter: ' || SQL%ROWCOUNT );
EXCEPTION
WHEN OTHERS THEN
v_mesg := 'An error has occured when executing log_mai_filter - ' || SQLCODE || ' -ERROR- ' || SQLERRM;
raise_application_error(-20085, v_mesg);
LOG_INFO(p_run_id, 'E', v_mesg);
END;
PROCEDURE is_valid_filter
(p_mai_class_id IN NUMBER,
p_type_id IN NUMBER,
v_where CLOB) IS
v_tbl VARCHAR2(400 BYTE) := NULL;
BEGIN
SELECT type_name INTO v_tbl
FROM mai_filter_type
WHERE type_id = p_type_id;
EXECUTE IMMEDIATE 'SELECT run_id FROM ' || v_tbl || ' WHERE run_id = 0 AND '|| v_where;
END;
END TST_MAI_FILTER;
/