Session variables are similar to dynamic repository variables in that they obtain their values from initialization blocks. Unlike dynamic repository variables, however, the initialization of session variables is not scheduled. When a user begins a session, the Oracle BI Server creates new instances of session variables and initializes them.
Unlike a repository variable, there are as many instances of a session variable as there are active sessions on the Oracle BI Server. Each instance of a session variable could be initialized to a different value.
Session variables are primarily used when authenticating users against external sources such as database tables or LDAP servers. If a user is authenticated successfully, session variables can be used to set filters and permissions for that session. For a discussion of the use of session variables in setting up security, refer to Security in Oracle BI.
For more information, refer to Creating Repository Variables.
Using System Session Variables
System session variables are session variables that the Oracle BI Server and Oracle BI Presentation Services use for specific purposes. System session variables have reserved names, that cannot be used for other kinds of variables (such as static or dynamic repository variables and nonsystem session variables).
For information about using the GROUP system session variable in conjunction with the SA System subject area to provide group membership and external email addresses to Oracle BI Delivers, refer to Setting Up the Repository to Work with Delivers.
NOTE: When you use these variables for Oracle BI Presentation Services, preface their names with NQ_SESSION. For example, to filter a column on the value of the variable LOGLEVEL set the filter to the Variable NQ_SESSION.LOGLEVEL.
Table 34 describes the available system session variables.
Using Nonsystem Session Variables
A common use for nonsystem session variables is setting user filters. For example, you could define a nonsystem variable called SalesRegion that would be initialized to the name of the user's sales region.
You could then set a security filter for all members of a group that would allow them to view only data pertinent to their region.
NOTE: When you use these variables for Oracle BI Presentation Services, preface their names with NQ_SESSION. For example, to filter a column on the value of the variable SalesRegion set the filter to the Variable NQ_SESSION.SalesRegion.
Creating Session Variables
- From the Administration Tool menu bar, choose Manage > Variables.
- In the Variable Manager dialog box, from the menu bar, choose Action > New > Session > Variable.
- In the Session Variable dialog box, type a variable name.
- For session variables, you can select the following check boxes:
- Use the Initialization Block drop-down list to select an initialization block that will be used to refresh the value on a continuing basis. To create a new initialization block, click New. For more information, refer to Process of Creating Initialization Blocks.
- To add a Default initializer value, perform one of the following steps:
- To use the Expression Builder, click the ellipsis button to the right of the Default initializer work space. For more information about creating the value, refer to SQL Logical Operators.
- Type the value into the Default initializer text box.
- Click OK.
No comments:
Post a Comment