39.15 UPDATE_MESSAGEプロシージャのシグネチャ1

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

更新中のメッセージがサブスクライブされると、エラーが発生します。

ノート:

テキスト・メッセージはサブスクライブされると読取り専用になります。このような場合、変更内容はすべて、マスター・テキスト・メッセージから導出されます。

アプリケーション・ビルダーを使用してそのテキスト・メッセージをリフレッシュするか、マスター・テキスト・メッセージを公開してマスター・テキスト・メッセージからそのテキスト・メッセージに最新の変更内容を取得します。

このAPIを使用してテキスト・メッセージを更新するには、まずアプリケーション・ビルダーでそのテキスト・メッセージのサブスクライブを解除します(サブスクライブ解除用のAPIはありません)。

構文

APEX_LANG.UPDATE_MESSAGE (
  p_id             IN NUMBER,
  p_message_text   IN VARCHAR2 )

パラメータ

パラメータ 説明
p_id テキスト・メッセージのID。
p_message_text 翻訳可能テキスト・メッセージの新しいテキスト。

次の例に、既存の翻訳可能テキスト・メッセージの更新方法を示します。

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_security_group_id is not necessary
    -- if you're running within the context of the App Builder
    -- or an APEX application.
    --
    FOR c1 in (select workspace_id
                 from apex_workspaces) LOOP
        apex_util.set_security_group_id( c1.workspace_id );
        EXIT;
    END LOOP;
    -- Locate the ID of the specific message and update it with the new text
    FOR c1 in (SELECT translation_entry_id
                 FROM apex_application_translations
                WHERE application_id = 63969
                  AND translatable_message = 'TOTAL_COST'
                  AND language_code = 'en') LOOP
        apex_lang.update_message(
            p_id => c1.translation_entry_id,
            p_message_text => 'The total cost is: %0');
        COMMIT;
        EXIT;
    END LOOP;
END;
/

参照: