38.3 CREATE_MESSAGE Procedure

Use this procedure to create a translatable text message for the specified application.

Syntax

APEX_LANG.CREATE_MESSAGE (
    p_application_id      IN NUMBER,
    p_name                IN VARCHAR2,
    p_language            IN VARCHAR2,
    p_message_text        IN VARCHAR2,
    p_used_in_javascript  IN BOOLEAN  DEFAULT FALSE )

Parameters

Table 38-1 CREATE_MESSAGE Procedure Parameters

Parameter Description
p_application_id The ID of the application for which you wish to create the translatable text message. This is the ID of the primary language application.
p_name The name of the translatable text message.
p_language The IANA language code for the mapping. Examples include en-us, fr-ca, ja, or he.
p_message The text of the translatable text message.
p_used_in_javascript Specify if the message needs to be used directly by JavaScript code (use the apex.lang JavaScript API).

Example

The following example demonstrates the creation of a 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
                where workspace = 'HR_DEV') loop
            apex_util.set_security_group_id( c1.workspace_id );
            exit;
        end loop;
    apex_lang.create_message(
        p_application_id => 63969,
        p_name => 'TOTAL_COST',
        p_language => 'ja',
        p_message_text => 'The total cost is: %0',
        p_used_in_javascript => true );
    commit;
END;
/