Oracle9iAS Portal Developer Kit

set_value_as_string procedure

Contained in package wwa_api_module_session.

Call this procedure to set the value of an attribute when you specify the value as a formatted string, i.e. in accordance with the format mask specified at design time.

member procedure set_value_as_string
(
   p_block_name in varchar2,
   p_attribute_name in varchar2,
   p_value in varchar2,
   p_index in integer default 1,
   p_language in 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_value

The value of the attribute.

Datatype: varchar2

p_index

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

Datatype: integer

Default: 1

p_language

The language to be used for all value transformations.

Datatype: varchar2

Exceptions:

If the transformation could not be performed, due to formatting problems with the input data, exception VALUE_ERROR is raised.

Example:

Consider an Oracle Portal form component based on the SCOTT.EMP table (module_id=7). The HIREDATE attribute has the format mask fmdd-mm-yyyy hh24:mi:ss.

To set the value of the A_HIREDATE session attribute, specifying the value with a format mask:

declare
    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_session.set_value_as_string(
               p_block_name => 'DEFAULT',
               p_attribute_name => 'A_HIREDATE',
               p_value => '14-02-2001 09:30:00',
               p_language => <portal_schema>.wwctx_api.get_nls_language
        );
end;

Note: If no format mask is specified at design time, conversion is tried with one of the preset format masks.

Related topics

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