Click Edit Data Target. Click OK.

Using Variables in the Oracle BI Repository 18-15 5. In the Set value for the variables dialog, verify the information is correct, and then click OK. 6. In the View Data from Table dialog, type the number of rows and the starting row for your query, and then click Query. The Results dialog lists the variables and their values. The next step is to associate variables with the initialization block. Associating Variables with Initialization Blocks The SQL SELECT statement in the Default initializer list can contain multiple columns. The order of the columns in the SQL statement and order of the variables associated with the initialization block determine the column value that is assigned to each variable. Therefore, when you associate variables with an initialization block, the value returned in the first column is assigned to the first variable in the list. For repository variable initialization blocks, when you open a repository in online mode, the value shown in the Default initialization string field of the Initialization Block dialog is the current value of that variable as known to the Oracle BI Server. The number of associated variables can be different from the number of columns being retrieved. If there are fewer variables than columns, extra column values are ignored. If there are more variables than columns, the additional variables are not refreshed they retain their original values, whatever they may be. Any legal SQL can be executed using an initialization block, including SQL that writes to the database or alters database structures, assuming the database permits the user ID associated with the connection pool to perform these actions. If you stop and restart the Oracle BI Server, the server automatically executes the SQL statement in the repository variable initialization blocks, re-initializing the repository variables. For session variable initialization blocks, you can select Row-wise initialization. The Use caching option is automatically selected when you select the Row-wise initialization option. Selecting the Use caching option directs the Oracle BI Server to store the results of the query in a main memory cache. See About Row-Wise Initialization for more information. The Oracle BI Server uses the cached results for subsequent sessions. This can reduce session startup time. However, the cached results might not contain the most current session variable values. If every new session needs the most current set of session variables and their corresponding values, you should clear this option. See About Using Initialization Blocks with Variables for more information. To associate variables with initialization blocks: 1. In the Administration Tool, select Manage, then select Variables. 2. In the Variable Manager dialog, double-click the initialization block you want to edit. You can edit repository initialization blocks, or session initialization blocks.

3. Click Edit Data Target.

4. In the [Repository|Session] Variable Initialization Block Variable Target dialog, perform one of the following steps: ■ Associate variables with the initialization block by doing one of the following: – Click New, and in the Variable dialog, create a new variable. See Creating Repository Variables or Creating Session Variables for information about creating variables. 18-16 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition – Click Link to associate an existing variable with an initialization block. Then, in the Browse dialog, select the variable to be refreshed by this initialization block and click OK. ■ Select Row-wise initialization. This option is for session variable initialization blocks only. See About Row-Wise Initialization for more information. If you select Row-wise initialization, the Use caching option becomes available. 5. To reorder variables, select a variable and click Up or Down. 6. To remove a variable from association with this block, select the variable and click Remove .

7. Click OK.

The next step is to establish execution precedence. Establishing Execution Precedence When a repository has multiple initialization blocks, you can set the order establish the precedence in which the blocks will be initialized. First, you open the block that you want to be executed last and then add the initialization blocks that you want to be executed before the block you have open. For example, suppose a repository has two initialization blocks, A and B. You open initialization block B, and then specify that block A will execute before block B. This causes block A to execute according to block Bs schedule, in addition to its own. To establish execution precedence: 1. In the Administration Tool, select Manage, then select Variables. 2. In the Variable Manager dialog, double-click the last initialization block that you want to be initialized. 3. In the [Repository|Session] Variable Initialization Block dialog, click Edit