Plsql创建Job报错:ORA-06550

在Plsql中写了一个存储过程,并且测试通过,如下:

CREATE OR REPLACE PROCEDURE P_NEW_JINGQU_VISIT_GY_H(p_day STRING, p_hour STRING)    --定义参数
AS
    v_day   VARCHAR2(255);
    v_hour  VARCHAR2(255);  --定义变量
BEGIN
    --用输入参数给变量赋值
    SELECT MAX(clndr_dt) INTO v_day FROM NEW_JINGQU_VISIT_GY_H WHERE clndr_dt <= p_day;
    SELECT MAX(hour_id) INTO v_hour FROM NEW_JINGQU_VISIT_GY_H WHERE clndr_dt = v_day AND hour_id <= p_hour;   --可以使用变量进行限制?

    DELETE FROM NEW_JINGQU_VISIT_GY
    WHERE clndr_dt = p_day
        AND hour_id = p_hour;

    insert into pro_log
    select 'P_HX_JS_CASE_INFO',sysdate from dual;

COMMIT;
END;

然后添加Job运行报错:
Plsql创建Job报错:ORA-06550_第1张图片

原因市在what值配置有问题,没有传入参数
what值应该采用如下的写法:

declare

v1 int;

V2 VARCHAR2(2);

begin

v1 :=TO_CHAR (SYSDATE , 'yyyymmdd');

V2 :=TO_CHAR(SYSDATE-1/24,'HH24');

P_NEW_JINGQU_VISIT_GY_H(v1,V2);

end;

问题解决

你可能感兴趣的:(数据库Mysql&Oracle)