【发布时间】:2016-08-03 23:15:38
【问题描述】:
下面的函数包含在一个从 shell 脚本调用的 PLSQL 包中。它失败了,因为没有找到 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 是与上游的数据库链接
-
JIT_TIME 连接到接受车辆订单的上游系统。