Oracle9iAS Portal Developer Kit

get_string function (id, language)

Contained in package wwnls_api.

This function returns a message string based on the message string ID. If p_language is null, the string specified in p_id is returned. If p_language is not null, the translation specified for the string ID is returned in the language specified in p_language.

Note: This function allows parameter substitution.

function get_string

(

p_id in wwnls_strings$.id%type,

p_language in wwnls_strings$.language%type default null,

p0 in varchar2 default null,

p1 in varchar2 default null,

p2 in varchar2 default null,

p3 in varchar2 default null,

p4 in varchar2 default null,

p5 in varchar2 default null,

p6 in varchar2 default null,

p7 in varchar2 default null,

p8 in varchar2 default null,

p9 in varchar2 default null

)

return varchar2;

Version: Oracle Portal 3.0.6.6.5 or later

Parameters:

p_id

The message string ID.

Datatype: in wwnls_strings$.id%type

p_language

The NLS language name constant for the language to be retrieved.

Example: wwnls_api.AMERICAN.

Datatype: in wwnls_strings$.language%type
Default: null

(p0, p1, ... p9)

Values used for parameter substitution.

Notes:

  • These are optional run-time values that may be inserted into the message string.

  • The message string must contain the markup characters %0, %1, through %9 in order to pass in the appropriate parameter value.
  • Only the specified non-null values p0 through p9 are used for substitution. Extra values are ignored.
  • Only non-null values are used for substitution.

Datatype: in varchar2
Default: null

Returns:

If p_language is null, this function returns the string text specified in p_id. If p_language is not null, this function returns the translation specified for the string ID in the language specified in p_language.

Exceptions:

If this function fails to execute, an NLS_EXECUTION_EXCEPTION is raised.

Example:

declare

l_string_id integer;
l_string varchar2(200);

begin

l_string_id := wwnls_api.get_id

(p_domain =>'MAP_PROVIDER',
p_sub_domain =>'MAP_PORTLET',
p_name =>'PORTLET_TITLE',
p_langauge =>wwnls_api.AMERICAN);

l_string := wwnls_api.get_string

(p_id =>l_string_id); -- string returned in English

l_string := wwnls_api.get_string

(p_id =>l_string_id,
p_language=>wwnls_api.HEBREW); -- no translation in Hebrew, string returned in English

l_string := wwnls_api.get_string

(p_id =>l_string_id,
p_language=>wwnls_api.FRENCH); -- string returned in French

end;

Related topics

The PL/SQL API Reference is part of the Portal Developer Kit on Portal Studio