In addition to supporting regular session variables that are populated from one data source, Oracle Business Intelligence 11.1.1.7.0 also supports session variables that can be populated from multiple data sources. These multi-source session variables can be used in logical queries or in repository data filters and contain the union of values from the different data sources. There is no restriction on the number of values that the multi-source session variable can hold. To create a multi-source session variable, you first create row-wise initialization blocks for each source.
Then, you explicitly define session variables for each source. The format for the session variable names must be:
where the separator must be exactly four underscore characters.
This automatically creates a single multi-source session variable, named:
The component session variable names (<ms_variable_name>____<source>) appear separately in the Variable Manager in the Administration Tool, but the Expression Builder displays only the single multi-source session variable name (<ms_variable_name>).
Note:
While the main focus of this section is on the definition and usage of multi-source session variables, you may also select the VALUEOF the component session variables in logical queries and data filters.
If any of the row-wise initialization blocks returns a null result, an entry is logged in the Oracle BI Server log (nqserver.log). Values can still be added to the multi-source session variable from other component initialization blocks that succeed in returning values. The multi-source session variable will fail only if all of the component initialization blocks return null values.
You can set execution precedence and deferred execution with multi-source session variables, similar to regular session variables.
The following example illustrates how to create and use a multi-source session variable:
While the component session variables appear in the Variable Manager, the multi-source session variable that has been created, MSVPRODUCTS, will appear in Expression Builder.
Using the Multi-Source Session Variable in a Logical Query:
You can now use the multi-source session variable MSVPRODUCTS in a logical query.
For example:
Select "SampleApp Lite"."D1 Products"."Product Type","SampleApp Lite"."D1 Products"."Brand","SampleApp Lite"."D1 Products"."Product" from "SampleApp Lite"."D1 Products" where "SampleApp Lite"."D1 Products"."Product"=VALUEOF(NQ_SESSION.MSVPRODUCTS)
To use the multi-source session variable MSVPRODUCTS in a data filter, perform the following steps:
Note that the Expression Builder, as shown in the image that follows, displays only the multi-source session variable MSVPRODUCTS, and not the regular session variables that were used during the creation of the multi-source session variable.
Shiva Molabanti is a Manager and Senior Architect at KPI Partners. He is a business intelligence enthusiast who likes blogging about acquisitions in the BI space, technical workings of BI tools, and Oracle Business Intelligence. Visit Shiva at his personal blog or check out Shiva's blog at KPIPartners.com.