45.13 GET_ATTRIBUTE_AS_NUMBERファンクション

このファンクションは、現行データベース・セッションで有効なNLS小数点セパレータを考慮して、プラグイン属性の値を数値として戻します。このファンクションは、組込みto_numberファンクションのかわりに、プラグインPL/SQLソースでNUMBER型のカスタム属性に使用します。

構文

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

パラメータ

パラメータ 説明
p_attribute_label カスタム・プラグイン属性のラベル。
p_value NUMBER型のカスタム属性の値。

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;
/