【问题标题】:Show the error message in a popup alert rather then on status bar在弹出警报中而不是在状态栏上显示错误消息
【发布时间】:2019-02-23 01:14:01
【问题描述】:

如何在类似于下图的弹出警告框中显示错误消息。

我目前正在使用的代码。

BEGIN
    IF( Condition )THEN
        --Show the error as popup alert message box
        MESSAGE("This is an error.");
        RAISE FORM_TRIGGER_FAILURE;
    END IF;
END;

【问题讨论】:

    标签: oracle plsql oracle11g oracleforms


    【解决方案1】:

    基本上,如果您重复该消息,您将收到弹出式警报,而不是进入状态栏:

    BEGIN
        IF( Condition )THEN
            --Show the error as popup alert message box
            MESSAGE('This is an error.');
            MESSAGE('This is an error.');
            RAISE FORM_TRIGGER_FAILURE;
        END IF;
    END;
    

    或按以下方式尝试:

    BEGIN
        IF( Condition )THEN
            --Show the error as popup alert message box
            FOR i IN 1..2
            LOOP
              MESSAGE('This is an error.');
            END LOOP;            
            RAISE FORM_TRIGGER_FAILURE;
        END IF;
    END;
    

    或将第二个作为空字符串(无需重复):

    BEGIN
        IF( Condition )THEN
            --Show the error as popup alert message box
            MESSAGE('This is an error.');
            MESSAGE('');
            RAISE FORM_TRIGGER_FAILURE;
        END IF;
    END;
    

    【讨论】:

    • 我收到此错误PLS-00201: identifier 'MESSAGE' must be declared
    • @YUSOFKHAN 你确定你是在Oracle Forms 中作为标记或通过IDE 或命令行在内部发出命令吗?例如。这是一个Oracle Forms 命令,但不是PL/SQL。如果SERVEROUTPUT 选项设置为ON,您可能需要DBMS_OUTPUT.PUT_LINE()
    • @Okay 非常感谢你,我正在尝试在 PL/SQL 中使用它
    • 不客气@YUSOFKHAN,this link 中的这些示例可能会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-23
    • 1970-01-01
    相关资源
    最近更新 更多