问题遇到的现象和发生背景
DBeaver 保存存储过程时提示报错
遇到的现象和发生背景,请写出第一个错误信息
PLS-00103: 出现符号 "V_BEGIN_TIME"在需要下列之一时:
language
用代码块功能插入代码,请勿粘贴截图。 不用代码块回答率下降 50%
CREATE OR REPLACE PACKAGE C1DM.DM_SJZX IS
PROCEDURE C1DM_SJZX_BOM_FJZ (p_year IN VARCHAR2,
p_period IN VARCHAR2,
p_entity_codes IN VARCHAR2) IS
v_begin_time VARCHAR2(19);
v_end_time VARCHAR2(19);
v_error_id VARCHAR2(255);
v_data_count NUMBER DEFAULT 0;
v_error_info VARCHAR2(4000);
BEGIN
--获取开始时间
SELECT to_char(SYSDATE, 'yyyy-mm-dd hh24:mi:ss')
INTO v_begin_time
FROM dual;
--删除数据
DELETE FROM C1DM.DM_SJZX_BOM_FJZ dsbf
WHERE dsbf.YEAR = p_year
AND dsbf.YEAR = p_year
AND dsbf.PERIOD = p_period
AND dsbf.ENTITY_CODE = p_entity_codes;
COMMIT ;
--插入数据
INSERT INTO C1DM.DM_SJZX_BOM_FJZ
("YEAR",
PERIOD,
ENTITY_CODE,
MODELNAME,
PRICE,
RATE_D,
PRICE_CNY,
UPDATE_TIME)
SELECT
osbf."YEAR" AS "YEAR",
osbf.PERIOD AS PERIOD,
osbf.FACTORY AS ENTITY_CODE,
osbf.MODELNAME AS MODELNAME,
osbf.PRICE AS PRICE,
osbf.RATE_D AS RATE_D,
ROUND(osbf.PRICE * osbf.RATE_D,2) AS PRICE_CNY ,
to_char(SYSDATE, 'yyyy-mm-dd hh24:mi:ss') AS UPDATE_TIME
FROM ODS_SJZX.ODS_SJZX_BOM_FJZ osbf
WHERE osbf."YEAR" = p_year
AND osbf.PERIOD = p_period
AND osbf.FACTORY = p_entity_codes;
COMMIT;
--获取结束时间
SELECT to_char(SYSDATE, 'yyyy-mm-dd hh24:mi:ss')
INTO v_end_time
FROM dual;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('');
END C1DM_SJZX_BOM_FJZ;
END DM_SJZX;