39.16 UPDATE_MESSAGEプロシージャのシグネチャ2

このプロシージャにより、指定されたアプリケーションの、翻訳可能テキスト・メッセージとその属性を更新します。

構文

APEX_LANG.UPDATE_MESSAGE (
    p_id                 IN NUMBER,
    p_name               IN VARCHAR2,
    p_language           IN VARCHAR2,
    p_message_text       IN VARCHAR2,
    p_used_in_javascript IN BOOLEAN,
    p_comment            IN VARCHAR2,
    p_metadata           IN CLOB )

パラメータ

パラメータ 説明
p_id 更新するテキスト・メッセージのID。
p_name 翻訳可能テキスト・メッセージの名前。
p_language マッピング用のIANA言語コード。たとえば、en-usfr-cajaheがあります。
p_message_text 翻訳可能テキスト・メッセージのテキスト。
p_used_in_javascript メッセージをJavaScriptコードで直接使用する必要があるかどうかを指定します(apex.lang JavaScript APIを使用します)。
p_comment 開発者のコメントまたはノートは、アプリケーション・ビルダーでのみ表示されます。
p_metadata メッセージとともに保存される追加データ。ノート: このデータは、Oracle APEXでは使用されません

次の例では、翻訳可能テキスト・メッセージを更新します。

BEGIN
    --
    -- If running from SQLcl, we need to set the environment
    -- for the Oracle APEX workspace associated with this schema.
    -- The call to apex_util.set_workspace is not necessary if
    -- you're running within the context of the App Builder or an APEX
    -- application.
    --
    apex_util.set_workspace( 'SALES_DEV' );

    FOR l_message IN ( select translation_entry_id
                         FROM apex_application_translations
                        WHERE application_id       = 100
                          AND translatable_message = 'TOTAL_COST'
                          AND language_code        = 'en-us' )
    LOOP
        apex_lang.update_message(
            p_id                 => l_message.translation_entry_id,
            p_name               => 'SALES_TOTAL_COST',
            p_language           => 'en',
            p_message_text       => 'Total sales cost is: %0',
            p_used_in_javascript => true,
            p_comment            => 'What is the total cost of sales',
            p_metadata           => q'[{"Tag": "sales", "Approved": true}]' );
                                    -- Any additional data to store
    END LOOP;
END;