21.10 GET_ATTRIBUTE_AS_NUMBER Function

This function returns the value of a plug-in attribute as a number, taking into account NLS decimal separator effective for the current database session. Use this function in plug-in PL/SQL source for custom attributes of type NUMBER instead of the built-in to_number function.

Syntax

APEX_PLUGIN_UTIL.GET_ATTRIBUTE_AS_NUMBER (
    p_value IN VARCHAR2 ),
    p_attribute_label IN VARCHAR2 )
    return NUMBER;

Parameters

Table 21-9 GET_ATTRIBUTE_AS_NUMBER Function Parameters

Parameter Description

p_attribute_label

The label of the custom plug-in attribute.

p_value

The value of a custom attribute of type NUMBER.

Example

declare
    l_value number;
begin
    -- The following may fail for languages that don't use dot as the NLS decimal separator
    l_value := to_number( p_region.attribute_04 );
 
    -- The following will work correctly regardless of the effective NLS decimal separator
    l_value := apex_plugin_util.get_attribute_as_number( p_region.attribute_04, 'Minimum Amount' );
end;
/