Oracle9iAS Portal Developer Kit

set_attribute_default procedure

Contained in package wwa_api_module_session.

Call this procedure to set the default value of a specific attribute.

The default value is specified at design time. If no default value is specified at design time, the attribute's value is set to NULL.

member procedure set_attribute_default
    (
        p_attribute      in wwa_api_attribute default null,
        p_block_name     in varchar2,
        p_attribute_name in varchar2,
        p_index          in integer default 1,
        p_language       in varchar2
    )

Version: Oracle Portal 3.0.9

Parameters:

p_attribute

The attribute object of the attribute whose default value is to be set.

If left null, the procedure finds it using the p_attribute_name and p_block_name.

Note: This parameter available in Oracle Portal 3.0.9.8.3 and later.

Datatype: varchar2
Default: null

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

p_language

The language to be used for all value transformations.

Datatype: varchar2

Exceptions:

None.

Example:

Consider an Oracle Portal form component based on the SCOTT.EMP table (module_id=7). To set the default value for the HIREDATE attribute  in the DEFAULT block:

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_attribute_default (
            p_attribute_name => 'A_HIREDATE',
            p_block_name => 'DEFAULT',
            p_language => <portal_schema>.wwctx_api.get_nls_language
        );
end;

Example 2:

For an Oracle Portal master-detail form component, to set the default value for the 3rd instance of HIREDATE  (detail section):

declare
    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_session.set_attribute_default (
            p_attribute_name => 'A_HIREDATE',
            p_block_name => 'DEFAULT',
            p_index => 3,
            p_language => <portal_schema>.wwctx_api.get_nls_language
        );
end;

Related topics

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