39.14 UPDATE_MESSAGE Procedure
This procedure updates a translatable text message for the specified application.
An error raises if the message being updated is subscribed.
Note:
When a text message is subscribed, it becomes read-only. In such cases, all changes are driven from the master text message.
Use App Builder to refresh the text message or publish the master text message to get the latest changes from master text message into the text message.
To update the text message using this API, first unsubscribe from the text message in App Builder (there is no API for unsubscribing).
Syntax
APEX_LANG.UPDATE_MESSAGE (
p_id IN NUMBER,
p_message_text IN VARCHAR2 )
Parameters
Parameter | Description |
---|---|
p_id |
The ID of the text message. |
p_message_text |
The new text for the translatable text message. |
Example
The following example demonstrates an update of an existing translatable text message.
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 = 'ja') LOOP
apex_lang.update_message(
p_id => c1.translation_entry_id,
p_message_text => 'The total cost is: %0');
COMMIT;
EXIT;
END LOOP;
END;
/
See Also:
- Unsubscribing to a Shared Component in the Oracle APEX App Builder User’s Guide
- Refreshing a Subscribed Shared Component in the Oracle APEX App Builder User’s Guide
Parent topic: APEX_LANG