45.20 GET_DISPLAY_DATA Function Signature 2
This function looks up all the values provided in the p_search_value_list
instead of just a single value lookup.
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_value_list IN apex_application_global.vc_arr2,
p_display_extra IN BOOLEAN DEFAULT TRUE,
p_escape_display_extra IN BOOLEAN DEFAULT TRUE,
p_auto_bind_items IN BOOLEAN DEFAULT TRUE,
p_bind_list IN t_bind_list DEFAULT c_empty_bind_list,
RETURN apex_application_global.vc_arr2;
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 through 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 through p_max_columns range.
|
p_search_value_list |
Array of values to look up. |
p_display_extra |
If set to TRUE , and a value is not found, the search value is added to the result instead.
|
p_escape_display_extra |
If TRUE , p_search_string is escaped if added as "Display Extra" value.
|
p_auto_bind_items |
Whether to auto-bind APEX items (page and application items). |
p_bind_list |
Additional bind variables to be used for the SQL query. |
Return
Return | Description |
---|---|
apex_application_global.vc_arr2 |
List of VARCHAR2 indexed by pls_integer. For each entry in p_search_value_list the resulting array contains the value of the first record of the column specified by p_display_column_no in the same order as in p_search_value_list . If no record is found it contains the value of p_search_string if the parameter p_display_extra is set to TRUE. Otherwise the value is skipped.
|
Example
Looks up the values 7863, 7911 and 7988 and generates a HTML list with the value of the corresponding display column in the LOV query.
function render_list (
p_plugin in apex_plugin.t_plugin,
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
l_search_list apex_application_global.vc_arr2;
l_result_list apex_application_global.vc_arr2;
begin
l_search_list(1) := '7863';
l_search_list(2) := '7911';
l_search_list(3) := '7988';
--
l_result_list :=
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_search_column_no => 1,
p_search_value_list => l_search_list );
--
sys.htp.p('<ul>');
for i in 1 .. l_result_list.count
loop
sys.htp.p(
'<li>'||
sys.htf.escape_sc(l_result_list(i))||
'</li>');
end loop;
sys.htp.p('</ul>');
end render_list;
Parent topic: APEX_PLUGIN_UTIL