如果要满足某些条件,我想显示来自PLSQL的警报消息。但是它不起作用。
请在单击复选框时检查我在动态操作中编写的PLSQL代码。
declare
var_hire DATE ;
tenure_dt DATE;
i number;
TENURE EXCEPTION;
BEGIN
SELECT HIREDATE INTO var_hire from employee where empno=107;
-- APEX_APPLICATION.G_F01(1);
SELECT var_hire+ INTERVAL '1' YEAR INTO tenure_dt FROM DUAL;
IF SYSDATE < to_Date(tenure_dt,'DD-MON-YY') THEN
/* APEX_ERROR.ADD_ERROR (
p_message => 'The employee cannot be deleted',p_display_location => apex_error.c_inline_in_notification );*/
apex_application.g_global_notification( 'The employee cannot be deleted');
END IF ;
END ;
declare
var_hire DATE ;
tenure_dt DATE;
i number;
TENURE EXCEPTION;
BEGIN
SELECT HIREDATE INTO var_hire from employee where empno=107;
-- APEX_APPLICATION.G_F01(1);
SELECT var_hire+ INTERVAL '1' YEAR INTO tenure_dt FROM DUAL;
APEX_ERROR.ADD_ERROR (
p_message => 'The employee cannot be deleted',p_display_location => apex_error.c_inline_in_notification );
EXCEPTION
WHEN TENURE THEN
RAISE_APPLICATION_ERROR(-20000,'CANNOT BE DELETED');
END ;