Oracle9iAS Portal Developer Kit

set_value_as_string procedure

Contained in package wwpre_api_value.

Call this procedure to set a string value for a preference.

Note: This function stores the value of the preference as a text string. The text string is transformed into the native form, and the native form is stored.

procedure set_value_as_string

(

p_path in varchar2,

p_name in varchar2,

p_level_type in varchar2,

p_level_name in varchar2,

p_value in varchar2,

p_language in varchar2,

p_commit in boolean default FALSE

);

Version: Oracle Portal 3.0.6.6.5 or later

Parameters:

p_path

The path for the preference name.

Datatype: in varchar2

p_name

The preference name.

Datatype: in varchar2

p_level_type

A constant value for the level at which the value is stored.

Datatype: in varchar2

p_level_name

The user name or group name for the value to be stored.

Note: If the level is SYSTEM, then the level name must be NULL.

Datatype: in varchar2

p_value

The string value to be stored.

Datatype: in varchar2

p_language

The language to load the type for the preference value.

Datatype: in varchar2

p_commit

This parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.

Exceptions:

  • If the string value does not conform to its type, VALUE_ERROR_EXCEPTION is raised.
  • If the path is not found, PATH_NOT_FOUND_EXCEPTION is raised.
  • If a duplicate path is found, DUPLICATE_PATH_EXCEPTION is raised.
  • If the name is not found, NAME_NOT_FOUND_EXCEPTION is raised.
  • If a duplicate preference name exists for the specified path, DUPLICATE_NAME_EXCEPTION is raised.
  • If the value has not been stored, GENERAL_PREFERENCE_EXCEPTION is raised.

Example:

This example sets the default font color for the current user to #FF0000.

begin

wwpre_api_value.set_value_as_string

(

p_path => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',

p_name => 'FONT_COLOR',

p_level_type => wwpre_api_value.USER_LEVEL_TYPE,

p_level_name => wwctx_api.get_user,

p_value => '#FF0000',

p_language => wwctx_api.get_nls_language

);

exception

when VALUE_ERROR then

dbms_output.put_line

(

'Invalid value for font_color at user level'

);

end;

Related topics

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