对不起,我说错了,不是函数是过程,过程很简单,就是:
procedure disp_msg(in_mesg VARCHAR2) IS
begin
--
raise_application_error('-20000','E: '||in_mesg);
--
end;
procedure disp_msg(in_mesg VARCHAR2) IS
begin
--
raise_application_error('-20000','E: '||in_mesg);
--
end;
raise_application_error( -20000, '不允许删除此记录');
RETURN;
END IF;
re: LGQDUCKY(飘)
直接写到触发器里是一回事啊,出错的时候,还是会显示那些除了有用的出错的提示以外的信息代码和其他不必要的字符。我想用raise_application_error可能不能解决问题,还有没有别的办法。
SELECT ....;
EXCEPTION
when no_data_found then
RAISE_APPLICATION_ERROR( -20054, '没有找到该报表位置('|| my_bmbh ||')' ); when others then
RAISE_APPLICATION_ERROR( -20052, SQLERRM );
END ;
when others then
.....
end;
/