SELECT_GRID_ALL session environment option
Use the SELECT_GRID_ALL option of the SET ENVIRONMENT statement to define a default GRID clause for subsequent grid queries in the session. This clause specifies a default grid or region from which to return a result set equivalent to a logical UNION ALL of qualifying rows from participating grid servers.
SELECT_GRID_ALL environment option |--SET ENVIRONMENT SELECT_GRID_ALL -+-'grid'---+----------------| +-'region'-+ '-DEFAULT--'
Element | Description | Restrictions | Syntax |
---|---|---|---|
grid | Name of a default grid for queries with no GRID clause | The grid must exist | Identifier |
region | Name of a default region for queries with no GRID clause | The region must exist | Identifier |
Usage
- 'grid'
- This specifies the default grid from which SELECT statements that include no GRID clause can return a result set that is the logical UNION ALL of qualifying rows, including duplicates, from all of the participating grid servers in the specified grid. While the SELECT_GRID option of the SET ENVIRONMENT statement is set to the name of a grid, the database server that issued the SET ENVIRONMENT SELECT_GRID_ALL 'grid' statement interprets all queries as UNION ALL grid queries.
- 'region'
- This specifies the default region from which SELECT statements that include no GRID clause can return a result set that is the logical UNION ALL of qualifying values, including duplicates, from all of the participating grid servers in the specified region. While the SELECT_GRID option of the SET ENVIRONMENT statement is set to the name of a region, the database server that issued the SET ENVIRONMENT SELECT_GRID_ALL ’region’ statement interprets all queries as UNION ALL grid queries.
- DEFAULT
- This setting specifies the default behavior. While the SELECT_GRID_ALL option of the SET ENVIRONMENT statement is set to DEFAULT, the database server does not process every query that has no GRID clause as a grid query. Thus, the DEFAULT setting specifies that there is no default GRID clause for SELECT statements. Use this option to disable the effects of a previous SET ENVIRONMENT SELECT_GRID or SET ENVIRONMENT SELECT_GRID_ALL statement that defined a default GRID clause for all queries that include no GRID clause.
Unlike the SELECT_GRID option, the SELECT_GRID_ALL setting enables subsequent queries that include no GRID clause to behave as grid queries that return duplicate values.
The SELECT_GRID_ALL and the SELECT_GRID options of the SET ENVIRONMENT statement are mutually exclusive. After you issue the SET ENVIRONMENT SELECT_GRID_ALL or SET ENVIRONMENT SELECT_GRID statement, issuing a different option of either statement in the same session replaces whatever the previous ENVIRONMENT SELECT_GRID_ALL or SET ENVIRONMENT SELECT_GRID statement established as the server behavior for grid queries in the session.
Restrictions on SELECT_GRID_ALL
Do not call the ifx_gridquery_skipped_nodes() function while the SELECT_GRID_ALL session environment variable is set to 'grid' or to 'region'.
The SELECT_GRID_ALL session environment option should not be set to 'grid' or to 'region' outside a grid context.
Examples of setting SELECT_GRID_ALL
SET ENVIRONMENT SELECT_GRID_ALL "escorial";
SET ENVIRONMENT SELECT_GRID_ALL "california";
SET ENVIRONMENT SELECT_GRID_ALL DEFAULT;
The
statement above restores the default behavior for processing queries
in the session, so that the database interprets only SELECT statements
that explicitly include the GRID clause as grid queries.For more information about grid queries, see the GRID clause and the .