45.19 GET_DISPLAY_DATA Function Signature 1

This function gets the display lookup value for the value specified in p_search_string.

Syntax

APEX_PLUGIN_UTIL.GET_DISPLAY_DATA (
    p_sql_statement     IN VARCHAR2,
    p_min_columns       IN NUMBER,
    p_max_columns       IN NUMBER,
    p_component_name    IN VARCHAR2,
    p_display_column_no IN BINARY_INTEGER DEFAULT 1,
    p_search_column_no  IN BINARY_INTEGER DEFAULT 2,
    p_search_string     IN VARCHAR2       DEFAULT NULL,
    p_display_extra     IN BOOLEAN        DEFAULT TRUE )
RETURN VARCHAR2;

Parameters

Parameter Description
p_sql_statement SQL statement used for the lookup.
p_min_columns Minimum number of return columns.
p_max_columns Maximum number of return columns.
p_component_name In case an error is returned, this is the name of the page item or report column used to display the error message.
p_display_column_no Number of the column returned from the SQL statement. Must be within the p_min_columns though p_max_columns range.
p_search_column_no Number of the column used to restrict the SQL statement. Must be within the p_min_columns though p_max_columns range.
p_search_string Value used to restrict the query.
p_display_extra If set to TRUE, and a value is not found, the search value is added to the result instead.

Return

Return Description
VARCHAR2 Value of the first record of the column specified by p_display_column_no. If no record was found it contains the value of p_search_string if the parameter p_display_extra is set to TRUE. Otherwise NULL is returned.

Example

The following example does a lookup with the value provided in p_value and returns the display column of the LOV query.

function render_value (
    p_item                in apex_plugin.t_page_item,
    p_value               in varchar2,
    p_is_readonly         in boolean,
    p_is_printer_friendly in boolean )
    return apex_plugin.t_page_item_render_result
is
begin
    sys.htp.p(sys.htf.escape_sc(
        apex_plugin_util.get_display_data (
            p_sql_statement     => p_item.lov_definition,
            p_min_columns       => 2,
            p_max_columns       => 2,
            p_component_name    => p_item.name,
            p_display_column_no => 1,
            p_search_column_no  => 2,
            p_search_string     => p_value )));
end render_value;