Oracle9iAS Portal Developer Kit

get_value_as_varchar2_by_id function

Contained in package wwpre_api_value.

Call this function to use level ID to return a preference value as varchar2, if the preference value was stored as varchar2.

Note: For details about returning preference values, see About preference values.

function get_value_as_varchar2_by_id

(

p_path in varchar2,

p_name in varchar2,

p_level_type in varchar2 default INHERIT_LEVEL_TYPE,

p_level_id in integer default null

)

return varchar2;

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 retrieved.

Note: If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each succeeding step if a value is not found:

  1. Get the value for the user currently logged in.

  2. Get the default group value for the user currently logged in.

  3. Get the value for the system level type.
  4. Return null if no value is found.

Datatype: in varchar2
Default: INHERIT_LEVEL_TYPE

p_level_id

The user ID or group ID for which the value is to be retrieved.

Notes:

  • If not specified, this method searches for a valid value based on path, name, and level type.

  • For user-level or group-level type, the level ID must be specified.
  • For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.

Datatype: in integer
Default: null

Returns:

This function returns the varchar2 value of the preference. It returns null if there is no value or if the preference name was not found.

Exceptions:

  • If the path is not found, a PATH_NOT_FOUND_EXCEPTION is raised.

  • If a duplicate path is found, a DUPLICATE_PATH_EXCEPTION is raised.

  • If the value has not been stored, a GENERAL_PREFERENCE_EXCEPTION is raised.

Example:

l_varchar2_value := wwpre_api_value.get_value_as_varchar2_by_id

(

p_path => 'ORACLE.TOOLS.PORTAL.STYLE',

p_name => 'BGCOLOR';

level_type =>wwpre_api_value.USER_LEVEL_TYPE,

level_id => wwctx_api.get_user_id

);

Related topics

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