Siebel Analytics Server Administration Guide > Using Variables in a Repository > About Initialization Blocks >

Creating and Editing Initialization Blocks


Use the following procedure to create a new initialization block or to edit properties of an existing initialization block.

To create or edit an initialization block

  1. In the Administration Tool, select Manage > Variables from the menu.
  2. The Variables Manager appears.

  3. Select Action > New > Initialization Block.
  4. Enter a name for the block. (The NQ_SYSTEM initialization block name is reserved.)
  5. Select one of the following options:
  6. If you selected associate with session variable in the preceding step, you can use the Row-Wise Initialization feature to dynamically create session variables and set their values when a session begins. For more information, see Row-Wise Initialization.
    1. Select the Row-Wise Initialization check box.
    2. Select the Cache Variables check box to direct the Siebel Analytics Server to store the results of the query in a main memory cache.
    3. If you select this option, the Siebel Analytics Server uses the cached results for subsequent sessions. This can reduce, often significantly, session startup time; however, the cached results may 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 not choose this option.

    4. Enter the SQL initialization string needed to populate the variables.
  7. Specify a refresh interval in the Refresh Time area:
    1. Select a start date and time.
    2. You can specify the day, the month, the day of the month, the year, and the hours, minutes and seconds.

    3. Enter the periodic duration of the refresh interval in either days, hours, or minutes.
    4. NOTE:  The Refresh Time area only applies to repository variables. It will be unavailable for session variables.

  8. In the Data Source Connection area, select Database, or LDAP if you are authenticating LDAP users.
  9. TIP:  You should test the SQL using an SQL tool such as the Siebel Analytics Client utility. Use the same DSN (or one set up identically) as the one named in the specified connection pool.

  10. If you selected Database in the Data Source Connection area, the SQL used to refresh the variable must reference physical tables that can be accessed through the connection pool specified in the Connection Pool field.
    1. To select the connection pool associated with the database where the target information is located, click the Browse button to the right of the Connection Pool field to open the Browse dialog box.
    2. Select the connection pool to use and click OK to return to the Initialization Block dialog box.
    3. The name of the connection pool appears in the Connection Pool field.

      NOTE:  If you do not select the connection pool before typing the initialization string to use, you will receive a message prompting you to select the connection pool to use. You can click the Test button to test the connection.

  11. If you selected Database in the Data Source Connection area, enter the initialization string to use.
  12. The values returned by the database in the columns in your SQL will be assigned to variables. The order of the variables and the order of the columns will determine which columns are assigned to which variables.

    select username, groupname, dbname, schemaname from users
    where username=':USER'
    and pwd=':PASSWORD'

    This SQL statement contains two constraints in the WHERE clause:

    ':USER' (note the colon and the single quotes) is the ID the user enters when the user logged in.

    ':PASSWORD' (again, note the colon and the single quotes) is the password the user enters. This is another system variable whose presence is always assumed when the USER system session variable is used. You do not need to set up the PASSWORD variable, and you can use this variable in a database connection pool to allow passthrough login using the user's user ID and password. You can also use this variable in a SQL if you so desire.

    The query will return data only if the user ID and password match values found in the specified table. You should test the SQL statement outside of the Siebel Analytics Server, substituting valid values for the USER and PASSWORD variables.

    select username, groupname, dbname, schemaname from users
    where username=':USER'
    NQS_PASSWORD_CLAUSE(and pwd=':PASSWORD')NQS_PASSWORD_CLAUSE

    This SQL contains two constraints in the WHERE clause:

    ':USER' (note the colon and the single quotes) equals the ID the user types when logging in.

    ':PASSWORD' (again, note the colon and the single quotes) is the password the user enters. This is another system variable whose presence is always assumed when the USER system session variable is used. You do not need to set up the PASSWORD variable, and you can use this variable in a database connection pool to allow passthrough login using the user's user ID and password. You can also use this variable in a SQL statement if you so desire.

    When using external table authentication with Siebel Delivers, the portion of the SQL statement that makes up the `:PASSWORD' constraint needs to be embedded between NQS_PASSWORD_CLAUSE clauses.

    The query will return data only if the user ID and password match values found in the specified table. You should test the SQL statement outside of the Siebel Analytics Server substituting valid values for the USER and PASSWORD variables and removing the NQS_PASSWORD_CLAUSE clause.

  13. If you selected LDAP in the Data Source Connection area, click Browse to select the LDAP Server this block will use, or click New... to open the General tab of the LDAP Server dialog box and create an LDAP Server. Click OK to return to the Initialization Block dialog box.
  14. (Optional) You can test the test the initialization block by clicking Test in the Data Source Connection area.
  15. A message box informs you whether the test was successful.


 Siebel Analytics Server Administration Guide 
 Published: 23 June 2003