以下函数包含在从shell脚本调用的PLSQL包中。它失败,因为找不到JIT_TIME。我很难找出这个值来自哪里。它显然不作为参数传递,不存储在任何数据库表中,不从任何其他数据库对象中检索。代码失败,因为未找到JIT_TIME的值
Function ADD_START_DATE(p_process_type char, p_profet_cntl_no char, p_error_file UTL_FILE.FILE_TYPE) return boolean is
v_profet_control_no char(10);
v_jit_time date;
BEGIN
BEGIN
SELECT contr_numb
INTO v_profet_control_no
FROM prd_contr
WHERE end_date_time is null
AND start_date_time is not null
AND rownum=1;
PKG_WRITE_ERROR.writeError(p_error_File , 'PRD-01601','ProFET Control No.='||v_profet_control_no);
return false;
EXCEPTION
when NO_DATA_FOUND then
null;
END;
lock table prd_contr in exclusive mode nowait;
BEGIN
--
-- A new Begin-End block has been added for jit_time function. If the value
-- of jit_time is not found, in case of complete refresh, an error is logged
-- and the process exits. In case of routine, jit_time error is ignored.
--
BEGIN
v_jit_time:=jit_time;
EXCEPTION
when OTHERS then
IF p_process_type = 'C' then
PKG_WRITE_ERROR.writeError(p_error_File , 'PRD-01604', '');
return false;
END IF;
END;
INSERT into prd_contr(start_date_time, end_date_time, idp1_xfer,
proc_type, contr_numb, idp1_time)
VALUES(SYSDATE, '','', p_process_type, p_profet_cntl_no,v_jit_time);
EXCEPTION
when OTHERS then
return false;
END;
commit;
return true;
EXCEPTION
when TIMEOUT_ON_RESOURCE then
PKG_WRITE_ERROR.writeError(p_error_File , 'PRD-01602', '');
return false;
when OTHERS then
PKG_WRITE_ERROR.writeError(p_error_File, 'PRD-01699',substr(SQLERRM,1,100));
return false;
END ADD_START_DATE;
更新: - JIT_TIME是与上游 – user2295715
JIT_TIME数据库链接连接到其接受车辆的上游系统命令 。 – user2295715