13.20 OPEN_QUERY_CONTEXT Function

This function opens a query context based on the current region or process source.

Syntax

function open_query_context (
    p_columns               in t_columns    default c_empty_columns,
    --
    p_filters               in t_filters    default c_empty_filters,
    p_order_bys             in t_order_bys  default c_empty_order_bys,
    --
    p_first_row             in pls_integer  default null,
    p_max_rows              in pls_integer  default null,

    p_total_row_count       in boolean      default false,
    p_total_row_count_limit in pls_integer  default null,
    --
    p_select_all_query_cols in boolean      default false,
    --
    p_sql_parameters        in t_parameters default c_empty_parameters,
    --
    p_set_session_state     in boolean      default false) return t_context;

Parameters

Table 13-18 OPEN_QUERY_CONTEXT Function Parameters

Parameter Description

p_columns

Columns to be selected from the data source.

p_filters

Filters to be used.

p_order_bys

Order by expressions to be used.

p_first_row

First row to be fetched.

p_max_rows

Maximum amount of rows to be fetched.

p_total_row_count

Whether to determine the total row count.

p_total_row_count_limit

Upper limit for the total row count computation.

p_select_all_query_cols

When set to TRUE, the columns passed in p_columns will be selected *in addition* to the columns of the data source. Useful to compute derived values.

p_sql_parameters

Bind variables to be used.

p_set_session_state

Whether to load column values for each row into session state. Important for Plug-In developers wanting to use column values for substitutions.

Returns

The context object representing a "cursor" for the query.