Oracle9iAS Portal Developer Kit

get_value_as_varchar2 function

Contained in package wwa_api_module_session.

Call this function to get the (varchar2) value of an attribute, i.e. without any format masks applied on the values.

This function retrieves values set via the set_value procedure.

member function get_value_as_varchar2
(
   p_block_name in varchar2,
   p_attribute_name in varchar2,
   p_index in integer default 1
)
return varchar2,

Version: Oracle Portal 3.0.9

Parameters:

p_block_name

The name of the block that owns the attribute.

Datatype: varchar2

p_attribute_name

The name of the attribute.

Datatype: varchar2

p_index

The index of the value, for n-valued attributes.

Datatype: integer
Default: 1

Return:

This function returns a varchar2.

Exceptions:

If the attribute's type indicates that the implementation type is not a VARCHAR2 column, exception VALUE_ERROR is raised.

Example 1

To retrieve the value of the ENAME attribute for a form component based on a table, i.e. the A_ENAME attribute of the session data that was set using the set_value procedure:

declare
    l_ENAME varchar2(4000);
    l_session wwa_api_module_session;
begin
        l_session := <portal_schema>.wwa_api_module_session.create_session (
                           p_module_id => 7,
                           p_version  => 1
                       );

        l_empno := l_session.get_value_as_varchar2(
                               p_block_name => 'DEFAULT',
                               p_attribute_name => 'A_ENAME');
end;

Example 2

To retrieve the values of 2 instances of ENAME attribute for a master-detail form component, i.e. the A_ENAME attribute of the session data that was set using the set_value procedure:

declare
    l_ENAME1 varchar2(4000);
    l_ENAME2 varchar2(4000);
    l_session wwa_api_module_session;
begin
        l_session := <portal_schema>.wwa_api_module_session.create_session (
                           p_module_id => 9,
                           p_version  => 1
                       );

        l_ENAME1 := l_session.get_value_as_varchar2(
                               p_block_name => 'DETAIL_BLOCK',
                               p_attribute_name => 'A_ENAME',
                               p_index => 1);
        l_ENAME2 := l_session.get_value_as_varchar2(
                               p_block_name => 'DETAIL_BLOCK',
                               p_attribute_name => 'A_ENAME',
                               p_index => 2);
end;

Related topics

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