在IFS 后台有时从外部导入数据,直接数据oracle报错信息可读性较差,现改进校验过程,如下:
PROCEDURE Validate_Date___( value_ IN VARCHAR2,
format_ IN VARCHAR2)
IS
tmp_date_ DATE;
BEGIN
tmp_date_ := to_date(value_,format_);
EXCEPTION
WHEN OTHERS THEN
Error_SYS.Appl_General( lu_name_, 'DATEERROR: Value :P1 Is Not A Validate Date Format, Please Check Format :P2 !', value_, format_ );
END Validate_Date___;
PROCEDURE Validate_Number___( value_ IN VARCHAR2)
IS
BEGIN
IF Ext_File_Message_Api.Is_Column_Numeric( value_ ) THEN
NULL;
ELSE
Error_Sys.Appl_General(lu_name_, 'NUMBERERR: Value :P1 Is Not A Validate Number, Please Check !', value_ );
END IF;
END Validate_Number___;
这样IFS报错的信息可读性就比较好,可以清楚看到错误的相关信息.